Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LD segfault: assertion fail .../.build/arc-snps-linux-uclibc/src/binutils/bfd/arc-got.h:382 #523

Closed
yaroslavsadin opened this issue Apr 20, 2023 · 10 comments
Assignees
Milestone

Comments

@yaroslavsadin
Copy link
Collaborator

yaroslavsadin commented Apr 20, 2023

Hi,

Recent builds of uClibc toolchains fail with the following error:

[ALL  ]        LD ld-uClibc-1.0.42.so
[ALL  ]      .../.build/arc-snps-linux-uclibc/buildtools/lib/gcc/arc-snps-linux-uclibc/12.2.1/../../../../arc-snps-linux-uclibc/bin/ld: BFD (ARCompact ISA Linux uClibc toolchain - build 1337) 2.40.50.20230314 assertion fail .../.build/arc-snps-linux-uclibc/src/binutils/bfd/arc-got.h:382
[ERROR]      collect2: fatal error: ld terminated with signal 11 [Segmentation fault]
[ALL  ]      compilation terminated.
[ERROR]      make[1]: *** [lib/ld-uClibc.so] Error 1

CC @abrodkin

@abrodkin abrodkin changed the title uClibc toolchains build failure LD segfault: assertion fail .../.build/arc-snps-linux-uclibc/src/binutils/bfd/arc-got.h:382 Apr 20, 2023
@fbedard fbedard assigned shahab-vahedi and unassigned claziss Apr 20, 2023
@shahab-vahedi
Copy link
Member

Same comment should apply here.

@yaroslavsadin
Copy link
Collaborator Author

@yaroslavsadin
Copy link
Collaborator Author

Just to verify myself, from the logs:

'binutils-git-8f360663' (git https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb.git, branch arc-2023.03)

@claziss
Copy link
Contributor

claziss commented May 4, 2023

@yaroslavsadin please prepare a show case for this issue, in the same style like @pavelvkozlov did. Thanks.

@yaroslavsadin
Copy link
Collaborator Author

@claziss I emailed you instructions on how to reproduce yesterday, please check. Attaching full log here also.
build.log

@shahab-vahedi
Copy link
Member

@yaroslavsadin Once again, please kindly look into all the comments in #524 and provide your inputs like that.

@pavelvkozlov
Copy link

I've reproduced the same issue manually, but for ARCv3 32-bit variant.
Archive with object files and Makefile to reproduce this ld fault issue: ld-fault-uclibc.zip
Hope this will be helpful.
The sequence is the same as in #524:

Configure, build, install buinutils:
$ ../configure --target=arc32-linux-gnu --prefix=/tmp/install/arc32 --disable-multilib --disable-werror --disable-nls --with-expat=yes --disable-sim
$ make -j8 && make install

Link example object files:
$ cd /tmp/ls-fault-uclibc
$ make LD_PATH=/tmp/install/arc32/bin/
/tmp/install/arc32/bin/arc32-linux-gnu-ld --eh-frame-hdr -shared -X -o ./ld-uClibc-1.0.43.so -v \
 -z combreloc -z relro -z now -O2 -z defs -e _start -z now -Bsymbolic --export-dynamic --sort-common \
 --no-undefined --discard-locals --discard-all -soname=ld-uClibc.so.1 --whole-archive ./ld-uClibc_so.a \
 --no-whole-archive ./libgcc.a
GNU ld (GNU Binutils) 2.40.50.20230314
/tmp/install/arc32/bin/arc32-linux-gnu-ld: BFD (GNU Binutils) 2.40.50.20230314 assertion fail ../../bfd/arc-got.h:382
make: *** [Makefile:5: ld-uClibc-1.0.43.so] Segmentation fault
make: *** Deleting file 'ld-uClibc-1.0.43.so'

@abrodkin abrodkin added this to the 2023.03 milestone May 8, 2023
@claziss
Copy link
Contributor

claziss commented May 9, 2023

The linker is fixing a local symbol, namely _dl_start which is triggering the BFD_ASSERT statement. Remove it and make the following if-stmt safe. Fix here: foss-for-synopsys-dwc-arc-processors/binutils-gdb@e16f66c

@yaroslavsadin
Copy link
Collaborator Author

This one's fixed now, thanks.

@abrodkin
Copy link
Member

Confirmed as fixed with foss-for-synopsys-dwc-arc-processors/binutils-gdb@e16f66c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants