[PATCH] D88425: Skip -fPIE for AMDGPU and HIP toolchain

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 22 11:42:51 PST 2022


yaxunl added a comment.

In D88425#3337003 <https://reviews.llvm.org/D88425#3337003>, @MaskRay wrote:

> I plan to default CMake `CLANG_DEFAULT_PIE_ON_LINUX` to on in D120305 <https://reviews.llvm.org/D120305> and hip-fpie-option.hip will fail. Do you mind investigating the issue?

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"}}


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88425/new/

https://reviews.llvm.org/D88425



More information about the cfe-commits mailing list