gas-preprocessor
gas-preprocessor copied to clipboard
gcc options "-MT anything.o" should not be changed to "-MT -"
The -MT option is used to specify the name of the make target that will be written to the file indicated by -MF. "-" is not a proper make target, thus "-MT anything.o" should not be changed to "-MT -".
A fix for this problem may look like this:
remove this line:
@preprocess_c_cmd = map { /.o$/ ? "-" : $_ } @preprocess_c_cmd;
add these lines:
Want to change "-o <anything.o>" into "-o -"
but it is not correct to change "-MT <anything.o>" into "-MT - "
my $i; my $o_flag = 0; for ($i = 1; $i < @preprocess_c_cmd; $i++) { if ($preprocess_c_cmd[$i] eq "-o") { $o_flag = 1; } elsif ($o_flag) { $o_flag = 0; if ($preprocess_c_cmd[$i] =~ /.o$/) { $preprocess_c_cmd[$i] = "-"; } } }