2 # -----------------------------------------------------------------------------
3 # This program changes "... -o foo.lo ..." into "... -o foo.o ...", runs the
4 # compiler proper and then renames foo.o onto foo.lo
12 my $arg = shift @ARGV;
13 if ($arg =~ /^--sanitize=(.*)/) {
18 if ($sanitize && $arg =~ /^-/ &&
19 ($arg !~ /^-(threads|-pthread|D|U|I|c|o)/ ||
21 # Options that get here are not in the desiret set.
22 # Notably we drop "-fPIC" (some variant of which should probably
23 # also occur in an unsanitized section).
24 print STDERR
"$0: warning dropping $arg\n";
30 $target = shift @ARGV;
31 if ($target =~ /\.lo$/) {
33 $tmptarget =~ s/\.lo$/-tmp.o/;
34 push @cmd, $tmptarget;
41 # Uncomment to force debug information
44 # print STDERR "# ", join (" ", @cmd), "\n";
49 unlink $tmptarget if defined $tmptarget;
51 } elsif (defined $tmptarget) {
52 rename $tmptarget, $target;