AMDGPU toolchain does not support -fPIE, therefore skip it if specified by driver.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
LGTM
clang/test/Driver/hip-fpie-option.hip | ||
---|---|---|
34 | Should there be some sort of DEV-NOT: -pic-is-pie instead? This line seems to implicitly rely on -pic-is-pie` would come before -mframe-pointer and it's not at all obvious that the key is the absence of -pic-is-pie. |
clang/test/Driver/hip-fpie-option.hip | ||
---|---|---|
34 | will add when commit |
Comment Actions
I plan to default CMake CLANG_DEFAULT_PIE_ON_LINUX to on in D120305 and hip-fpie-option.hip will fail. Do you mind investigating the issue?
Comment Actions
You need the following change. It is due to the default PIE change for the host toolchain.
diff --git a/clang/test/Driver/hip-fpie-option.hip b/clang/test/Driver/hip-fpie-option.hip index 2e296a099dea..d8a15ffbaa43 100644 --- a/clang/test/Driver/hip-fpie-option.hip +++ b/clang/test/Driver/hip-fpie-option.hip @@ -5,11 +5,11 @@ // RUN: %clang -### -target x86_64-unknown-linux-gnu \ // RUN: --offload-arch=gfx906 %s -nogpulib -nogpuinc \ -// RUN: 2>&1 | FileCheck -check-prefixes=DEV,HOST-STATIC %s +// RUN: 2>&1 | FileCheck -check-prefixes=DEV,HOST-PIE %s // RUN: %clang -### -target x86_64-unknown-linux-gnu \ // RUN: -fgpu-rdc --offload-arch=gfx906 %s -nogpulib -nogpuinc \ -// RUN: 2>&1 | FileCheck -check-prefixes=DEV,HOST-STATIC %s +// RUN: 2>&1 | FileCheck -check-prefixes=DEV,HOST-PIE %s // RUN: %clang -### -target x86_64-unknown-linux-gnu \ // RUN: --offload-arch=gfx906 %s -nogpulib -nogpuinc \ @@ -32,7 +32,6 @@ // RUN: 2>&1 | FileCheck -check-prefixes=DEV,HOST-PIE %s // DEV-DAG: {{".*clang.*".* "-triple" "amdgcn-amd-amdhsa".* "-mrelocation-model" "pic" "-pic-level" "[1|2]".* "-mframe-pointer=all"}} -// HOST-STATIC-DAG: {{".*clang.*".* "-triple" "x86_64-unknown-linux-gnu".* "-mrelocation-model" "static"}} // HOST-PIC-DAG: {{".*clang.*".* "-triple" "x86_64-unknown-linux-gnu".* "-mrelocation-model" "pic" "-pic-level" "2"}} // HOST-PIC-NOT: "-pic-is-pie" // HOST-PIE-DAG: {{".*clang.*".* "-triple" "x86_64-unknown-linux-gnu".* "-mrelocation-model" "pic" "-pic-level" "2" "-pic-is-pie"}}
Should there be some sort of DEV-NOT: -pic-is-pie instead? This line seems to implicitly rely on -pic-is-pie` would come before -mframe-pointer and it's not at all obvious that the key is the absence of -pic-is-pie.