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

Binutils with GDB option crashes on bfd/doc #1422

Closed
jaapvstr opened this issue Nov 16, 2020 · 3 comments
Closed

Binutils with GDB option crashes on bfd/doc #1422

jaapvstr opened this issue Nov 16, 2020 · 3 comments

Comments

@jaapvstr
Copy link

Issue submission guidelines

See detaled guidelines. In short:

  • Report crosstool-NG version
    1.24.0
  • Report host OS and its version
    Linux 4.14.x
  • Attach .config (unless the issue is not related to any configuration)
    STABLE-binutillibs.txt
  • Attach build.log (unless crosstool-NG fails before the build starts)
    build.STABLE-binutillibs.zip

While building GCC-4.9.4 with LIBC-2.23 / max ABI 2.22 and Binutils 2.27 the process crashes while reporting it's unable to find cc1. I've seen the same error before in other configuration settings and other binutils versions though, so doubt if it's specific to the versions selected. Unticking the GDB option with the exact same configuration makes crosstool-ng complete without issues.

[ALL ] Making info in doc
[ALL ] make[3]: Entering directory /volume2/crosstool-ng-1.24.0/bin/.build/x86_64-asustor-linux-gnu/build/build-binutils-for-target/bfd/doc' [ALL ] gcc -o chw$$ -I.. -I/volume2/crosstool-ng-1.24.0/bin/.build/x86_64-asustor-linux-gnu/src/binutils/bfd/doc/.. -I/volume2/crosstool-ng-1.24.0/bin/.build/x86_64-asustor-linux-gnu/src/binutils/bfd/doc/../../include -I/volume2/crosstool-ng-1.24.0/bin/.build/x86_64-asustor-linux-gnu/src/binutils/bfd/doc/../../intl -I../../intl /volume2/crosstool-ng-1.24.0/bin/.build/x86_64-asustor-linux-gnu/src/binutils/bfd/doc/chew.c; /volume2/toolchain-ng/x86_64-asustor-linux-gnu/sysroot/bin//bash /volume2/crosstool-ng-1.24.0/bin/.build/x86_64-asustor-linux-gnu/src/binutils/bfd/doc/../../move-if-change chw$$ chew; touch chew.stamp [ALL ] gcc: error trying to exec 'cc1': execvp: No such file or directory [ALL ] creating bfdver.texi [ALL ] mv: cannot stat 'chw479': No such file or directory [ALL ] ./chew -f /volume2/crosstool-ng-1.24.0/bin/.build/x86_64-asustor-linux-gnu/src/binutils/bfd/doc/doc.str < /volume2/crosstool-ng-1.24.0/bin/.build/x86_64-asustor-linux-gnu/src/binutils/bfd/doc/../aoutx.h >aoutx.tmp [ALL ] ./chew -f /volume2/crosstool-ng-1.24.0/bin/.build/x86_64-asustor-linux-gnu/src/binutils/bfd/doc/doc.str < /volume2/crosstool-ng-1.24.0/bin/.build/x86_64-asustor-linux-gnu/src/binutils/bfd/doc/../archive.c >archive.tmp [ALL ] ./chew -f /volume2/crosstool-ng-1.24.0/bin/.build/x86_64-asustor-linux-gnu/src/binutils/bfd/doc/doc.str < /volume2/crosstool-ng-1.24.0/bin/.build/x86_64-asustor-linux-gnu/src/binutils/bfd/doc/../archures.c >archures.tmp [ALL ] /volume2/toolchain-ng/x86_64-asustor-linux-gnu/sysroot/bin//bash: ./chew: No such file or directory [ERROR] make[3]: *** [aoutx.stamp] Error 127 [ERROR] make[3]: *** Waiting for unfinished jobs.... [ALL ] /volume2/toolchain-ng/x86_64-asustor-linux-gnu/sysroot/bin//bash: ./chew: No such file or directory [ERROR] make[3]: *** [archive.stamp] Error 127 [ALL ] /volume2/toolchain-ng/x86_64-asustor-linux-gnu/sysroot/bin//bash: ./chew: No such file or directory [ERROR] make[3]: *** [archures.stamp] Error 127 [ALL ] make[3]: Leaving directory /volume2/crosstool-ng-1.24.0/bin/.build/x86_64-asustor-linux-gnu/build/build-binutils-for-target/bfd/doc'
[ERROR] make[2]: *** [info-recursive] Error 1
[ERROR] make[2]: *** Waiting for unfinished jobs....
[ALL ] mv -f targmatch.new targmatch.h
[ALL ] make[2]: Leaving directory /volume2/crosstool-ng-1.24.0/bin/.build/x86_64-asustor-linux-gnu/build/build-binutils-for-target/bfd' [ERROR] make[1]: *** [all-bfd] Error 2 [ALL ] make[1]: Leaving directory /volume2/crosstool-ng-1.24.0/bin/.build/x86_64-asustor-linux-gnu/build/build-binutils-for-target'

