]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
If the compiler being used to build is clang, remember to add
authorJulian Seward <jseward@acm.org>
Fri, 20 Jul 2012 16:46:54 +0000 (16:46 +0000)
committerJulian Seward <jseward@acm.org>
Fri, 20 Jul 2012 16:46:54 +0000 (16:46 +0000)
-new_linker to the stuff given to the linker, else link failures
result on x86.  Based on a suggestion by Christoph Erhardt.  Fixes
#295427.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12766

coregrind/link_tool_exe_darwin.in

index e111738b4e00a1dbd1e1b59b231d4ca604bf84ff..bf483a9b8275d2f80c46da0a1b029a4cb009db94 100644 (file)
@@ -98,7 +98,8 @@ sub is_dota_or_doto($)
 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 @@ die "Can't find '-arch archstr' in command line"
 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";