I have been working on resolving issues in build scripts that were built based on LFS a few years
back. I tried over the last week and tried multiple versions and solutions from different sites. Learned a lot as I put more effort. I need your help as I couldn't get the reason behind the issue. Based on LFS, pass 1 completed and dummy.c file execution was a success. Then I get the error in binutils in pass 2. http://www.linuxfromscratch.org/lfs/view/7.10-systemd/chapter05/binutils-pass2.html GCC 6.2.0 binutils 2.27 glibc 2.24 train@ubuntu:~$ uname -a Linux ubuntu 4.15.0-112-generic #113~16.04.1-Ubuntu SMP Fri Jul 10 04:37:08 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux train@ubuntu:~$ gcc --version gcc (Ubuntu 5.4.0- 6ubuntu1~16.04.12) 5.4.0 20160609 train@ubuntu:~$ ldd --version ldd (Ubuntu GLIBC 2.23-0ubuntu11.2) 2.23 train@ubuntu:~$ gcc dummy.c train@ubuntu:~$ readelf -l a.out | grep linux [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2] train@ubuntu:~$ /tools/bin/x86_64-tc-linux-gnu-gcc dummy.c train@ubuntu:~$ readelf -l a.out | grep linux [Requesting program interpreter: /tools/lib64/ld-linux- x86-64.so.2] cd binutils-2.27-compile; CXXFLAGS="-O2 -m64 -fPIC" CFLAGS="-O2 -m64 -fPIC" CC=x86_64-tc-linux-gnu-gcc AR=x86_64-tc-linux-gnu-ar RANLIB=x86_64-tc-linux-gnu-ranlib ../binutils-2.27/configure --prefix=/tools ******* Contents from config log ************** configure:2297: checking build system type configure:2311: result: x86_64-pc-linux-gnu configure:2358: checking host system type configure:2371: result: x86_64-pc-linux-gnu configure:2391: checking target system type configure:2404: result: x86_64-pc-linux-gnu configure:2458: checking for a BSD-compatible install configure:2526: result: /usr/bin//install -c configure:2537: checking whether ln works configure:2559: result: yes configure:2563: checking whether ln -s works configure:2567: result: yes configure:2574: checking for a sed that does not truncate output configure:2638: result: /bin/sed configure:2647: checking for gawk configure:2663: found /usr/bin//gawk configure:2674: result: gawk configure:4121: checking for gcc configure:4148: result: x86_64-tc-linux-gnu-gcc configure:4377: checking for C compiler version configure:4386: x86_64-tc-linux-gnu-gcc --version >&5 x86_64-tc-linux-gnu-gcc (GCC) 6.2.0 Copyright (C) 2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. configure:4397: $? = 0 configure:4386: x86_64-tc-linux-gnu-gcc -v >&5 Using built-in specs. COLLECT_GCC=x86_64-tc-linux-gnu-gcc COLLECT_LTO_WRAPPER=/home/train/swe/distrib/tools/bin/../libexec/gcc/x86_64-tc-linux-gnu/6.2.0/lto- wrapper Target: x86_64-tc-linux-gnu Configured with: ../gcc-6.2.0/configure --prefix=/tools --target=x86_64-tc-linux-gnu --prefix=/tools --with-sysroot=/home/train/swe/distrib --with-newlib --without-headers --with-local-prefix=/tools -- with-native-system-header-dir=/tools/include --disable-nls --disable-shared --disable-multilib -- disable-decimal-float --disable-threads --disable-libmudflap --disable-libssp --disable-libatomic -- disable-libstdcxx --disable-libmpx --disable-libgomp --disable-libvtv --disable-libquadmath --enable- languages=c,c++ Thread model: single gcc version 6.2.0 (GCC) configure:4397: $? = 0 configure:4386: x86_64-tc-linux-gnu-gcc -V >&5 x86_64-tc-linux-gnu-gcc: error: unrecognized command line option '-V' x86_64-tc-linux-gnu-gcc: fatal error: no input files compilation terminated. configure:4397: $? = 1 configure:4386: x86_64-tc-linux-gnu-gcc -qversion >&5 x86_64-tc-linux-gnu-gcc: error: unrecognized command line option '-qversion'; did you mean '-- version'? x86_64-tc-linux-gnu-gcc: fatal error: no input files compilation terminated. configure:4397: $? = 1 configure:4417: checking for C compiler default output file name configure:4439: x86_64-tc-linux-gnu-gcc -O2 -m64 -fPIC conftest.c >&5 configure:4443: $? = 0 configure:4480: result: a.out configure:4496: checking whether the C compiler works configure:4505: ./a.out ../binutils-2.27/configure: line 4507: 87493 Segmentation fault (core dumped) ./$ac_file configure:4509: $? = 139 configure:4516: error: in `/home/train/swe/distrib/build/sources/binutils/binutils-2.27-compile': configure:4520: error: cannot run C compiled programs. If you meant to cross compile, use `--host'. See `config.log' for more details. Would appreciate any help on this
-- http://lists.linuxfromscratch.org/listinfo/lfs-dev FAQ: http://www.linuxfromscratch.org/faq/ Unsubscribe: See the above information page