Still troubleshooting and will apend with comments while I go along with trial-and-error troubleshooting, but if the issue rings a bell, feedback on what I could try as a solution is much appreciated.

@cpackham
Copy link
Contributor

I've seen the execvp: No such file or directory error when it's picked up the wrong ld.so during a build. Or there might be some environment variable pointing gcc at the wrong cc1.

@jaapvstr
Copy link
Author

jaapvstr commented Nov 17, 2020

Ah thanks. That helped me solve the issue. What seems to have happened is the following.

I used an existing toolchain build with crosstool-ng 1.22.0 to build the new toolchain with crosstool-ng 1.24.0.
It has gcc in both BASEDIR/bin (with vendor tuple) & BASEDIR/x86_64-asustor-linux-gnu/bin (without vendor tuple)

BASEDIR/libexec/gcc has cc1, while BASEDIR/x86_64-asustor-linux-gnu/libexec doesn't

What solved it for me is :

  1. Ensure BASEDIR/bin is on PATH before BASEDIR/x86_64-asustor-linux-gnu/bin (was already the case)
  2. Also create symlinks for all the BASEDIR/bin to also have a vendor-tuple-less entry

ln -s x86_64-asustor-linux-gnu-gdb gdb
ln -s x86_64-asustor-linux-gnu-gprof gprof
ln -s x86_64-asustor-linux-gnu-ld ld
ln -s x86_64-asustor-linux-gnu-ld.bfd ld.bfd
ln -s x86_64-asustor-linux-gnu-ld.gold ld.gold
ln -s x86_64-asustor-linux-gnu-ldd ldd
ln -s x86_64-asustor-linux-gnu-nm nm
ln -s x86_64-asustor-linux-gnu-objcopy objcopy
ln -s x86_64-asustor-linux-gnu-objdump objdump
ln -s x86_64-asustor-linux-gnu-pkg-config pkg-config
ln -s x86_64-asustor-linux-gnu-populate populate
ln -s x86_64-asustor-linux-gnu-ranlib ranlib
ln -s x86_64-asustor-linux-gnu-readelf readelf
ln -s x86_64-asustor-linux-gnu-size size
ln -s x86_64-asustor-linux-gnu-strings strings
ln -s x86_64-asustor-linux-gnu-strip strip
ln -s x86_64-asustor-linux-gnu-addr2line addr2line
ln -s x86_64-asustor-linux-gnu-ar ar
ln -s x86_64-asustor-linux-gnu-as as
ln -s x86_64-asustor-linux-gnu-c++ c++
ln -s x86_64-asustor-linux-gnu-c++filt c++filt
ln -s x86_64-asustor-linux-gnu-cc cc
ln -s x86_64-asustor-linux-gnu-cpp cpp
ln -s x86_64-asustor-linux-gnu-ct-ng.config ct-ng.config
ln -s x86_64-asustor-linux-gnu-elfedit elfedit
ln -s x86_64-asustor-linux-gnu-g++ g++
ln -s x86_64-asustor-linux-gnu-gcc gcc
ln -s x86_64-asustor-linux-gnu-gcc-4.6.4 gcc-4.6.4
ln -s x86_64-asustor-linux-gnu-gcov gcov

Seems somehow binutils GDB doesn't pick vendor tupled GCC's.

@cpackham
Copy link
Contributor

So are we calling this closed with changes to the build environment?

@cpackham cpackham closed this as completed Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants