From ab2445e972d359f1a779d77e9577e86eb156b1bf Mon Sep 17 00:00:00 2001 From: Yaxun Sam Liu Date: Wed, 22 Aug 2018 15:42:54 -0400 Subject: [PATCH] Let hipcc handle obj files in linker response file for hip-clang If obj files in linker response file contains device code, pass them to hip-clang, otherwise keep them in the linker response file. [ROCm/hip commit: 1587b18a918910d516bee2dac68b625aad3059cb] --- projects/hip/bin/hipcc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/projects/hip/bin/hipcc b/projects/hip/bin/hipcc index 92ec2578cb..4610a6be89 100755 --- a/projects/hip/bin/hipcc +++ b/projects/hip/bin/hipcc @@ -453,6 +453,15 @@ foreach $arg (@ARGV) system("cd $tmpdir; ar c $libBaseName $realObjs"); print $out "$tmpdir/$libBaseName\n"; } + } elsif ($line =~ m/\.o$/) { + my $fileType = `file $line`; + my $isObj = ($fileType =~ m/ELF/ or $fileType =~ m/COFF/); + if ($isObj) { + print $out "$line\n"; + } else { + push (@inputs, $line); + $new_arg = "$new_arg $line"; + } } else { print $out "$line\n"; }