chromebrew icon indicating copy to clipboard operation
chromebrew copied to clipboard

[binutils] i686 build causes executables to produce segmentation faults

Open uberhacker opened this issue 3 years ago • 4 comments

Although the binary package builds fine without tests, all executables will segfault. Errors from make check below:

gcctestdir/collect-ld: error: two_file_test_1.o: relocation R_386_GOTOFF against preemptible symbol _Z3t12v cannot be used when making a shared object
gcctestdir/collect-ld: error: two_file_test_1.o: relocation R_386_GOTOFF against preemptible symbol p6 cannot be used when making a shared object
gcctestdir/collect-ld: error: two_file_test_1.o: relocation R_386_GOTOFF against preemptible symbol p7 cannot be used when making a shared object
gcctestdir/collect-ld: error: two_file_test_1.o: relocation R_386_GOTOFF against preemptible symbol p8 cannot be used when making a shared object
gcctestdir/collect-ld: error: two_file_test_1.o: relocation R_386_GOTOFF against preemptible symbol p9 cannot be used when making a shared object
gcctestdir/collect-ld: error: two_file_test_1.o: relocation R_386_GOTOFF against preemptible symbol pfn cannot be used when making a shared object
gcctestdir/collect-ld: error: two_file_test_1.o: relocation R_386_GOTOFF against preemptible symbol _Z4f11av cannot be used when making a shared object
gcctestdir/collect-ld: error: two_file_test_1.o: relocation R_386_GOTOFF against preemptible symbol _Z4f13iv cannot be used when making a shared object
collect2: error: ld returned 1 exit status
make[5]: *** [Makefile:8189: two_file_shared_1_nonpic.so] Error 1
make[5]: Leaving directory '/usr/local/tmp/crew/binutils.20210725235328.dir/binutils-2.37/build/gold/testsuite'
make[4]: *** [Makefile:7793: check-am] Error 2
make[4]: Leaving directory '/usr/local/tmp/crew/binutils.20210725235328.dir/binutils-2.37/build/gold/testsuite'
make[3]: *** [Makefile:7797: check] Error 2
make[3]: Leaving directory '/usr/local/tmp/crew/binutils.20210725235328.dir/binutils-2.37/build/gold/testsuite'
make[2]: *** [Makefile:1157: check-recursive] Error 1
make[2]: Leaving directory '/usr/local/tmp/crew/binutils.20210725235328.dir/binutils-2.37/build/gold'
make[1]: *** [Makefile:6224: check-gold] Error 2
make[1]: Leaving directory '/usr/local/tmp/crew/binutils.20210725235328.dir/binutils-2.37/build'
make: *** [Makefile:2288: do-check] Error 2
binutils failed to build: `make check` exited with 2gcctestdir/collect-ld: error: two_file_test_1.o: relocation R_386_GOTOFF against preemptible symbol _Z3t12v cannot be used when making a shared object
gcctestdir/collect-ld: error: two_file_test_1.o: relocation R_386_GOTOFF against preemptible symbol p6 cannot be used when making a shared object
gcctestdir/collect-ld: error: two_file_test_1.o: relocation R_386_GOTOFF against preemptible symbol p7 cannot be used when making a shared object
gcctestdir/collect-ld: error: two_file_test_1.o: relocation R_386_GOTOFF against preemptible symbol p8 cannot be used when making a shared object
gcctestdir/collect-ld: error: two_file_test_1.o: relocation R_386_GOTOFF against preemptible symbol p9 cannot be used when making a shared object
gcctestdir/collect-ld: error: two_file_test_1.o: relocation R_386_GOTOFF against preemptible symbol pfn cannot be used when making a shared object
gcctestdir/collect-ld: error: two_file_test_1.o: relocation R_386_GOTOFF against preemptible symbol _Z4f11av cannot be used when making a shared object
gcctestdir/collect-ld: error: two_file_test_1.o: relocation R_386_GOTOFF against preemptible symbol _Z4f13iv cannot be used when making a shared object
collect2: error: ld returned 1 exit status
make[5]: *** [Makefile:8189: two_file_shared_1_nonpic.so] Error 1
make[5]: Leaving directory '/usr/local/tmp/crew/binutils.20210725235328.dir/binutils-2.37/build/gold/testsuite'
make[4]: *** [Makefile:7793: check-am] Error 2
make[4]: Leaving directory '/usr/local/tmp/crew/binutils.20210725235328.dir/binutils-2.37/build/gold/testsuite'
make[3]: *** [Makefile:7797: check] Error 2
make[3]: Leaving directory '/usr/local/tmp/crew/binutils.20210725235328.dir/binutils-2.37/build/gold/testsuite'
make[2]: *** [Makefile:1157: check-recursive] Error 1
make[2]: Leaving directory '/usr/local/tmp/crew/binutils.20210725235328.dir/binutils-2.37/build/gold'
make[1]: *** [Makefile:6224: check-gold] Error 2
make[1]: Leaving directory '/usr/local/tmp/crew/binutils.20210725235328.dir/binutils-2.37/build'
make: *** [Makefile:2288: do-check] Error 2
binutils failed to build: `make check` exited with 2

uberhacker avatar Jul 26 '21 02:07 uberhacker

Could this be a gold linker issue?

https://issues.dlang.org/show_bug.cgi?id=18798

satmandu avatar Jul 26 '21 03:07 satmandu

Same errors after switching the default back.

uberhacker avatar Jul 26 '21 07:07 uberhacker

collect-ld means that the code referenced in an included header file cannot be found in a dynamic library in the LD_LIBRARY_PATH. It's not a linker issue. lld has a really nice debugging output for the collect-ld, so you could try compiling with -fuse-ld=lld (making sure llvm is installed) instead of gold to see a good debug log. Don't do this for production as lld makes slower binaries.

saltedcoffii avatar Jul 27 '21 04:07 saltedcoffii

I'm honestly not sure if binutils can be built with llvm... it's very gcc specific.

satmandu avatar Aug 19 '21 16:08 satmandu

Binutils no longer causes issues on i686.

satmandu avatar Feb 26 '23 04:02 satmandu