Skip to content

[AIX] Fix AIX BuildBot failure as AIX linker doesn't support version script. #117342

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

DanielCChen
Copy link
Contributor

AIX BuildBot failed due to #116556 as AIX linker does not support version script.
This PR is to fix the failure

This PR is on behalf of [email protected]

@DanielCChen DanielCChen self-assigned this Nov 22, 2024
@llvmbot llvmbot added the clang Clang issues not falling into any other category label Nov 22, 2024
@llvmbot
Copy link
Member

llvmbot commented Nov 22, 2024

@llvm/pr-subscribers-clang

Author: Daniel Chen (DanielCChen)

Changes

AIX BuildBot failed due to #116556 as AIX linker does not support version script.
This PR is to fix the failure

This PR is on behalf of [email protected]


Full diff: https://github.com/llvm/llvm-project/pull/117342.diff

1 Files Affected:

  • (modified) clang/tools/clang-shlib/CMakeLists.txt (+6-4)
diff --git a/clang/tools/clang-shlib/CMakeLists.txt b/clang/tools/clang-shlib/CMakeLists.txt
index 31484ec49c7739..2d97347ea7f828 100644
--- a/clang/tools/clang-shlib/CMakeLists.txt
+++ b/clang/tools/clang-shlib/CMakeLists.txt
@@ -48,11 +48,13 @@ add_clang_library(clang-cpp
                   ${_OBJECTS}
                   LINK_LIBS
                   ${_DEPS})
+# AIX linker does not support version script
+if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "AIX")
+  configure_file(simple_version_script.map.in simple_version_script.map)
 
-configure_file(simple_version_script.map.in simple_version_script.map)
-
-if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
-  target_link_options(clang-cpp PRIVATE LINKER:--version-script,${CMAKE_CURRENT_BINARY_DIR}/simple_version_script.map)
+  if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+    target_link_options(clang-cpp PRIVATE LINKER:--version-script,${CMAKE_CURRENT_BINARY_DIR}/simple_version_script.map)
+  endif()
 endif()
 
 # Optimize function calls for default visibility definitions to avoid PLT and

Copy link
Contributor

@xingxue-ibm xingxue-ibm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM!

@DanielCChen DanielCChen merged commit b71038a into llvm:main Nov 22, 2024
10 checks passed
@aaronpuchert
Copy link
Member

Doesn't eaa0a21 already fix this? If CMAKE_SYSTEM_NAME is Linux, it can probably not be AIX at the same time, right? See also the discussion on #116556.

Do you mind if I revert this?


configure_file(simple_version_script.map.in simple_version_script.map)

if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This implies NOT ${CMAKE_SYSTEM_NAME} MATCHES "AIX", hence the target_link_options is already unreachable.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, @aaronpuchert! With commit eaa0a21 the AIX build problem is fixed already so the change in #117342 does not make sense any more. I created PR Revert "[AIX] Fix AIX BuildBot failure as AIX linker doesn't support version script.".

@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 22, 2024

LLVM Buildbot has detected a new failure on builder clang-ppc64-aix running on aix-ppc64 while building clang at step 3 "clean-build-dir".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/64/builds/1515

