1.1 --- a/patches/gcc/3.3.1/sh4-pthread.patch Tue Aug 14 19:32:22 2007 +0000
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,44 +0,0 @@
1.4 -See http://gcc.gnu.org/PR11903
1.5 -
1.6 -Patch to fix following test case failure:
1.7 -
1.8 - === libstdc++-v3 tests ===
1.9 -FAIL: thread/pthread1.cc (test for excess errors)
1.10 -Excess errors:
1.11 -/opt/cegl-2.0/sh4-unknown-linux-gnu/gcc-ss-3_3-20030714-glibc-2.2.5/sh4-unknown-linux-gnu/bin/ld: cannot find -lthread
1.12 -collect2: ld returned 1 exit status
1.13 -
1.14 -Note that *any* program compiled with -pthread fails:
1.15 -
1.16 -/opt/cegl-2.0/sh4-unknown-linux-gnu/gcc-ss-3_3-20030714-glibc-2.2.5/bin/sh4-unknown-linux-gnu-gcc hello.c -pthread
1.17 -/opt/cegl-2.0/sh4-unknown-linux-gnu/gcc-ss-3_3-20030714-glibc-2.2.5/lib/gcc-lib/sh4-unknown-linux-gnu/3.3.1/../../../../sh4-unknown-linux-gnu/bin/ld: cannot find -lthread
1.18 -collect2: ld returned 1 exit status
1.19 -
1.20 -Compiling with -lpthread on the other hand works fine:
1.21 -/opt/cegl-2.0/sh4-unknown-linux-gnu/gcc-ss-3_3-20030714-glibc-2.2.5/bin/sh4-unknown-linux-gnu-gcc hello.c -lpthread
1.22 -
1.23 -So -pthread is broken in some trivial way; it should invoke -lpthread, not -lthread,
1.24 -at least when targeting Linux.
1.25 -
1.26 -http://www.sh-linux.org/rpm-2003/SRPMS/gcc-3.2.3-3.src.rpm contains a jumbo patch,
1.27 -gcc-20030210-sh-linux-1.patch, that includes a fix for this. Here's the
1.28 -appropriate hunk (brings in a fix for the documented -mieee option).
1.29 -No idea if this fix is completely right, but it works for me...
1.30 -- dank@kegel.com 20 Jul 2003
1.31 -
1.32 -Index: linux.h
1.33 -===================================================================
1.34 -RCS file: /cvsroot/gcc/gcc/gcc/config/sh/linux.h,v
1.35 -retrieving revision 1.9.20.1
1.36 -diff -u -d -u -r1.9.20.1 linux.h
1.37 ---- gcc-ss-3_3-20030714/gcc/config/sh/linux.h.old 6 Jun 2003 02:30:59 -0000 1.9.20.1
1.38 -+++ gcc-ss-3_3-20030714/gcc/config/sh/linux.h 20 Jul 2003 23:36:50 -0000
1.39 -@@ -59,7 +59,7 @@
1.40 - #undef LIB_SPEC
1.41 - #define LIB_SPEC \
1.42 - "%{shared: -lc} \
1.43 -- %{!shared: %{pthread:-lthread} \
1.44 -+ %{!shared: %{mieee:-lieee} %{pthread:-lpthread} \
1.45 - %{profile:-lc_p} %{!profile: -lc}}"
1.46 -
1.47 - #undef STARTFILE_SPEC