[Bug c++/65255] std::thread does not work for cross compiling on ARM

2017-01-13 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65255

--- Comment #10 from Jonathan Wakely  ---
(In reply to Jonathan Wakely from comment #8)
> I have a patch for std::thread which would mean it doesn't use shared_ptr,
> so this wouldn't be a problem even if you don't use the same arm version.

This change was made for GCC 6.1, see PR 65393

[Bug c++/65255] std::thread does not work for cross compiling on ARM

2015-08-11 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65255

--- Comment #5 from Andrew Pinski pinskia at gcc dot gnu.org ---
arm-* defaults to earlier arm than v7 which does not have atomics in the ISA.

Your native compiler most likely defaulted to armv7 which uses the atomic
instructions directly.

Can you provide the output of gcc -v that you are running natively and most
likely see the default cpu/arch that is being selected.


[Bug c++/65255] std::thread does not work for cross compiling on ARM

2015-08-11 Thread yyc1992 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65255

--- Comment #6 from Yichao Yu yyc1992 at gmail dot com ---
Adding `-march=armv7-a` indeed fixes the issue. Thanks.

Does this mean that `std::thread` is not supported on armv6? Would be nice to
have a warning/error if it is possible to detect this.

FWIW, `clang -march=armv6` doesn't have this issue...


[Bug c++/65255] std::thread does not work for cross compiling on ARM

2015-08-11 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65255

--- Comment #7 from Jonathan Wakely redi at gcc dot gnu.org ---
It's supported fine, but you need to compile your code that uses std::thread so
it is compatible with the libstdc++.so library you link to.

If libstdc++ is compiled to use atomic operations in shared_ptr then you need
to compile your code so it also uses atomics. If libstdc++ is compiled to use
mutexes in shared_ptr then you need to compile your code the same way.


[Bug c++/65255] std::thread does not work for cross compiling on ARM

2015-08-11 Thread yyc1992 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65255

Yichao Yu yyc1992 at gmail dot com changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |INVALID

--- Comment #9 from Yichao Yu yyc1992 at gmail dot com ---
Thanks for the explaination.

 I have a patch for std::thread which would mean it doesn't use shared_ptr, so 
 this wouldn't be a problem even if you don't use the same arm version.

I guess this might be the implementation detail that causes this to not happen
for clang but I agree in general finding the right version of library at
runtime is more of a distribution / system manager problem.


[Bug c++/65255] std::thread does not work for cross compiling on ARM

2015-08-11 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65255

--- Comment #8 from Jonathan Wakely redi at gcc dot gnu.org ---
I have a patch for std::thread which would mean it doesn't use shared_ptr, so
this wouldn't be a problem even if you don't use the same arm version.


[Bug c++/65255] std::thread does not work for cross compiling on ARM

2015-02-28 Thread yyc1992 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65255

--- Comment #2 from Yichao Yu yyc1992 at gmail dot com ---
ARM environment is ArchLinuxARM (armv7h)[1] on a Xilinx Zynq 0702 Eval board
which has a dual-core Cortex-a9 processor.

[1] http://archlinuxarm.org/packages


[Bug c++/65255] std::thread does not work for cross compiling on ARM

2015-02-28 Thread yyc1992 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65255

--- Comment #3 from Yichao Yu yyc1992 at gmail dot com ---
I didn't keep the config.log file used to compile the gcc I used to compile the
binary attached but here's the config.log of a slightly later snapshot
(20150204, which is the same used for the arm native compiler) which reproduce
the same issue at runtime.


[Bug c++/65255] std::thread does not work for cross compiling on ARM

2015-02-28 Thread yyc1992 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65255

--- Comment #1 from Yichao Yu yyc1992 at gmail dot com ---
Created attachment 34904
  -- https://gcc.gnu.org/bugzilla/attachment.cgi?id=34904action=edit
Source and output programs


[Bug c++/65255] std::thread does not work for cross compiling on ARM

2015-02-28 Thread yyc1992 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65255

--- Comment #4 from Yichao Yu yyc1992 at gmail dot com ---
Created attachment 34905
  -- https://gcc.gnu.org/bugzilla/attachment.cgi?id=34905action=edit
config.log of a more recent snapshot