Message ID | alpine.LFD.2.21.1911090021170.13542@redsun52.ssa.fujisawa.hgst.com |
---|---|
State | Superseded |
Headers | show |
Series | libgomp/test: Add flags to find libatomic in build-tree testing | expand |
On Sat, 9 Nov 2019, Maciej W. Rozycki wrote: > Add flags to find libatomic in build-tree testing, fixing a catastrophic > libgomp testsuite failure with targets such as `riscv-linux-gnu' that > imply `-latomic' with the `-pthread' GCC option, implied in turn by the > offload options, removing failures like: Ping for: <https://gcc.gnu.org/ml/gcc-patches/2019-11/msg00662.html> Maciej
On Sat, Nov 09, 2019 at 01:07:24AM +0000, Maciej W. Rozycki wrote: > --- gcc.orig/libgomp/testsuite/lib/libgomp.exp > +++ gcc/libgomp/testsuite/lib/libgomp.exp > @@ -174,6 +174,16 @@ proc libgomp_init { args } { > # For build-tree testing, also consider the library paths used for builing. > # For installed testing, we assume all that to be provided in the sysroot. > if { $blddir != "" } { > + # Offload options imply `-pthread', and that implies `-latomic' > + # on some targets, so wire in libatomic build directories. -fopenmp is not an option I'd like to call Offload option, OpenMP is much more than just offloading, and this isn't on some targets, but only one, riscv*. So, I think it should be done only for that target and talk about -fopenmp/-fopenacc options instead of Offload options. > + set shlib_ext [get_shlib_extension] > + set atomic_library_path "${blddir}/../libatomic/.libs" > + if { [file exists "${atomic_library_path}/libatomic.a"] > + || [file exists \ > + "${atomic_library_path}/libatomic.${shlib_ext}"] } { > + lappend ALWAYS_CFLAGS "additional_flags=-L${atomic_library_path}" > + append always_ld_library_path ":${atomic_library_path}" > + } > global cuda_driver_include > global cuda_driver_lib > if { $cuda_driver_include != "" } { Jakub
Index: gcc/libgomp/testsuite/lib/libgomp.exp =================================================================== --- gcc.orig/libgomp/testsuite/lib/libgomp.exp +++ gcc/libgomp/testsuite/lib/libgomp.exp @@ -174,6 +174,16 @@ proc libgomp_init { args } { # For build-tree testing, also consider the library paths used for builing. # For installed testing, we assume all that to be provided in the sysroot. if { $blddir != "" } { + # Offload options imply `-pthread', and that implies `-latomic' + # on some targets, so wire in libatomic build directories. + set shlib_ext [get_shlib_extension] + set atomic_library_path "${blddir}/../libatomic/.libs" + if { [file exists "${atomic_library_path}/libatomic.a"] + || [file exists \ + "${atomic_library_path}/libatomic.${shlib_ext}"] } { + lappend ALWAYS_CFLAGS "additional_flags=-L${atomic_library_path}" + append always_ld_library_path ":${atomic_library_path}" + } global cuda_driver_include global cuda_driver_lib if { $cuda_driver_include != "" } {