From e01445a69d66ecb1ff9df112d90fa701d548dc99 Mon Sep 17 00:00:00 2001 From: Jatin Chaudhary Date: Thu, 20 May 2021 04:15:23 -0700 Subject: [PATCH] SWDEV-277697 - Make sure hipcc can handle standard CXX options when being used with nvcc Change-Id: I76b1f2943a660eefda858397218a775083b99228 [ROCm/hip commit: a4c9db8e17a6f9ec8784e0d717741e1203844204] --- projects/hip/bin/hipcc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/projects/hip/bin/hipcc b/projects/hip/bin/hipcc index 6cea1e36cf..7e5faeafd8 100755 --- a/projects/hip/bin/hipcc +++ b/projects/hip/bin/hipcc @@ -376,6 +376,15 @@ foreach $arg (@ARGV) $swallowArg = 1; } + # nvcc does not handle standard compiler options properly + # This can prevent hipcc being used as standard CXX/C Compiler + # To fix this we need to pass -Xcompiler for options + if (($arg eq '-fPIC' or $arg =~ '-Wl,') and $HIP_COMPILER eq 'nvcc') + { + $HIPCXXFLAGS .= " -Xcompiler ".$arg; + $swallowArg = 1; + } + ## process linker response file for hip-clang ## extract object files from static library and pass them directly to ## hip-clang in command line.