GCC fails to build.

Tadeus Prastowo tadeus.prastowo@unitn.it
Sat Jan 11 00:49:00 GMT 2020


Hello,

On Fri, Jan 10, 2020 at 2:25 AM DAVID STUMPH <DSTUMPH1144@smail.pcd.edu> wrote:
>
> Hello,
>
> I am trying to build a cross compiler, and I have tried multiple times to build it, but if fails during linking libgcc_s.so. I was following the guide at https://preshing.com/20141119/how-to-build-a-gcc-cross-compiler/, which admittedly is for an older version, but I have used it successfully with GCC 7.1.0. I was trying to build GCC 9.2.0 for arm-linux-gnueabihf on a x86_64-linux-gnu Debian 10 machine, and I have gotten to the last step in the guide.

Could you be more specific as to which last step, please?  Is it `7.
Standard C++ Library'?

> However, it gives me the following error:
>
> /home/user/pi/install/arm-linux-gnueabihf/bin/ld: cannot find /home/user/pi/install/arm-linux-gnueabihf/lib/libc.so.6 inside /home/user/pi/bgcc/gcc/../../install
>
> /home/user/pi/install/arm-linux-gnueabihf/bin/ld: cannot find /home/user/pi/install/arm-linux-gnueabihf/lib/libc_nonshared.a inside /home/user/pi/bgcc/gcc/../../install
>
> /home/user/pi/install/arm-linux-gnueabihf/bin/ld: cannot find /home/user/pi/install/arm-linux-gnueabihf/lib/ld-linux.so.3 inside /home/user/pi/bgcc/gcc/../../install
>
> All of those files exist, and were installed from glibc-2.30, which I built as a part of this project. I can't tell why ld is looking for an absolute path inside of a directory, and could that be the problem?
>
> Thanks for any help, and I will post more information about my build if requested.

Definitely you should have included more details, but I decided to
reproduce https://preshing.com/20141119/how-to-build-a-gcc-cross-compiler/
myself on Ubuntu 16.04.6 with the following components: wget
https://{ftpmirror.gnu.org/{{binutils/binutils-2.33.1,gcc/gcc-9.2.0/gcc-9.2.0,glibc/glibc-2.30,mpfr/mpfr-4.0.2,gmp/gmp-6.1.2}.tar.xz{,.sig},mpc/mpc-1.1.0.tar.gz{,.sig}},gcc.gnu.org/pub/gcc/infrastructure/{isl-0.18.tar.bz2,cloog-0.18.1.tar.gz},mirrors.edge.kernel.org/pub/linux/kernel/v5.x/linux-5.4.10.tar.{sign,xz}}

The first failure I encountered was the following in Step 7 during
`make -j4', which is also one of the blog comments:
$ /bin/bash ../libtool  --tag=CXX   --mode=compile
/home/eus/test/build-gcc/./gcc/xgcc -shared-libgcc
-B/home/eus/test/build-gcc/./gcc -nostdinc++
-L/home/eus/test/build-gcc/aarch64-linux/libstdc++-v3/src
-L/home/eus/test/build-gcc/aarch64-linux/libstdc++-v3/src/.libs
-L/home/eus/test/build-gcc/aarch64-linux/libstdc++-v3/libsupc++/.libs
-B/home/eus/test/install/aarch64-linux/bin/
-B/home/eus/test/install/aarch64-linux/lib/ -isystem
/home/eus/test/install/aarch64-linux/include -isystem
/home/eus/test/install/aarch64-linux/sys-include    -D_GNU_SOURCE
-D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS
-D__STDC_LIMIT_MACROS -DASAN_HAS_EXCEPTIONS=1 -DASAN_NEEDS_SEGV=1
-DCAN_SANITIZE_UB=0  -I. -I../../../../gcc-9.2.0/libsanitizer/asan
-I..  -I ../../../../gcc-9.2.0/libsanitizer/include -I
../../../../gcc-9.2.0/libsanitizer  -Wall -W -Wno-unused-parameter
-Wwrite-strings -pedantic -Wno-long-long -fPIC -fno-builtin
-fno-exceptions -fno-rtti -fomit-frame-pointer -funwind-tables
-fvisibility=hidden -Wno-variadic-macros -fno-ipa-icf
-I../../libstdc++-v3/include
-I../../libstdc++-v3/include/aarch64-linux
-I../../../../gcc-9.2.0/libsanitizer/../libstdc++-v3/libsupc++
-std=gnu++11  -g -O2 -D_GNU_SOURCE -MT asan_linux.lo -MD -MP -MF
.deps/asan_linux.Tpo -c -o asan_linux.lo
../../../../gcc-9.2.0/libsanitizer/asan/asan_linux.cc
libtool: compile:  /home/eus/test/build-gcc/./gcc/xgcc -shared-libgcc
-B/home/eus/test/build-gcc/./gcc -nostdinc++
-L/home/eus/test/build-gcc/aarch64-linux/libstdc++-v3/src
-L/home/eus/test/build-gcc/aarch64-linux/libstdc++-v3/src/.libs
-L/home/eus/test/build-gcc/aarch64-linux/libstdc++-v3/libsupc++/.libs
-B/home/eus/test/install/aarch64-linux/bin/
-B/home/eus/test/install/aarch64-linux/lib/ -isystem
/home/eus/test/install/aarch64-linux/include -isystem
/home/eus/test/install/aarch64-linux/sys-include -D_GNU_SOURCE
-D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS
-D__STDC_LIMIT_MACROS -DASAN_HAS_EXCEPTIONS=1 -DASAN_NEEDS_SEGV=1
-DCAN_SANITIZE_UB=0 -I. -I../../../../gcc-9.2.0/libsanitizer/asan -I..
-I ../../../../gcc-9.2.0/libsanitizer/include -I
../../../../gcc-9.2.0/libsanitizer -Wall -W -Wno-unused-parameter
-Wwrite-strings -pedantic -Wno-long-long -fPIC -fno-builtin
-fno-exceptions -fno-rtti -fomit-frame-pointer -funwind-tables
-fvisibility=hidden -Wno-variadic-macros -fno-ipa-icf
-I../../libstdc++-v3/include
-I../../libstdc++-v3/include/aarch64-linux
-I../../../../gcc-9.2.0/libsanitizer/../libstdc++-v3/libsupc++
-std=gnu++11 -g -O2 -D_GNU_SOURCE -MT asan_linux.lo -MD -MP -MF
.deps/asan_linux.Tpo -c
../../../../gcc-9.2.0/libsanitizer/asan/asan_linux.cc  -fPIC -DPIC -o
.libs/asan_linux.o
../../../../gcc-9.2.0/libsanitizer/asan/asan_linux.cc: In function
‘void __asan::AsanCheckIncompatibleRT()’:
../../../../gcc-9.2.0/libsanitizer/asan/asan_linux.cc:216:21: error:
‘PATH_MAX’ was not declared in this scope
  216 |       char filename[PATH_MAX];
      |                     ^~~~~~~~
../../../../gcc-9.2.0/libsanitizer/asan/asan_linux.cc:217:35: error:
‘filename’ was not declared in this scope; did you mean ‘fileno’?
  217 |       MemoryMappedSegment segment(filename, sizeof(filename));
      |                                   ^~~~~~~~
      |                                   fileno

Did you encounter that failure too?  If so, how did you fix that
(AFAIK, the comment on the blog hasn't got any reply)?

--
Best regards,
Tadeus



More information about the Gcc-help mailing list