4

I am trying to build gcc G4.8.5 for architecture s390x(cross compiled) on x86 32(sles10 patchlevel 4) 2.6.16.60-0.85.1-vmipae
for sles12sp2 and i am getting an error

/s390x-suse-linux/bin/ld: cannot find -lm
collect2: error: ld returned 1 exit status
---------------------------------------------
 /s390x-suse-linux/libstdc++-v3/src'
 make[3]: *** [all-recursive] Error 1
 make[3]: Leaving directory `toolchain_s390/build.s390x/gcc/s390x-suse-linux/libstdc++-v3'
 make[2]: *** [all] Error 2
 Error building GCC

Any guidance in right direction is highly appreciated

Update: I am able to build binutils compat compat_binutils compat_gcc compat_gettext compat_links compat_m4 gmp links mpc mpfr

MikasaAckerman
  • 339
  • 1
  • 3
  • 9

1 Answers1

5

It looks like you’re trying to build the full GCC cross-compiler, but that needs a cross-built libc which you apparently don’t have yet. To build a cross-compiler, you need to

  • build a stage 1 C-only cross-GCC (configure with --languages=c or --languages=c,c++ at the most, build with make all-gcc, install with make install-gcc),
  • use that to build libc for your target,
  • build the full cross-GCC.
Stephen Kitt
  • 411,918
  • 54
  • 1,065
  • 1,164