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 =~ /^-/ && $arg !~ /^-(threads|-pthread|D|U|I|c|o)/) {
19 # Options that get here are not in the desiret set.
20 # Notably we drop "-fPIC" (some variant of which should probably
21 # also occur in an unsanitized section).
22 print STDERR
"$0: warning dropping $arg\n";
28 $target = shift @ARGV;
29 if ($target =~ /\.lo$/) {
31 $tmptarget =~ s/\.lo$/-tmp.o/;
32 push @cmd, $tmptarget;
39 # Uncomment to force debug information
42 # print STDERR "# ", join (" ", @cmd), "\n";
47 unlink $tmptarget if defined $tmptarget;
49 } elsif (defined $tmptarget) {
50 rename $tmptarget, $target;