This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Proposed 3.3 patch: make -pthread work on sh4-*-linux-*, fixes testcasethread/pthread1.cc
- From: Dan Kegel <dkegel at ixiacom dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 21 Jul 2003 11:09:20 -0700
- Subject: Proposed 3.3 patch: make -pthread work on sh4-*-linux-*, fixes testcasethread/pthread1.cc
Currently, using the -pthread option on sh4-*-linux-gnu fails because of a broken spec file.
Here's an excerpt from the test run
http://www.kegel.com/crosstool/crosstool-0.14/summaries/sh4-unknown-linux-gnu-gcc-3.3-glibc-2.2.5.gcc.sum
showing a failure caused by this:
------------------------------------------------------------
=== libstdc++-v3 tests ===
FAIL: thread/pthread1.cc (test for excess errors)
Excess errors:
/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
collect2: ld returned 1 exit status
------------------------------------------------------------
http://www.sh-linux.org/rpm-2003/SRPMS/gcc-3.2.3-3.src.rpm's
gcc-20030210-sh-linux-1.patch fixes this, as does Montavista's HardHat 2.0,
by adding the missing 'p' to the spec file. Here's the
appropriate hunk (also brings in a fix for the documented -mieee option, which seems valid).
This passed a full build and test on sh4-linux and powerpc-linux; test summary for sh4 is at
http://www.kegel.com/crosstool/crosstool-0.14/summaries/sh4-unknown-linux-gnu-gcc-ss-3_3-20030714-glibc-2.2.5.gcc.sum
- dank@kegel.com 20 Jul 2003
Index: linux.h
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/config/sh/linux.h,v
retrieving revision 1.9.20.1
diff -u -d -u -r1.9.20.1 linux.h
--- gcc-ss-3_3-20030714/gcc/config/sh/linux.h.old 6 Jun 2003 02:30:59 -0000 1.9.20.1
+++ gcc-ss-3_3-20030714/gcc/config/sh/linux.h 20 Jul 2003 23:36:50 -0000
@@ -59,7 +59,7 @@
#undef LIB_SPEC
#define LIB_SPEC \
"%{shared: -lc} \
- %{!shared: %{pthread:-lthread} \
+ %{!shared: %{mieee:-lieee} %{pthread:-lpthread} \
%{profile:-lc_p} %{!profile: -lc}}"
#undef STARTFILE_SPEC