On Mon, Jul 4, 2022 at 3:09 PM Martin Liška <mli...@suse.cz> wrote: > > On 7/4/22 14:28, Richard Biener wrote: > > ... but ... is libatomic properly built for the host? libgo is a > > target library. > > You're correct. > > Well, so the host library should be taken, which works for stage1 lto-plugin: > > [ 668s] libtool: link: gcc -shared -fPIC -DPIC .libs/lto-plugin.o > -pthread -static-libgcc -Wl,--version-script=../../lto-plugin/lto-plugin.map > -static-libstdc++ -static-libgcc ../libiberty/pic/libiberty.a -pthread > -Wl,-soname -Wl,liblto_plugin.so -o .libs/liblto_p > > while it fails in stage2: > > [ 7129s] libtool: link: > /home/abuild/rpmbuild/BUILD/gcc-13.0.0+git194120/obj-riscv64-suse-linux/./prev-gcc/xgcc > > -B/home/abuild/rpmbuild/BUILD/gcc-13.0.0+git194120/obj-riscv64-suse-linux/./prev-gcc/ > -B/usr/riscv64-suse-linux/bin/ -B/usr/riscv64-suse-linux/bin/ > -B/usr/riscv64-suse-linux/lib/ -isystem /usr/riscv64-suse-linux/include > -isystem /usr/riscv64-suse-linux/sys-include -fno-checking -shared -fPIC > -DPIC .libs/lto-plugin.o -pthread -static-libgcc > -Wl,--version-script=../../lto-plugin/lto-plugin.map -static-libstdc++ > -static-libgcc ../libiberty/pic/libiberty.a -pthread -Wl,-soname > -Wl,liblto_plugin.so -o .libs/liblto_plugin.so > > Where the system compiler takes the library from: > /usr/lib/gcc/riscv64-linux-gnu/11/libatomic.so > > that points to system library location: > ls -l /usr/lib/gcc/riscv64-linux-gnu/11/libatomic.so > lrwxrwxrwx 1 root root 41 Mar 24 14:22 > /usr/lib/gcc/riscv64-linux-gnu/11/libatomic.so -> > ../../../riscv64-linux-gnu/libatomic.so.1 > > So the question is how to fix that?
We'd need to add libatomic as host_module in Makefile.def and also bootstrap that (since lto-plugin is bootstrapped), plus adding the required dependency. At least for the targets that need this. Or give up and use better means of serialization or use a whitelist for now (via lto-plugin configury) and leave all not covered targets not thread-safe (see also the mingw bugreport). Richard. > > Martin >