aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorDave Korn <dave.korn.cygwin@gmail.com>2009-12-31 01:35:24 +0000
committerDave Korn <davek@gcc.gnu.org>2009-12-31 01:35:24 +0000
commit546831fe57b368b7c90e68ea9a2d169626d1c643 (patch)
tree34ec363d706bd80ef102af8e95cab4e56ba40396 /gcc
parentbe69568c8bd35c10358d89cdbf3f97c494a1c750 (diff)
downloadgcc-546831fe57b368b7c90e68ea9a2d169626d1c643.zip
gcc-546831fe57b368b7c90e68ea9a2d169626d1c643.tar.gz
gcc-546831fe57b368b7c90e68ea9a2d169626d1c643.tar.bz2
re PR target/41605 (Static linking of libgcc/libgfortran/libstdc++ can cause inconsistent symbol resolution.)
2009-12-31 Iain Sandoe <iain.sandoe@sandoe-acoustics.co.uk> PR target/41605 * config/darwin.h (LINK_COMMAND_SPEC): Resolve fopenmp specifically for target. (LINK_SPEC): Replace dynamic libraries by static equivalents where necessary. * config/darwin9.h (LINK_COMMAND_SPEC): Resolve fopenmp specifically for target. Co-Authored-By: Iain Sandoe <iain.sandoe@sandoe-acoustics.co.uk> From-SVN: r155534
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/config/darwin.h15
-rw-r--r--gcc/config/darwin9.h7
3 files changed, 25 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7a9eab0..3c20ec9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,14 @@
+2009-12-31 Dave Korn <dave.korn.cygwin@gmail.com>
+ Iain Sandoe <iain.sandoe@sandoe-acoustics.co.uk>
+
+ PR target/41605
+ * config/darwin.h (LINK_COMMAND_SPEC): Resolve fopenmp specifically
+ for target.
+ (LINK_SPEC): Replace dynamic libraries by static equivalents where
+ necessary.
+ * config/darwin9.h (LINK_COMMAND_SPEC): Resolve fopenmp specifically
+ for target.
+
2009-12-30 Dave Korn <dave.korn.cygwin@gmail.com>
PR lto/42531
diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h
index 2bcc71a..6595e53 100644
--- a/gcc/config/darwin.h
+++ b/gcc/config/darwin.h
@@ -272,9 +272,10 @@ extern GTY(()) int darwin_ms_struct;
%{A} %{e*} %{m} %{r} %{x} \
%{o*}%{!o:-o a.out} \
%{!A:%{!nostdlib:%{!nostartfiles:%S}}} \
- %{L*} %{fopenmp:%:include(libgomp.spec)%(link_gomp)} \
- %(link_libgcc) %o %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} \
- %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %G %L}} \
+ %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate|coverage:-lgcov} \
+ %{fopenmp|ftree-parallelize-loops=*: \
+ %{static|static-libgcc|static-libstdc++|static-libgfortran: libgomp.a%s; : -lgomp } } \
+ %{!nostdlib:%{!nodefaultlibs: %(link_ssp) %G %L }} \
%{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} %{F*} }}}}}}}\n\
%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
%{.c|.cc|.C|.cpp|.cp|.c++|.cxx|.CPP|.m|.mm: \
@@ -293,8 +294,12 @@ extern GTY(()) int darwin_ms_struct;
so put a * after their names so all of them get passed. */
#define LINK_SPEC \
"%{static}%{!static:-dynamic} \
- %{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)}\
- %{static|static-libgfortran:%:replace-outfile(-lgfortran libgfortran.a%s)}\
+ %{fgnu-runtime: %{static|static-libgcc: \
+ %:replace-outfile(-lobjc libobjc-gnu.a%s); \
+ :%:replace-outfile(-lobjc -lobjc-gnu ) } }\
+ %{static|static-libgcc|static-libgfortran:%:replace-outfile(-lgfortran libgfortran.a%s)}\
+ %{static|static-libgcc|static-libstdc++|static-libgfortran:%:replace-outfile(-lgomp libgomp.a%s)}\
+ %{static|static-libgcc|static-libstdc++:%:replace-outfile(-lstdc++ libstdc++.a%s)}\
%{!Zdynamiclib: \
%{Zforce_cpusubtype_ALL:-arch %(darwin_arch) -force_cpusubtype_ALL} \
%{!Zforce_cpusubtype_ALL:-arch %(darwin_subarch)} \
diff --git a/gcc/config/darwin9.h b/gcc/config/darwin9.h
index 8c6f671..ff34a5d 100644
--- a/gcc/config/darwin9.h
+++ b/gcc/config/darwin9.h
@@ -31,9 +31,10 @@ along with GCC; see the file COPYING3. If not see
%{A} %{e*} %{m} %{r} %{x} \
%{o*}%{!o:-o a.out} \
%{!A:%{!nostdlib:%{!nostartfiles:%S}}} \
- %{L*} %{fopenmp:%:include(libgomp.spec)%(link_gomp)} \
- %(link_libgcc) %o %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} \
- %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %G %L}} \
+ %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate|coverage:-lgcov} \
+ %{fopenmp|ftree-parallelize-loops=*: \
+ %{static|static-libgcc|static-libstdc++|static-libgfortran: libgomp.a%s; : -lgomp } } \
+ %{!nostdlib:%{!nodefaultlibs: %(link_ssp) %G %L }} \
%{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} %{F*} }}}}}}}\n\
%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
%{.c|.cc|.C|.cpp|.cp|.c++|.cxx|.CPP|.m|.mm: \