diff --git a/bin/hipcc b/bin/hipcc index 4002631..8dae941 100755 --- a/bin/hipcc +++ b/bin/hipcc @@ -33,9 +33,10 @@ $USE_PERL_SCRIPT //= 1; # use defined-or assignment operator. Use env var, but my $isWindows = ($^O eq 'MSWin32' or $^O eq 'msys'); # escapes args with quotes SWDEV-341955 +# do not escape @ for rsp files on windows foreach $arg (@ARGV) { if ($isWindows) { - $arg =~ s/[^-a-zA-Z0-9_=+,.:\/\\ ]/\\$&/g; + $arg =~ s/[^-a-zA-Z0-9_=+,.:@\/\\ ]/\\$&/g; } } diff --git a/bin/hipcc.pl b/bin/hipcc.pl index 513a427..aea655f 100755 --- a/bin/hipcc.pl +++ b/bin/hipcc.pl @@ -372,6 +372,15 @@ sub get_normalized_path { $hsacoVersion = $arg; $swallowArg = 1; } + if($arg =~ /\.rsp$/) { + $pre_rsp = " "; + if($isWindows) { + $pre_rsp = " --rsp-quoting=windows "; + } + $HIPLDFLAGS .= $pre_rsp.$arg; + $HIPCXXFLAGS .= $pre_rsp.$arg; + $swallowArg = 1; + } # nvcc does not handle standard compiler options properly # This can prevent hipcc being used as standard CXX/C Compiler @@ -471,7 +480,7 @@ sub get_normalized_path { # Do the quoting here because sometimes the $arg is changed in the loop # Important to have all of '-Xlinker' in the set of unquoted characters. if (not $isWindows and $escapeArg) { - $arg =~ s/[^-a-zA-Z0-9_=+,.\/]/\\$&/g; + $arg =~ s/[^-a-zA-Z0-9_=+,.@\/]/\\$&/g; } $toolArgs .= " $arg" unless $swallowArg; $prevArg = $arg;