From e15ff6a28e9acb5d0a079f3ef204a5c25f4a97ed Mon Sep 17 00:00:00 2001 From: Maneesh Gupta Date: Fri, 15 Jul 2016 10:40:56 +0530 Subject: [PATCH] Handle linker warning correctly Change-Id: Ifca5886e31b4551603944c2b90a8e532442e889f --- bin/hipcc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/hipcc b/bin/hipcc index 92ac35e049..7c894af53e 100755 --- a/bin/hipcc +++ b/bin/hipcc @@ -75,7 +75,13 @@ if ($HIP_PLATFORM eq "hcc") { $HIPLDFLAGS = "-hc -L$HCC_HOME/lib -Wl,--rpath=$HCC_HOME/lib -lc++ -ldl -lpthread -Wl,--whole-archive -lmcwamp -Wl,--no-whole-archive"; # Suppress linker warnings in case HCC distribution contains OpenCL/SPIR symbols - #$HIPLDFLAGS .= " -Wl,--defsym=_binary_kernel_spir_end=0 -Wl,--defsym=_binary_kernel_spir_start=0 -Wl,--defsym=_binary_kernel_cl_start=0 -Wl,--defsym=_binary_kernel_cl_end=0"; + $HOST_OSNAME= `cat /etc/os-release | grep "^ID\=" | cut -d= -f2 | tr -d '\n'`; + $HOST_OSVER= `cat /etc/os-release | grep "^VERSION_ID\=" | cut -d= -f2 | tr -d '\n'`; + if ($HOST_OSNAME eq "ubuntu" and $HOST_OSVER eq "\"16.04\"") { + # No additional flags required + } else { + $HIPLDFLAGS .= " -Wl,--defsym=_binary_kernel_spir_end=0 -Wl,--defsym=_binary_kernel_spir_start=0 -Wl,--defsym=_binary_kernel_cl_start=0 -Wl,--defsym=_binary_kernel_cl_end=0"; + } # Satisfy HCC dependencies $HIPLDFLAGS .= " -lc++abi";