Here is the relevant piece of the build log for the reference
Step 3 (clean-build-dir) failure: Delete failed. (failure) (timed out)
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'Profile-powerpc :: ContinuousSyncMode/online-merging.c' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 6: rm -rf /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-powerpc/ContinuousSyncMode/Output/online-merging.c.tmp.dir && mkdir -p /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-powerpc/ContinuousSyncMode/Output/online-merging.c.tmp.dir && cd /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-powerpc/ContinuousSyncMode/Output/online-merging.c.tmp.dir
+ rm -rf /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-powerpc/ContinuousSyncMode/Output/online-merging.c.tmp.dir
+ mkdir -p /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-powerpc/ContinuousSyncMode/Output/online-merging.c.tmp.dir
+ cd /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-powerpc/ContinuousSyncMode/Output/online-merging.c.tmp.dir
RUN: at line 9: echo "void dso1(void) {}" > dso1.c
+ echo 'void dso1(void) {}'
RUN: at line 10: echo "void dso2(void) {}" > dso2.c
+ echo 'void dso2(void) {}'
RUN: at line 11: /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/./bin/clang   -m32   -fprofile-generate -mllvm -runtime-counter-relocation -shared -o /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-powerpc/ContinuousSyncMode/Output/online-merging.c.tmp.dir/dso1.dylib dso1.c -fprofile-update=atomic
+ /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/./bin/clang -m32 -fprofile-generate -mllvm -runtime-counter-relocation -shared -o /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-powerpc/ContinuousSyncMode/Output/online-merging.c.tmp.dir/dso1.dylib dso1.c -fprofile-update=atomic
RUN: at line 12: /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/./bin/clang   -m32   -fprofile-generate -mllvm -runtime-counter-relocation -shared -o /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-powerpc/ContinuousSyncMode/Output/online-merging.c.tmp.dir/dso2.dylib dso2.c -fprofile-update=atomic
+ /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/./bin/clang -m32 -fprofile-generate -mllvm -runtime-counter-relocation -shared -o /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-powerpc/ContinuousSyncMode/Output/online-merging.c.tmp.dir/dso2.dylib dso2.c -fprofile-update=atomic
RUN: at line 13: /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/./bin/clang   -m32   -fprofile-generate -mllvm -runtime-counter-relocation -o main.exe /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/compiler-rt/test/profile/ContinuousSyncMode/online-merging.c /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-powerpc/ContinuousSyncMode/Output/online-merging.c.tmp.dir/dso1.dylib /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-powerpc/ContinuousSyncMode/Output/online-merging.c.tmp.dir/dso2.dylib -fprofile-update=atomic
+ /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/./bin/clang -m32 -fprofile-generate -mllvm -runtime-counter-relocation -o main.exe /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/compiler-rt/test/profile/ContinuousSyncMode/online-merging.c /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-powerpc/ContinuousSyncMode/Output/online-merging.c.tmp.dir/dso1.dylib /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-powerpc/ContinuousSyncMode/Output/online-merging.c.tmp.dir/dso2.dylib -fprofile-update=atomic
RUN: at line 18: env LLVM_PROFILE_FILE="/home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-powerpc/ContinuousSyncMode/Output/online-merging.c.tmp.dir/profdir/%m%c.profraw"  /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-powerpc/ContinuousSyncMode/Output/online-merging.c.tmp.dir/main.exe nospawn
+ env LLVM_PROFILE_FILE=/home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-powerpc/ContinuousSyncMode/Output/online-merging.c.tmp.dir/profdir/%m%c.profraw /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-powerpc/ContinuousSyncMode/Output/online-merging.c.tmp.dir/main.exe nospawn
RUN: at line 19: llvm-profdata merge -o /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-powerpc/ContinuousSyncMode/Output/online-merging.c.tmp.profdata /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-powerpc/ContinuousSyncMode/Output/online-merging.c.tmp.dir/profdir
+ llvm-profdata merge -o /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-powerpc/ContinuousSyncMode/Output/online-merging.c.tmp.profdata /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-powerpc/ContinuousSyncMode/Output/online-merging.c.tmp.dir/profdir
RUN: at line 20: llvm-profdata show --counts --all-functions /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-powerpc/ContinuousSyncMode/Output/online-merging.c.tmp.profdata | FileCheck /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/compiler-rt/test/profile/ContinuousSyncMode/online-merging.c -check-prefix=ROUND1
+ llvm-profdata show --counts --all-functions /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-powerpc/ContinuousSyncMode/Output/online-merging.c.tmp.profdata
+ FileCheck /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/compiler-rt/test/profile/ContinuousSyncMode/online-merging.c -check-prefix=ROUND1
RUN: at line 42: env LLVM_PROFILE_FILE="/home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-powerpc/ContinuousSyncMode/Output/online-merging.c.tmp.dir/profdir/%m%c.profraw"  /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-powerpc/ContinuousSyncMode/Output/online-merging.c.tmp.dir/main.exe spawn 'LLVM_PROFILE_FILE=/home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-powerpc/ContinuousSyncMode/Output/online-merging.c.tmp.dir/profdir/%m%c.profraw'
+ env LLVM_PROFILE_FILE=/home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-powerpc/ContinuousSyncMode/Output/online-merging.c.tmp.dir/profdir/%m%c.profraw /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-powerpc/ContinuousSyncMode/Output/online-merging.c.tmp.dir/main.exe spawn LLVM_PROFILE_FILE=/home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-powerpc/ContinuousSyncMode/Output/online-merging.c.tmp.dir/profdir/%m%c.profraw
RUN: at line 43: llvm-profdata merge -o /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-powerpc/ContinuousSyncMode/Output/online-merging.c.tmp.profdata /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-powerpc/ContinuousSyncMode/Output/online-merging.c.tmp.dir/profdir
+ llvm-profdata merge -o /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-powerpc/ContinuousSyncMode/Output/online-merging.c.tmp.profdata /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-powerpc/ContinuousSyncMode/Output/online-merging.c.tmp.dir/profdir
RUN: at line 44: llvm-profdata show --counts --all-functions /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-powerpc/ContinuousSyncMode/Output/online-merging.c.tmp.profdata | FileCheck /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/compiler-rt/test/profile/ContinuousSyncMode/online-merging.c -check-prefix=ROUND2
+ llvm-profdata show --counts --all-functions /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/runtimes/runtimes-bins/compiler-rt/test/profile/Profile-powerpc/ContinuousSyncMode/Output/online-merging.c.tmp.profdata
+ FileCheck /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/compiler-rt/test/profile/ContinuousSyncMode/online-merging.c -check-prefix=ROUND2
/home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/compiler-rt/test/profile/ContinuousSyncMode/online-merging.c:54:16: error: ROUND2-DAG: expected string not found in input
// ROUND2-DAG: Block counts: [97]
               ^
<stdin>:13:20: note: scanning from here
 Block counts: [97]
                   ^
<stdin>:14:12: note: possible intended match here
Instrumentation level: IR entry_first = 0
           ^

Input file: <stdin>
Check file: /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/compiler-rt/test/profile/ContinuousSyncMode/online-merging.c

-dump-input=help explains the following input dump.

Input was:
<<<<<<
...

xingxue-ibm added a commit that referenced this pull request Nov 24, 2024
…version script." (#117444)

Commit
eaa0a21
has fixed the build problem already so the change in
#117342 does not make sense any more. I am reverting
it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants