From 4831cd44fc9412de9868677b31a02cf757b3a8a7 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Mon, 18 Jun 2018 21:43:24 -0400 Subject: [PATCH] Let hipcc handle library with extension lo for hip-clang [ROCm/clr commit: 454d45e5bbeba09ec6cfc11ab7715710e233211c] --- projects/clr/hipamd/bin/hipcc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/projects/clr/hipamd/bin/hipcc b/projects/clr/hipamd/bin/hipcc index 4c526bd2c7..f5fe4249ca 100755 --- a/projects/clr/hipamd/bin/hipcc +++ b/projects/clr/hipamd/bin/hipcc @@ -376,7 +376,7 @@ foreach $arg (@ARGV) open my $out, ">", $new_file or die "$new_file: $!"; while (my $line = <$in>) { chomp $line; - if ($line =~ m/\.a$/) { + if ($line =~ m/\.a$/ || $line =~ m/\.lo$/) { my $libFile = $line; my $path = abs_path($line); my @objs = split ('\n', `cd $tmpdir; ar xv $path`); @@ -401,8 +401,8 @@ foreach $arg (@ARGV) if ($allIsObj) { print $out "$line\n"; } elsif ($realObjs) { - my $libBaseName = basename($libFile, ".a"); - $libBaseName = mktemp($libBaseName . "XXXX") . ".a"; + my($libBaseName, $libDir, $libExt) = fileparse($libFile); + $libBaseName = mktemp($libBaseName . "XXXX") . $libExt; system("cd $tmpdir; ar c $libBaseName $realObjs"); print $out "$tmpdir/$libBaseName\n"; }