Skip to content

Commit 21ccf55

Browse files
asudarsajhuber6kazutakahirata
authored
[ClangLinkerWrapper] Reintroduce missing upstream commits that remove in-house LTO in clang-linker-wrapper (#17323)
A couple of upstream commits were not merged due to merge conflicts. This PR reintroduces the following upstream commits: ccd73ee 4a96081 Also, This PR restores missing changes from upstream commit aae059e1389bebe86ceb3aea159d95ca6d0823ea](f2f1a14) Thanks --------- Signed-off-by: Arvind Sudarsanam <arvind.sudarsanam@intel.com> Co-authored-by: Joseph Huber <huberjn@outlook.com> Co-authored-by: Kazu Hirata <kazu@google.com>
1 parent ae76189 commit 21ccf55

File tree

3 files changed

+14
-372
lines changed

3 files changed

+14
-372
lines changed

clang/test/Driver/linker-wrapper-libs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ int bar() { return weak; }
161161
// RUN: --linker-path=/usr/bin/ld %t.o %t.a %t.a -o a.out 2>&1 \
162162
// RUN: | FileCheck %s --check-prefix=LIBRARY-GLOBAL-DEFINED
163163

164-
// LIBRARY-GLOBAL-DEFINED: clang{{.*}} -o {{.*}}.img --target=nvptx64-nvidia-cuda -march=sm_70 {{.*}} {{.*}}.o
164+
// LIBRARY-GLOBAL-DEFINED: clang{{.*}} -o {{.*}}.img --target=nvptx64-nvidia-cuda -march=sm_70 {{.*}}.o {{.*}}.o
165165
// LIBRARY-GLOBAL-DEFINED-NOT: {{.*}}gfx1030{{.*}}.o
166166
// LIBRARY-GLOBAL-DEFINED: clang{{.*}} -o {{.*}}.img --target=amdgcn-amd-amdhsa -mcpu=gfx1030 {{.*}}.o {{.*}}.o
167167

@@ -185,7 +185,7 @@ int bar() { return weak; }
185185
// RUN: --linker-path=/usr/bin/ld %t.o --whole-archive %t.a -o a.out 2>&1 \
186186
// RUN: | FileCheck %s --check-prefix=LIBRARY-WHOLE-ARCHIVE
187187

188-
// LIBRARY-WHOLE-ARCHIVE: clang{{.*}} -o {{.*}}.img --target=nvptx64-nvidia-cuda -march=sm_70 {{.*}} {{.*}}.o
188+
// LIBRARY-WHOLE-ARCHIVE: clang{{.*}} -o {{.*}}.img --target=nvptx64-nvidia-cuda -march=sm_70 {{.*}}.o {{.*}}.o
189189
// LIBRARY-WHOLE-ARCHIVE: clang{{.*}} -o {{.*}}.img --target=amdgcn-amd-amdhsa -mcpu=gfx1030 {{.*}}.o {{.*}}.o
190190
// LIBRARY-WHOLE-ARCHIVE: clang{{.*}} -o {{.*}}.img --target=nvptx64-nvidia-cuda -march=sm_52 {{.*}}.o
191191
// LIBRARY-WHOLE-ARCHIVE: clang{{.*}} -o {{.*}}.img --target=amdgcn-amd-amdhsa -mcpu=gfx90a {{.*}}.o

clang/test/Driver/linker-wrapper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ __attribute__((visibility("protected"), used)) int x;
4848
// RUN: clang-linker-wrapper --host-triple=x86_64-unknown-linux-gnu --dry-run --save-temps -O2 \
4949
// RUN: --linker-path=/usr/bin/ld %t.o -o a.out 2>&1 | FileCheck %s --check-prefix=AMDGPU-LTO-TEMPS
5050

51-
// AMDGPU-LTO-TEMPS: clang{{.*}} -o {{.*}}.img --target=amdgcn-amd-amdhsa -mcpu=gfx1030 -O2 -flto -Wl,--no-undefined {{.*}} -save-temps
51+
// AMDGPU-LTO-TEMPS: clang{{.*}} -o {{.*}}.img --target=amdgcn-amd-amdhsa -mcpu=gfx1030 -O2 -flto -Wl,--no-undefined {{.*}}.o -save-temps
5252

5353
// RUN: clang-offload-packager -o %t.out \
5454
// RUN: --image=file=%t.elf.o,kind=openmp,triple=x86_64-unknown-linux-gnu \

0 commit comments

Comments
 (0)