From ab6c9b7113b3bd049fdc0b721f9c23a68151629b 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/clr commit: 627c179612635f859f81f21e74b5b8cb1102fb7f] --- projects/clr/hipamd/bin/hipcc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/projects/clr/hipamd/bin/hipcc b/projects/clr/hipamd/bin/hipcc index 92ec2578cb..4610a6be89 100755 --- a/projects/clr/hipamd/bin/hipcc +++ b/projects/clr/hipamd/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"; }