Skip to content

Commit c3356ac

Browse files
[llvm-readtapi] Fix bad symlink with readtapi tool (#68835)
The Clang-AIX-Wyvern-Dev buildbot is currently failing at the set directory permission due to a bad symlink caused by this [commit](https://github.ibm.com/compiler/llvm-project/commit/a54f31fabd55ab111484b1e094e3d2c6b29c4715). This change is creating the additional symlink `readtapi -> llvm-readtapi` which causes it to appear in `/buildbot_worker/official-worker/clang-aix-dev/installdir`. After some investigation, it looks like `readtapi` is the only tool that is getting symlinked that is not guarded by the `LLVM_INSTALL_BINUTILS_SYMLINKS` macro. For example: 1. `llvm/tools/llvm-objcopy/CMakeLists.txt` ``` if(LLVM_INSTALL_BINUTILS_SYMLINKS) add_llvm_tool_symlink(objcopy llvm-objcopy) endif() ``` 2. `llvm/tools/llvm-dwp/CMakeLists.txt` ``` if(LLVM_INSTALL_BINUTILS_SYMLINKS) add_llvm_tool_symlink(dwp llvm-dwp) endif() ```
1 parent b9b8fc4 commit c3356ac

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

llvm/tools/llvm-readtapi/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@ add_llvm_tool(llvm-readtapi
99
DiffEngine.cpp
1010
)
1111

12-
add_llvm_tool_symlink(readtapi llvm-readtapi)
12+
if(LLVM_INSTALL_BINUTILS_SYMLINKS)
13+
add_llvm_tool_symlink(readtapi llvm-readtapi)
14+
endif()

llvm/utils/gn/secondary/llvm/tools/llvm-readtapi/BUILD.gn

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
import("//llvm/tools/binutils_symlinks.gni")
2+
import("//llvm/utils/gn/build/symlink_or_copy.gni")
3+
4+
if (llvm_install_binutils_symlinks) {
5+
symlink_or_copy("readtapi") {
6+
deps = [ ":llvm-readtapi" ]
7+
source = "llvm-readtapi"
8+
output = "$root_out_dir/bin/readtapi"
9+
}
10+
}
11+
12+
# //:llvm-readtapi depends on this symlink target, see comment in //BUILD.gn.
13+
group("symlinks") {
14+
deps = [ ":llvm-readtapi" ]
15+
if (llvm_install_binutils_symlinks) {
16+
deps += [ ":readtapi" ]
17+
}
18+
}
19+
120
executable("llvm-readtapi") {
221
deps = [
322
"//llvm/lib/Object",

0 commit comments

Comments
 (0)