From 23a8dfc8f3128af27dd16f91e0ddc8a6a4e0182f Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Tue, 10 Mar 2020 13:01:28 -0400 Subject: [PATCH] Let hipcc not pass -mllvm option to HIP-Clang on Windows Currently there is a clang bug on Windows causing duplicate -mllvm options in clang -cc1. Tempoarily disable -mllvm options for HIP-Clang on Windows until the bug is fixed. Change-Id: I3a4393ba7745989398dc6c6001722837dad18704 [ROCm/clr commit: e796a1ed78cd8c3a8f69f68e239c7c6a23c9bbe2] --- projects/clr/hipamd/bin/hipcc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/projects/clr/hipamd/bin/hipcc b/projects/clr/hipamd/bin/hipcc index 33a07c39dc..83774a996b 100755 --- a/projects/clr/hipamd/bin/hipcc +++ b/projects/clr/hipamd/bin/hipcc @@ -726,10 +726,12 @@ if ($HIP_PLATFORM eq "clang") { $HIPCXXFLAGS .= " -O3"; $HIPLDFLAGS .= " -O3"; } - if ($optArg ne "-O0") { - $HIPCXXFLAGS .= " -mllvm -amdgpu-early-inline-all=true -mllvm -amdgpu-function-calls=false"; - if ($needLDFLAGS and not $needCXXFLAGS) { - $HIPLDFLAGS .= " -mllvm -amdgpu-early-inline-all=true -mllvm -amdgpu-function-calls=false"; + # Do not pass -mllvm on Windows since there is a clang bug causing duplicate -mllvm options in clang -cc1 on Windows. + # ToDo : remove restriction for Windows after clang bug is fixed. + if ($optArg ne "-O0" and not $isWindows) { + $HIPCXXFLAGS .= " -mllvm -amdgpu-early-inline-all=true -mllvm -amdgpu-function-calls=false"; + if ($needLDFLAGS and not $needCXXFLAGS) { + $HIPLDFLAGS .= " -mllvm -amdgpu-early-inline-all=true -mllvm -amdgpu-function-calls=false"; } } $HIP_DEVLIB_FLAGS = " --hip-device-lib-path=$DEVICE_LIB_PATH";