crosstool-0.17: gcc-3.3/glibc-2.3.2 99% working on sh4

Dan Kegel dank@kegel.com
Mon Aug 4 16:11:00 GMT 2003


crosstool is a set of scripts for building and testing cross-compilers
based on gcc/glibc/linux.

A new release is ready, and can be downloaded from
      http://kegel.com/crosstool

The big change with this release is that it builds gcc-3.3/glibc-2.3.2
properly on sh4, thanks to patches from Kaz Kojima.
You can see the regression test summaries at
      http://www.kegel.com/crosstool/current/summaries/
They're not entirely pretty for sh4, but at least it's a start.

Changelog:
0.17 4 Aug 2003
      The sh4 toolchain is now in about the same state on glibc-2.3.2 as it was on
      glibc-2.2.5, which is to say a bit shaky compared to ppc405 and ppc750:
      powerpc-750/gcc-3.3/glibc-2.3.2: fails 1 out of 339 glibc tests
      powerpc-750/gcc-3.3/glibc-2.2.5: fails 1 out of 247 glibc tests
      powerpc-405/gcc-3.3/glibc-2.3.2: fails 5 out of 339 glibc tests
      powerpc-405/gcc-3.3/glibc-2.2.5: fails 5 out of 247 glibc tests
      sh4/gcc-3.3/glibc-2.3.2:         fails 19 out of 339 glibc tests
      sh4/gcc-3.3/glibc-2.2.5:         fails 12 out of 247 glibc tests
      Still, at least crosstool can now build sh4/gcc-3.3/glibc-2.3.2, which
      should make it easier for newcomers to verify these test failures and
      perhaps even fix them.

      Thanks to Kaz Kojima for his patient assistance!  This release contains
      three patches he wrote to help me get past dynamic linking problems on SH:

      1. gcc-3.3-patches/sh-spec.patch fixes an early segmentation fault in ld-linux.so
      which caused all dynamically-linked programs to fail on sh4 with glibc-2.3.2.
      It seems gcc on SH has for years been inserting an rpath of /lib
      when you didn't specify one, which runs afoul of the new
        assert (info[DT_RPATH] == NULL);
      at line 161 in glibc-2.3.2/elf/dynamic-link.h.
      Simply removing this default rpath from gcc's spec file cures the crash.

      The following two patches are needed because glibc-2.3.2 (as of Dec
      2002) checks at build time to make sure its shared libraries don't
      need text relocations (which would hurt prelinking).

      2. gcc-3.3-patches/sh-pic-set_fpscr.patch fixes part one cause of
      make[2]: *** [/build/sh4-unknown-linux-gnu/gcc-3.3-glibc-2.3.2/build-glibc/elf/check-textrel.out] Error 1
      Without it, check-textrel complains
              libc.so: text relocations used
              linuxthreads/libc.so: text relocations used
              math/libm.so: text relocations used
      because there was no PIC version of set_fpscr().

      3. binutils-2.14.90.0.5-patches/binutils-sh-relocs.patch fixes another cause of:
      make[2]: *** [/build/sh4-unknown-linux-gnu/gcc-3.3-glibc-2.3.2/build-glibc/elf/check-textrel.out] Error 1
      Without it, check-textrel complains
              libc.so: text relocations used
              linuxthreads/libc.so: text relocations used
              linuxthreads/libpthread.so: text relocations used
              math/libm.so: text relocations used
              resolv/libresolv.so: text relocations used
      because DT_TEXTREL was set even though there were no text relocations.

      Other changes:

      glibc-{2.2.5,2.3.2}-patches/glibc-test-lowram.patch prevents glibc's
      tst-calloc from running out of RAM on 32MB target systems, at the cost of
      weakening the test a bit.  The test should probably check RLIMIT_DATA
      and/or RLIMIT_AS, and use them at runtime to decide how big a test to
      run.  Instead, I've just hardcoded it to be one sixth the original size.

      Other notes:

      On sh4, g++'s thread/pthread6.cc test failed with gcc-3.3, but not with
      gcc-ss-3_3-20030714.  Not sure what's going on there yet.

      On sh4, until gcc-3.4, the -mrelax option in gcc is broken,
      and the corresponding test in the binutils test suite fails.
      If you need this to work in gcc-3.3, Kaz says use binutils-2.14.90.0.5 or later,
      and see http://gcc.gnu.org/ml/gcc-patches/2003-03/msg00226.html
      and http://gcc.gnu.org/ml/gcc-patches/2003-03/msg00213.html
      I have not tested these patches yet.
      The error in the binutils test log is
        ERROR: -O -mrelax ...ld/testsuite/ld-sh/sh2.c: compilation failed


-- 
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045




------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com



More information about the crossgcc mailing list