|
From: <sv...@va...> - 2012-07-20 16:47:07
|
sewardj 2012-07-20 17:46:54 +0100 (Fri, 20 Jul 2012)
New Revision: 12766
Log:
If the compiler being used to build is clang, remember to add
-new_linker to the stuff given to the linker, else link failures
result on x86. Based on a suggestion by Christoph Erhardt. Fixes
#295427.
Modified files:
trunk/coregrind/link_tool_exe_darwin.in
Modified: trunk/coregrind/link_tool_exe_darwin.in (+10 -1)
===================================================================
--- trunk/coregrind/link_tool_exe_darwin.in 2012-07-20 01:17:16 +01:00 (rev 12765)
+++ trunk/coregrind/link_tool_exe_darwin.in 2012-07-20 17:46:54 +01:00 (rev 12766)
@@ -98,7 +98,8 @@
die "Not enough arguments"
if (($#ARGV + 1) < 5);
-my $ala = $ARGV[0];
+my $ala = $ARGV[0]; # the load address to use
+my $cc = $ARGV[1]; # the C compiler in use
# check for plausible-ish alt load address
die "Bogus alt-load address (1)"
@@ -140,6 +141,14 @@
my $cmd = "/usr/bin/ld";
$cmd = "$cmd -static";
+
+# If we're building with clang (viz, the C compiler as specified
+# by the 2nd arg ends in "clang"), we also need -new_linker. See
+# https://bugs.kde.org/show_bug.cgi?id=295427
+if ("$cc" =~ /clang$/) {
+ $cmd = "$cmd -new_linker";
+}
+
$cmd = "$cmd -arch $archstr";
$cmd = "$cmd -macosx_version_min 10.5";
$cmd = "$cmd -o $outname";
|