blob: 7e12568f743a3c40799c5076ea46835da684a6f8 [file] [log] [blame]
Chris Lattner24943d22010-06-08 16:52:24 +00001#!/usr/bin/perl
2
3# This script will take a number ($ENV{SCRIPT_INPUT_FILE_COUNT}) of static archive files
4# and pull them apart into object files. These object files will be placed in a directory
5# named the same as the archive itself without the extension. Each object file will then
6# get renamed to start with the archive name and a '-' character (for archive.a(object.o)
7# the object file would becomde archive-object.o. Then all object files are re-made into
8# a single static library. This can help avoid name collisions when different archive
9# files might contain object files with the same name.
10
11use strict;
12use File::Basename;
13use File::Glob ':glob';
14use List::Util qw[min max];
15
Greg Claytonf15996e2011-04-07 22:46:35 +000016our $llvm_srcroot = $ENV{SCRIPT_INPUT_FILE_0};
17our $llvm_dstroot = $ENV{SCRIPT_INPUT_FILE_1};
Chris Lattner24943d22010-06-08 16:52:24 +000018
Sean Callanan6c98ba72011-08-11 20:11:18 +000019our $llvm_clang_outfile = $ENV{SCRIPT_OUTPUT_FILE_0};
Chris Lattner24943d22010-06-08 16:52:24 +000020our ($llvm_clang_basename, $llvm_clang_dirname) = fileparse ($llvm_clang_outfile);
Chris Lattner24943d22010-06-08 16:52:24 +000021
22our $llvm_configuration = $ENV{LLVM_CONFIGURATION};
23
Sean Callanan6e12c7a2012-03-08 02:39:03 +000024our $llvm_revision = "152265";
25our $clang_revision = "152265";
Sean Callanan047eea62011-08-18 18:18:33 +000026
Greg Clayton3e4238d2011-11-04 03:34:56 +000027our $SRCROOT = "$ENV{SRCROOT}";
28our $llvm_dstroot_zip = "$SRCROOT/llvm.zip";
Chris Lattner24943d22010-06-08 16:52:24 +000029our @archs = split (/\s+/, $ENV{ARCHS});
Greg Clayton3e4238d2011-11-04 03:34:56 +000030my $os_release = 11;
31
Jason Molendadaaa9d12012-04-02 08:56:42 +000032my $original_env_path = $ENV{PATH};
33
Greg Clayton3e4238d2011-11-04 03:34:56 +000034our %llvm_config_info = (
35 'Debug' => { configure_options => '--disable-optimized --disable-assertions', make_options => 'DEBUG_SYMBOLS=1'},
36 'Debug+Asserts' => { configure_options => '--disable-optimized --enable-assertions' , make_options => 'DEBUG_SYMBOLS=1'},
37 'Release' => { configure_options => '--enable-optimized --disable-assertions' , make_options => ''},
38 'Release+Debug' => { configure_options => '--enable-optimized --disable-assertions' , make_options => 'DEBUG_SYMBOLS=1'},
39);
40
41our $llvm_config_href = undef;
42if (exists $llvm_config_info{"$llvm_configuration"})
43{
44 $llvm_config_href = $llvm_config_info{$llvm_configuration};
45}
46else
47{
48 die "Unsupported LLVM configuration: '$llvm_configuration'\n";
49}
Chris Lattner24943d22010-06-08 16:52:24 +000050
51our @archive_files = (
Sean Callanan47a5c4c2010-09-23 03:01:22 +000052 "$llvm_configuration/lib/libclang.a",
Chris Lattner24943d22010-06-08 16:52:24 +000053 "$llvm_configuration/lib/libclangAnalysis.a",
54 "$llvm_configuration/lib/libclangAST.a",
55 "$llvm_configuration/lib/libclangBasic.a",
56 "$llvm_configuration/lib/libclangCodeGen.a",
Sean Callanan6e12c7a2012-03-08 02:39:03 +000057 "$llvm_configuration/lib/libclangEdit.a",
Chris Lattner24943d22010-06-08 16:52:24 +000058 "$llvm_configuration/lib/libclangFrontend.a",
59 "$llvm_configuration/lib/libclangDriver.a",
60 "$llvm_configuration/lib/libclangIndex.a",
61 "$llvm_configuration/lib/libclangLex.a",
62 "$llvm_configuration/lib/libclangRewrite.a",
63 "$llvm_configuration/lib/libclangParse.a",
64 "$llvm_configuration/lib/libclangSema.a",
Sean Callanan47a5c4c2010-09-23 03:01:22 +000065 "$llvm_configuration/lib/libclangSerialization.a",
Chris Lattner24943d22010-06-08 16:52:24 +000066 "$llvm_configuration/lib/libEnhancedDisassembly.a",
67 "$llvm_configuration/lib/libLLVMAnalysis.a",
68 "$llvm_configuration/lib/libLLVMArchive.a",
69 "$llvm_configuration/lib/libLLVMARMAsmParser.a",
70 "$llvm_configuration/lib/libLLVMARMAsmPrinter.a",
71 "$llvm_configuration/lib/libLLVMARMCodeGen.a",
Sean Callanan9b6898f2011-07-30 02:42:06 +000072 "$llvm_configuration/lib/libLLVMARMDesc.a",
Chris Lattner24943d22010-06-08 16:52:24 +000073 "$llvm_configuration/lib/libLLVMARMDisassembler.a",
74 "$llvm_configuration/lib/libLLVMARMInfo.a",
75 "$llvm_configuration/lib/libLLVMAsmParser.a",
76 "$llvm_configuration/lib/libLLVMAsmPrinter.a",
77 "$llvm_configuration/lib/libLLVMBitReader.a",
78 "$llvm_configuration/lib/libLLVMBitWriter.a",
79 "$llvm_configuration/lib/libLLVMCodeGen.a",
80 "$llvm_configuration/lib/libLLVMCore.a",
81 "$llvm_configuration/lib/libLLVMExecutionEngine.a",
82 "$llvm_configuration/lib/libLLVMInstCombine.a",
83 "$llvm_configuration/lib/libLLVMInstrumentation.a",
84 "$llvm_configuration/lib/libLLVMipa.a",
85 "$llvm_configuration/lib/libLLVMInterpreter.a",
86 "$llvm_configuration/lib/libLLVMipo.a",
87 "$llvm_configuration/lib/libLLVMJIT.a",
88 "$llvm_configuration/lib/libLLVMLinker.a",
89 "$llvm_configuration/lib/libLLVMMC.a",
90 "$llvm_configuration/lib/libLLVMMCParser.a",
Greg Claytonc9b60002010-07-21 16:57:26 +000091 "$llvm_configuration/lib/libLLVMMCDisassembler.a",
Sean Callananc0492742011-05-23 21:40:23 +000092 "$llvm_configuration/lib/libLLVMMCJIT.a",
93 "$llvm_configuration/lib/libLLVMObject.a",
94 "$llvm_configuration/lib/libLLVMRuntimeDyld.a",
Chris Lattner24943d22010-06-08 16:52:24 +000095 "$llvm_configuration/lib/libLLVMScalarOpts.a",
96 "$llvm_configuration/lib/libLLVMSelectionDAG.a",
97 "$llvm_configuration/lib/libLLVMSupport.a",
Chris Lattner24943d22010-06-08 16:52:24 +000098 "$llvm_configuration/lib/libLLVMTarget.a",
99 "$llvm_configuration/lib/libLLVMTransformUtils.a",
100 "$llvm_configuration/lib/libLLVMX86AsmParser.a",
101 "$llvm_configuration/lib/libLLVMX86AsmPrinter.a",
102 "$llvm_configuration/lib/libLLVMX86CodeGen.a",
Sean Callanan9b6898f2011-07-30 02:42:06 +0000103 "$llvm_configuration/lib/libLLVMX86Desc.a",
Chris Lattner24943d22010-06-08 16:52:24 +0000104 "$llvm_configuration/lib/libLLVMX86Disassembler.a",
105 "$llvm_configuration/lib/libLLVMX86Info.a",
Sean Callanan279584c2011-03-15 00:17:19 +0000106 "$llvm_configuration/lib/libLLVMX86Utils.a",
Chris Lattner24943d22010-06-08 16:52:24 +0000107);
108
Greg Clayton3e4238d2011-11-04 03:34:56 +0000109if (-e "$llvm_srcroot/lib")
Chris Lattner24943d22010-06-08 16:52:24 +0000110{
Greg Clayton3e4238d2011-11-04 03:34:56 +0000111 print "Using existing llvm sources in: '$llvm_srcroot'\n";
112 print "Using standard LLVM build directory:\n SRC = '$llvm_srcroot'\n DST = '$llvm_dstroot'\n";
Chris Lattner24943d22010-06-08 16:52:24 +0000113}
Greg Clayton3e4238d2011-11-04 03:34:56 +0000114elsif (-e $llvm_dstroot_zip)
Chris Lattner24943d22010-06-08 16:52:24 +0000115{
116 # Check for an old llvm source install (not the minimal zip based
117 # install by looking for a .svn file in the llvm directory
Greg Clayton3e4238d2011-11-04 03:34:56 +0000118 chomp(my $llvm_zip_md5 = `md5 -q '$llvm_dstroot_zip'`);
Chris Lattner24943d22010-06-08 16:52:24 +0000119 my $llvm_zip_md5_file = "$ENV{SRCROOT}/llvm/$llvm_zip_md5";
120 if (!-e "$llvm_zip_md5_file")
121 {
Greg Clayton3e4238d2011-11-04 03:34:56 +0000122 print "Updating LLVM to use checkpoint from: '$llvm_dstroot_zip'...\n";
Chris Lattner24943d22010-06-08 16:52:24 +0000123 if (-d "$ENV{SRCROOT}/llvm")
124 {
125 do_command ("cd '$ENV{SRCROOT}' && rm -rf llvm", "removing old llvm repository", 1);
126 }
127 do_command ("cd '$ENV{SRCROOT}' && unzip -q llvm.zip && touch '$llvm_zip_md5_file'", "expanding llvm.zip", 1);
Greg Clayton3e4238d2011-11-04 03:34:56 +0000128
129 }
130 my $arch_idx = 0;
Sean Callanan7537dce2011-11-04 22:46:46 +0000131
132 if (!-d "${llvm_dstroot}")
133 {
134 do_command ("mkdir -p '${llvm_dstroot}'", "Creating directory '${llvm_dstroot}'", 1);
135 }
136
Greg Clayton3e4238d2011-11-04 03:34:56 +0000137 foreach my $arch (@archs)
138 {
139 my $llvm_dstroot_arch = "${llvm_dstroot}/${arch}";
140 # Check for our symlink to our .a file
141 if (!-l "$llvm_dstroot_arch/$llvm_clang_basename")
142 {
143 # Symlink doesn't exist, make sure it isn't a normal file
144 if (-e "$llvm_dstroot_arch/$llvm_clang_basename")
145 {
146 # the .a file is a normal file which means it can't be from the
147 # zip file, we must remove the previous arch directory
148 do_command ("rm -rf '$llvm_dstroot_arch'", "Removing old '$llvm_dstroot_arch' directory", 1);
Sean Callanan7537dce2011-11-04 22:46:46 +0000149 }
Greg Clayton3e4238d2011-11-04 03:34:56 +0000150 # Create a symlink to the .a file from the zip file
Sean Callanan7537dce2011-11-04 22:46:46 +0000151 do_command ("cd '$llvm_dstroot' ; ln -s $ENV{SRCROOT}/llvm/$arch", "making llvm archive symlink", 1);
Greg Clayton3e4238d2011-11-04 03:34:56 +0000152 }
Chris Lattner24943d22010-06-08 16:52:24 +0000153 }
Chris Lattner24943d22010-06-08 16:52:24 +0000154 exit 0;
155}
Greg Clayton3e4238d2011-11-04 03:34:56 +0000156else
157{
158 print "Checking out llvm sources from revision $llvm_revision...\n";
159 do_command ("cd '$SRCROOT' && svn co --quiet --revision $llvm_revision http://llvm.org/svn/llvm-project/llvm/trunk llvm", "checking out llvm from repository", 1);
160 print "Checking out clang sources from revision $clang_revision...\n";
161 do_command ("cd '$llvm_srcroot/tools' && svn co --quiet --revision $clang_revision http://llvm.org/svn/llvm-project/cfe/trunk clang", "checking out clang from repository", 1);
Sean Callanan5a55c7a2011-11-18 03:28:09 +0000162 print "Applying any local patches to LLVM/Clang...";
Greg Clayton3e4238d2011-11-04 03:34:56 +0000163
164 my @llvm_patches = bsd_glob("$ENV{SRCROOT}/scripts/llvm.*.diff");
165
166 foreach my $patch (@llvm_patches)
167 {
168 do_command ("cd '$llvm_srcroot' && patch -p0 < $patch");
169 }
Sean Callanan5a55c7a2011-11-18 03:28:09 +0000170
171 my @clang_patches = bsd_glob("$ENV{SRCROOT}/scripts/clang.*.diff");
172
173 foreach my $patch (@clang_patches)
174 {
175 do_command ("cd '$llvm_srcroot/tools/clang' && patch -p0 < $patch");
176 }
Greg Clayton3e4238d2011-11-04 03:34:56 +0000177
178 print "Removing the llvm/test and llvm/tools/clang/test directories...\n";
179 do_command ("cd '$llvm_srcroot' && rm -rf test && rm -rf tools/clang/test ", "removing test directories", 1);
180}
Chris Lattner24943d22010-06-08 16:52:24 +0000181
182# If our output file already exists then we need not generate it again.
Greg Clayton64875582011-08-02 19:00:17 +0000183if (-e $llvm_clang_outfile)
Chris Lattner24943d22010-06-08 16:52:24 +0000184{
185 exit 0;
186}
187
188
189# Get our options
190
191our $debug = 1;
192
193sub parallel_guess
194{
195 my $cpus = `sysctl -n hw.availcpu`;
196 chomp ($cpus);
197 my $memsize = `sysctl -n hw.memsize`;
198 chomp ($memsize);
199 my $max_cpus_by_memory = int($memsize / (750 * 1024 * 1024));
200 return min($max_cpus_by_memory, $cpus);
201}
202sub build_llvm
203{
204 #my $extra_svn_options = $debug ? "" : "--quiet";
Chris Lattner24943d22010-06-08 16:52:24 +0000205 # Make the llvm build directory
206 my $arch_idx = 0;
207 foreach my $arch (@archs)
208 {
209 my $llvm_dstroot_arch = "${llvm_dstroot}/${arch}";
210
211 # if the arch destination root exists we have already built it
212 my $do_configure = 0;
213 my $do_make = 0;
Greg Clayton3e4238d2011-11-04 03:34:56 +0000214 my $is_arm = $arch =~ /^arm/;
215
Chris Lattner24943d22010-06-08 16:52:24 +0000216 my $llvm_dstroot_arch_archive = "$llvm_dstroot_arch/$llvm_clang_basename";
217 print "LLVM architecture root for ${arch} exists at '$llvm_dstroot_arch'...";
218 if (-e $llvm_dstroot_arch)
219 {
220 print "YES\n";
221 $do_configure = !-e "$llvm_dstroot_arch/config.log";
222
223 # dstroot for llvm build exists, make sure all .a files are built
224 for my $llvm_lib (@archive_files)
225 {
226 if (!-e "$llvm_dstroot_arch/$llvm_lib")
227 {
228 print "missing archive: '$llvm_dstroot_arch/$llvm_lib'\n";
229 $do_make = 1;
230 }
231 }
232 if (!-e $llvm_dstroot_arch_archive)
233 {
234 $do_make = 1;
Greg Claytonc9b60002010-07-21 16:57:26 +0000235 }
236 else
237 {
238 print "LLVM architecture archive for ${arch} is '$llvm_dstroot_arch_archive'\n";
Chris Lattner24943d22010-06-08 16:52:24 +0000239 }
240 }
241 else
242 {
243 print "NO\n";
244 do_command ("mkdir -p '$llvm_dstroot_arch'", "making llvm build directory '$llvm_dstroot_arch'", 1);
245 $do_configure = 1;
246 $do_make = 1;
Greg Clayton3e4238d2011-11-04 03:34:56 +0000247
248 if ($is_arm)
Chris Lattner24943d22010-06-08 16:52:24 +0000249 {
Greg Clayton3e4238d2011-11-04 03:34:56 +0000250 my $llvm_dstroot_arch_bin = "${llvm_dstroot_arch}/bin";
251
252 if (!-d $llvm_dstroot_arch_bin)
253 {
254 do_command ("mkdir -p '$llvm_dstroot_arch_bin'", "making llvm build arch bin directory '$llvm_dstroot_arch_bin'", 1);
255 my @tools = ("ar", "nm", "ranlib", "strip", "lipo", "ld", "as");
256 my $script_mode = 0755;
257 my $prog;
258 for $prog (@tools)
259 {
260 chomp(my $actual_prog_path = `xcrun -sdk '$ENV{SDKROOT}' -find ${prog}`);
261 my $script_prog_path = "$llvm_dstroot_arch_bin/arm-apple-darwin${os_release}-${prog}";
262 open (SCRIPT, ">$script_prog_path") or die "Can't open $! for writing...\n";
263 print SCRIPT "#!/bin/sh\nexec '$actual_prog_path' \"\$\@\"\n";
264 close (SCRIPT);
265 chmod($script_mode, $script_prog_path);
266 }
267 # Tools that must have the "-arch" and "-sysroot" specified
268 my @arch_sysroot_tools = ("clang", "clang++", "gcc", "g++");
269 for $prog (@arch_sysroot_tools)
270 {
271 chomp(my $actual_prog_path = `xcrun -sdk '$ENV{SDKROOT}' -find ${prog}`);
272 my $script_prog_path = "$llvm_dstroot_arch_bin/arm-apple-darwin${os_release}-${prog}";
273 open (SCRIPT, ">$script_prog_path") or die "Can't open $! for writing...\n";
274 print SCRIPT "#!/bin/sh\nexec '$actual_prog_path' -arch ${arch} -isysroot '$ENV{SDKROOT}' \"\$\@\"\n";
275 close (SCRIPT);
276 chmod($script_mode, $script_prog_path);
277 }
Jason Molendadaaa9d12012-04-02 08:56:42 +0000278 my $new_path = "$original_env_path:$llvm_dstroot_arch_bin";
Greg Clayton3e4238d2011-11-04 03:34:56 +0000279 print "Setting new environment PATH = '$new_path'\n";
280 $ENV{PATH} = $new_path;
281 }
Chris Lattner24943d22010-06-08 16:52:24 +0000282 }
283 }
Greg Clayton3e4238d2011-11-04 03:34:56 +0000284
Chris Lattner24943d22010-06-08 16:52:24 +0000285 if ($do_configure)
286 {
287 # Build llvm and clang
288 print "Configuring clang ($arch) in '$llvm_dstroot_arch'...\n";
Greg Clayton3e4238d2011-11-04 03:34:56 +0000289 my $lldb_configuration_options = "--enable-targets=x86_64,arm $llvm_config_href->{configure_options}";
290
291 if ($is_arm)
292 {
293 $lldb_configuration_options .= " --host=arm-apple-darwin${os_release} --target=arm-apple-darwin${os_release} --build=i686-apple-darwin${os_release}";
294 }
295 else
296 {
297 $lldb_configuration_options .= " --build=$arch-apple-darwin${os_release}";
298 }
299 do_command ("cd '$llvm_dstroot_arch' && '$llvm_srcroot/configure' $lldb_configuration_options",
Chris Lattner24943d22010-06-08 16:52:24 +0000300 "configuring llvm build", 1);
301 }
302
303 if ($do_make)
304 {
305 # Build llvm and clang
306 my $num_cpus = parallel_guess();
307 print "Building clang using $num_cpus cpus ($arch)...\n";
Greg Clayton3e4238d2011-11-04 03:34:56 +0000308 my $extra_make_flags = '';
309 if ($is_arm)
310 {
311 $extra_make_flags = "UNIVERSAL=1 UNIVERSAL_ARCH=${arch} UNIVERSAL_SDK_PATH='$ENV{SDKROOT}'";
312 }
313 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);
314 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);
Chris Lattner24943d22010-06-08 16:52:24 +0000315 # Combine all .o files from a bunch of static libraries from llvm
316 # and clang into a single .a file.
317 create_single_llvm_arhive_for_arch ($llvm_dstroot_arch, 1);
318 }
319
Chris Lattner24943d22010-06-08 16:52:24 +0000320 ++$arch_idx;
321 }
Chris Lattner24943d22010-06-08 16:52:24 +0000322}
323
Chris Lattner24943d22010-06-08 16:52:24 +0000324#----------------------------------------------------------------------
325# quote the path if needed and realpath it if the -r option was
326# specified
327#----------------------------------------------------------------------
328sub finalize_path
329{
330 my $path = shift;
331 # Realpath all paths that don't start with "/"
332 $path =~ /^[^\/]/ and $path = abs_path($path);
333
334 # Quote the path if asked to, or if there are special shell characters
335 # in the path name
336 my $has_double_quotes = $path =~ /["]/;
337 my $has_single_quotes = $path =~ /[']/;
338 my $needs_quotes = $path =~ /[ \$\&\*'"]/;
339 if ($needs_quotes)
340 {
341 # escape and double quotes in the path
342 $has_double_quotes and $path =~ s/"/\\"/g;
343 $path = "\"$path\"";
344 }
345 return $path;
346}
347
348sub do_command
349{
350 my $cmd = shift;
351 my $description = @_ ? shift : "command";
352 my $die_on_fail = @_ ? shift : undef;
353 $debug and print "% $cmd\n";
354 system ($cmd);
355 if ($? == -1)
356 {
357 $debug and printf ("error: %s failed to execute: $!\n", $description);
358 $die_on_fail and $? and exit(1);
359 return $?;
360 }
361 elsif ($? & 127)
362 {
363 $debug and printf("error: %s child died with signal %d, %s coredump\n",
364 $description,
365 ($? & 127),
366 ($? & 128) ? 'with' : 'without');
367 $die_on_fail and $? and exit(1);
368 return $?;
369 }
370 else
371 {
372 my $exit = $? >> 8;
373 if ($exit)
374 {
375 $debug and printf("error: %s child exited with value %d\n", $description, $exit);
376 $die_on_fail and exit(1);
377 }
378 return $exit;
379 }
380}
381
382sub create_single_llvm_arhive_for_arch
383{
384 my $arch_dstroot = shift;
385 my $split_into_objects = shift;
386 my @object_dirs;
387 my $object_dir;
388 my $tmp_dir = $arch_dstroot;
389 my $arch_output_file = "$arch_dstroot/$llvm_clang_basename";
390 -e $arch_output_file and return;
391 my $files = "$arch_dstroot/files.txt";
392 open (FILES, ">$files") or die "Can't open $! for writing...\n";
393
394 for my $path (@archive_files)
395 {
396 my $archive_fullpath = finalize_path ("$arch_dstroot/$path");
397 if (-e $archive_fullpath)
398 {
399 if ($split_into_objects)
400 {
401 my ($archive_file, $archive_dir, $archive_ext) = fileparse($archive_fullpath, ('.a'));
402
403 $object_dir = "$tmp_dir/$archive_file";
404 push @object_dirs, $object_dir;
405
406 do_command ("cd '$tmp_dir'; mkdir '$archive_file'; cd '$archive_file'; ar -x $archive_fullpath");
407
408 my @objects = bsd_glob("$object_dir/*.o");
409
410 foreach my $object (@objects)
411 {
412 my ($o_file, $o_dir) = fileparse($object);
413 my $new_object = "$object_dir/${archive_file}-$o_file";
414 print FILES "$new_object\n";
415 do_command ("mv '$object' '$new_object'");
416 }
417 }
418 else
419 {
420 # just add the .a files into the file list
421 print FILES "$archive_fullpath\n";
422 }
423 }
Greg Clayton193e6d52010-07-13 22:26:45 +0000424 else
425 {
426 print "warning: archive doesn't exist: '$archive_fullpath'\n";
427 }
Chris Lattner24943d22010-06-08 16:52:24 +0000428 }
429 close (FILES);
430 do_command ("libtool -static -o '$arch_output_file' -filelist '$files'");
Sean Callanan47a5c4c2010-09-23 03:01:22 +0000431 do_command ("ranlib '$arch_output_file'");
Chris Lattner24943d22010-06-08 16:52:24 +0000432
433 foreach $object_dir (@object_dirs)
434 {
435 do_command ("rm -rf '$object_dir'");
436 }
437 do_command ("rm -rf '$files'");
438}
439
440build_llvm();