[Lldb-commits] [lldb] r172324 - /lldb/trunk/scripts/build-llvm.pl

Bob Wilson bob.wilson at apple.com
Sat Jan 12 11:33:09 PST 2013


Author: bwilson
Date: Sat Jan 12 13:33:08 2013
New Revision: 172324

URL: http://llvm.org/viewvc/llvm-project?rev=172324&view=rev
Log:
Fix cross-compiling problems in build-llvm.pl script. <rdar://problem/12986905>

As with llvm svn r172138, this patch is basically copying some changes that
we've been using for building clang at Apple. Besides cleaning it up to use
xcrun to locate the proper versions of tools, especially for cross compiling,
it fixes the build to work with newer versions of clang that honor SDKROOT
settings in the environment.

Modified:
    lldb/trunk/scripts/build-llvm.pl

Modified: lldb/trunk/scripts/build-llvm.pl
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/build-llvm.pl?rev=172324&r1=172323&r2=172324&view=diff
==============================================================================
--- lldb/trunk/scripts/build-llvm.pl (original)
+++ lldb/trunk/scripts/build-llvm.pl Sat Jan 12 13:33:08 2013
@@ -208,6 +208,7 @@
                     for $prog (@tools)
                     {
                         chomp(my $actual_prog_path = `xcrun -sdk '$ENV{SDKROOT}' -find ${prog}`);
+                        symlink($actual_prog_path, "$llvm_dstroot_arch_bin/${prog}");
                         my $script_prog_path = "$llvm_dstroot_arch_bin/arm-apple-darwin${os_release}-${prog}";
                         open (SCRIPT, ">$script_prog_path") or die "Can't open $! for writing...\n";
                         print SCRIPT "#!/bin/sh\nexec '$actual_prog_path' \"\$\@\"\n";
@@ -219,6 +220,7 @@
                     for $prog (@arch_sysroot_tools)
                     {
                         chomp(my $actual_prog_path = `xcrun -sdk '$ENV{SDKROOT}' -find ${prog}`);
+                        symlink($actual_prog_path, "$llvm_dstroot_arch_bin/${prog}");
                         my $script_prog_path = "$llvm_dstroot_arch_bin/arm-apple-darwin${os_release}-${prog}";
                         open (SCRIPT, ">$script_prog_path") or die "Can't open $! for writing...\n";
                         print SCRIPT "#!/bin/sh\nexec '$actual_prog_path' -arch ${arch} -isysroot '$ENV{SDKROOT}' \"\$\@\"\n";
@@ -240,13 +242,13 @@
 
             if ($is_arm)
             {
-                $lldb_configuration_options .= " --host=arm-apple-darwin${os_release} --target=arm-apple-darwin${os_release} --build=i686-apple-darwin${os_release}";
+                $lldb_configuration_options .= " --host=arm-apple-darwin${os_release} --target=arm-apple-darwin${os_release} --build=i686-apple-darwin${os_release} --program-prefix=\"\"";
             }
             else
             {
                 $lldb_configuration_options .= " --build=$arch-apple-darwin${os_release}";
             }
-            do_command ("cd '$llvm_dstroot_arch' && '$llvm_srcroot/configure' $lldb_configuration_options",
+            do_command ("cd '$llvm_dstroot_arch' && unset SDKROOT && '$llvm_srcroot/configure' $lldb_configuration_options",
                         "configuring llvm build", 1);
         }
 
@@ -258,7 +260,7 @@
             my $extra_make_flags = '';
             if ($is_arm)
             {
-                $extra_make_flags = "UNIVERSAL=1 UNIVERSAL_ARCH=${arch} UNIVERSAL_SDK_PATH='$ENV{SDKROOT}'";
+                $extra_make_flags = "UNIVERSAL=1 UNIVERSAL_ARCH=${arch} UNIVERSAL_SDK_PATH='$ENV{SDKROOT}' SDKROOT=";
             }
             do_command ("cd '$llvm_dstroot_arch' && make -j$num_cpus clang-only VERBOSE=1 $llvm_config_href->{make_options} NO_RUNTIME_LIBS=1 PROJECT_NAME='llvm' $extra_make_flags", "making llvm and clang", 1);
             do_command ("cd '$llvm_dstroot_arch' && make -j$num_cpus tools-only VERBOSE=1 $llvm_config_href->{make_options} NO_RUNTIME_LIBS=1 PROJECT_NAME='llvm' $extra_make_flags EDIS_VERSION=1", "making libedis", 1);





More information about the lldb-commits mailing list