From: Julian Seward Date: Fri, 20 Jul 2012 16:46:54 +0000 (+0000) Subject: If the compiler being used to build is clang, remember to add X-Git-Tag: svn/VALGRIND_3_8_0~102 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3d571d1d884a3b3ffea37ee599f214ef127953f;p=thirdparty%2Fvalgrind.git 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. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12766 --- diff --git a/coregrind/link_tool_exe_darwin.in b/coregrind/link_tool_exe_darwin.in index e111738b4e..bf483a9b82 100644 --- a/coregrind/link_tool_exe_darwin.in +++ b/coregrind/link_tool_exe_darwin.in @@ -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";