Fix handling of static library in hipcc for hip-clang

[ROCm/hip commit: 2b32dbd414]
Цей коміт міститься в:
Yaxun (Sam) Liu
2018-06-17 12:18:37 -04:00
джерело 0573ee79de
коміт acaf783f52
+7 -4
Переглянути файл
@@ -391,17 +391,20 @@ foreach $arg (@ARGV)
my $isObj = ($fileType =~ m/ELF/ or $fileType =~ m/COFF/);
$allIsObj = ($allIsObj and $isObj);
if ($isObj) {
$realObjs = $realObjs . " " . $obj;
$realObjs = ($realObjs . " " . $obj);
} else {
push (@inputs, $obj);
$new_arg = "$new_arg $obj";
}
}
chomp $realObjs;
if ($allIsObj) {
print $out "$line\n";
} else {
system("cd $tmpdir; ar c $libFile $realObjs");
print $out "$tmpdir/$libFile\n";
} elsif ($realObjs) {
my $libBaseName = basename($libFile, ".a");
$libBaseName = mktemp($libBaseName . "XXXX") . ".a";
system("cd $tmpdir; ar c $libBaseName $realObjs");
print $out "$tmpdir/$libBaseName\n";
}
} else {
print $out "$line\n";