Skip to content

Commit d4f6beb

Browse files
committed
Undo AIX customization in flang-rt cmake because AIX now supports per_target_runttime_dir and add LIT tests.
1 parent 1d14692 commit d4f6beb

File tree

6 files changed

+39
-5
lines changed

6 files changed

+39
-5
lines changed

clang/lib/Driver/ToolChain.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -782,9 +782,6 @@ std::string ToolChain::getCompilerRT(const ArgList &Args, StringRef Component,
782782
Path = P;
783783
}
784784

785-
if (getTriple().isOSAIX())
786-
Path.clear();
787-
788785
// Check the filename for the old layout if the new one does not exist.
789786
CRTBasename = buildCompilerRTBasename(Args, Component, Type,
790787
/*AddArch=*/!IsFortran, IsFortran);

clang/test/Driver/Inputs/resource_dir_with_per_target_subdir/lib/powerpc64-ibm-aix/libflang_rt.runtime.a

Whitespace-only changes.

clang/test/Driver/Inputs/resource_dir_with_per_target_subdir/lib/powerpc64le-unknown-linux-gnu/libflang_rt.runtime.a

Whitespace-only changes.

clang/test/Driver/Inputs/resource_dir_with_per_target_subdir/lib/powerpc64le-unknown-linux-gnu/libflang_rt.runtime.so

Whitespace-only changes.

flang-rt/cmake/modules/GetToolchainDirs.cmake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,8 @@
3434
function (get_toolchain_library_subdir outvar)
3535
set(outval "lib")
3636

37-
if (APPLE OR (UNIX AND CMAKE_SYSTEM_NAME MATCHES "AIX"))
37+
if (APPLE)
3838
# Required to be "darwin" for MachO toolchain.
39-
# AIX uses lib/${os_dir} as if LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF
4039
get_toolchain_os_dirname(os_dirname)
4140
set(outval "${outval}/${os_dirname}")
4241
else ()
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
!! Testing ld command with flang on POWERPC.
2+
3+
!! Because flang-rt currently only supports
4+
!! LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON, use
5+
!! resource_dir_with_per_target_subdir as inputs.
6+
7+
! Check powerpc64-ibm-aix 64-bit linking to static flang-rt
8+
! RUN: %flang %s -### 2>&1 \
9+
! RUN: --target=powerpc64-ibm-aix \
10+
! RUN: -resource-dir=%S/../../../clang/test/Driver/Inputs/resource_dir_with_per_target_subdir \
11+
! RUN: | FileCheck %s --check-prefix=AIX64-LD-PER-TARGET
12+
13+
! AIX64-LD-PER-TARGET-NOT: warning:
14+
! AIX64-LD-PER-TARGET: "-fc1" "-triple" "powerpc64-ibm-aix"
15+
! AIX64-LD-PER-TARGET: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
16+
! AIX64-LD-PER-TARGET: "{{.*}}ld{{(.exe)?}}"
17+
! AIX64-LD-PER-TARGET-NOT: "-bnso"
18+
! AIX64-LD-PER-TARGET: "-b64"
19+
! AIX64-LD-PER-TARGET: "-bpT:0x100000000" "-bpD:0x110000000"
20+
! AIX64-LD-PER-TARGET: "-lc"
21+
! AIX64-LD-PER-TARGET: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}powerpc64-ibm-aix{{/|\\\\}}libflang_rt.runtime.a"
22+
! AIX64-LD-PER-TARGET: "-lm"
23+
! AIX64-LD-PER-TARGET: "-lpthread"
24+
25+
! Check powerpc64le-unknown-linux-gnu 64-bit linking to static flang-rt
26+
! RUN: %flang %s -### 2>&1 \
27+
! RUN: --target=powerpc64le-unknown-linux-gnu \
28+
! RUN: -resource-dir=%S/../../../clang/test/Driver/Inputs/resource_dir_with_per_target_subdir \
29+
! RUN: | FileCheck %s --check-prefixes=LOP64-LD-PER-TARGET
30+
31+
! LOP64-LD-PER-TARGET-NOT: warning:
32+
! LOP64-LD-PER-TARGET: "-fc1" "-triple" "powerpc64le-unknown-linux-gnu"
33+
! LOP64-LD-PER-TARGET: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
34+
! LOP64-LD-PER-TARGET: "{{.*}}ld{{(.exe)?}}"
35+
! LOP64-LD-PER-TARGET-NOT: "-bnso"
36+
! LOP64-LD-PER-TARGET: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}powerpc64le-unknown-linux-gnu{{/|\\\\}}libflang_rt.runtime.a"
37+
! LOP64-LD-PER-TARGET: "-lm"
38+
! LOP64-LD-PER-TARGET: "-lc"

0 commit comments

Comments
 (0)