-
Notifications
You must be signed in to change notification settings - Fork 13.3k
[Clang][Cmake] fix libtool duplicate member name warnings #133619
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
Conversation
fixes llvm#133199 PR llvm#132252 Created a second file that shared <TargetName>.cpp in `clang/lib/CodeGen/CMakeLists.txt` For example There were two AMDGPU.cpp's one in TargetBuiltins and the other in Targets. Even though these were in different directories libtool warns that it might not distinguish them because they share the same base name. There are two fixes. The easy fix is to rename one of them and keep one cmake file. That solution though doesn't future proof this problem in the event of a third <TargetName>.cpp and it seems teams want to just use the target name llvm#132252 (comment). The alternative fix is to seperate the cmake files into their own sub directories. I chose to create static libraries. It might of been possible to build an OBJECT, but I only saw examples of $<TARGET_OBJECTS:> in compiler-rt and test directories so assumed there was a reason it wasn't used.
@llvm/pr-subscribers-backend-amdgpu Author: Farzon Lotfi (farzonl) Changesfixes #133199 PR #132252 Created a second file that shared For example There were two There are two fixes. The easy fix is to rename one of them and keep one cmake file. That solution though doesn't future proof this problem in the event of a third The alternative fix is to seperate the cmake files into their own sub directories. I chose to create static libraries. It might of been possible to build an OBJECT, but I only saw examples of this in compiler-rt and test directories so assumed there was a reason it wasn't used. Full diff: https://github.com/llvm/llvm-project/pull/133619.diff 4 Files Affected:
diff --git a/clang/lib/CodeGen/CMakeLists.txt b/clang/lib/CodeGen/CMakeLists.txt
index ebe2fbd7db295..cdf9f909a3675 100644
--- a/clang/lib/CodeGen/CMakeLists.txt
+++ b/clang/lib/CodeGen/CMakeLists.txt
@@ -116,45 +116,8 @@ add_clang_library(clangCodeGen
PatternInit.cpp
SanitizerMetadata.cpp
SwiftCallingConv.cpp
- TargetBuiltins/ARM.cpp
- TargetBuiltins/AMDGPU.cpp
- TargetBuiltins/Hexagon.cpp
- TargetBuiltins/NVPTX.cpp
- TargetBuiltins/PPC.cpp
- TargetBuiltins/RISCV.cpp
- TargetBuiltins/SPIR.cpp
- TargetBuiltins/SystemZ.cpp
- TargetBuiltins/WebAssembly.cpp
- TargetBuiltins/X86.cpp
TargetInfo.cpp
- Targets/AArch64.cpp
- Targets/AMDGPU.cpp
- Targets/ARC.cpp
- Targets/ARM.cpp
- Targets/AVR.cpp
- Targets/BPF.cpp
- Targets/CSKY.cpp
- Targets/DirectX.cpp
- Targets/Hexagon.cpp
- Targets/Lanai.cpp
- Targets/LoongArch.cpp
- Targets/M68k.cpp
- Targets/MSP430.cpp
- Targets/Mips.cpp
- Targets/NVPTX.cpp
- Targets/PNaCl.cpp
- Targets/PPC.cpp
- Targets/RISCV.cpp
- Targets/SPIR.cpp
- Targets/Sparc.cpp
- Targets/SystemZ.cpp
- Targets/TCE.cpp
- Targets/VE.cpp
- Targets/WebAssembly.cpp
- Targets/X86.cpp
- Targets/XCore.cpp
VarBypassDetector.cpp
-
DEPENDS
vt_gen
intrinsics_gen
@@ -170,4 +133,16 @@ add_clang_library(clangCodeGen
clangFrontend
clangLex
clangSerialization
+ clangCodeGenTargetBuiltins
+ clangCodeGenTargets
+ )
+
+ target_include_directories(clangCodeGen
+ PUBLIC
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/TargetBuiltins
+ ${CMAKE_CURRENT_SOURCE_DIR}/Targets
)
+
+ add_subdirectory(TargetBuiltins)
+ add_subdirectory(Targets)
diff --git a/clang/lib/CodeGen/TargetBuiltins/AMDGPU.cpp b/clang/lib/CodeGen/TargetBuiltins/AMDGPU.cpp
index b56b739094ff3..577fee05d4af6 100644
--- a/clang/lib/CodeGen/TargetBuiltins/AMDGPU.cpp
+++ b/clang/lib/CodeGen/TargetBuiltins/AMDGPU.cpp
@@ -1,4 +1,4 @@
-//===------- AMDCPU.cpp - Emit LLVM Code for builtins ---------------------===//
+//===------- AMDGPU.cpp - Emit LLVM Code for builtins ---------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
diff --git a/clang/lib/CodeGen/TargetBuiltins/CMakeLists.txt b/clang/lib/CodeGen/TargetBuiltins/CMakeLists.txt
new file mode 100644
index 0000000000000..8526c063b4593
--- /dev/null
+++ b/clang/lib/CodeGen/TargetBuiltins/CMakeLists.txt
@@ -0,0 +1,19 @@
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
+
+add_clang_library(clangCodeGenTargetBuiltins STATIC
+ ARM.cpp
+ AMDGPU.cpp
+ Hexagon.cpp
+ NVPTX.cpp
+ PPC.cpp
+ RISCV.cpp
+ SPIR.cpp
+ SystemZ.cpp
+ WebAssembly.cpp
+ X86.cpp
+)
+
+target_link_libraries(clangCodeGenTargetBuiltins
+ PRIVATE
+ clangCodeGen
+)
diff --git a/clang/lib/CodeGen/Targets/CMakeLists.txt b/clang/lib/CodeGen/Targets/CMakeLists.txt
new file mode 100644
index 0000000000000..fd79b6191b379
--- /dev/null
+++ b/clang/lib/CodeGen/Targets/CMakeLists.txt
@@ -0,0 +1,35 @@
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
+
+add_clang_library(clangCodeGenTargets STATIC
+ AArch64.cpp
+ AMDGPU.cpp
+ ARC.cpp
+ ARM.cpp
+ AVR.cpp
+ BPF.cpp
+ CSKY.cpp
+ DirectX.cpp
+ Hexagon.cpp
+ Lanai.cpp
+ LoongArch.cpp
+ M68k.cpp
+ MSP430.cpp
+ Mips.cpp
+ NVPTX.cpp
+ PNaCl.cpp
+ PPC.cpp
+ RISCV.cpp
+ SPIR.cpp
+ Sparc.cpp
+ SystemZ.cpp
+ TCE.cpp
+ VE.cpp
+ WebAssembly.cpp
+ X86.cpp
+ XCore.cpp
+)
+
+target_link_libraries(clangCodeGenTargets
+ PRIVATE
+ clangCodeGen
+)
|
@llvm/pr-subscribers-clang Author: Farzon Lotfi (farzonl) Changesfixes #133199 PR #132252 Created a second file that shared For example There were two There are two fixes. The easy fix is to rename one of them and keep one cmake file. That solution though doesn't future proof this problem in the event of a third The alternative fix is to seperate the cmake files into their own sub directories. I chose to create static libraries. It might of been possible to build an OBJECT, but I only saw examples of this in compiler-rt and test directories so assumed there was a reason it wasn't used. Full diff: https://github.com/llvm/llvm-project/pull/133619.diff 4 Files Affected:
diff --git a/clang/lib/CodeGen/CMakeLists.txt b/clang/lib/CodeGen/CMakeLists.txt
index ebe2fbd7db295..cdf9f909a3675 100644
--- a/clang/lib/CodeGen/CMakeLists.txt
+++ b/clang/lib/CodeGen/CMakeLists.txt
@@ -116,45 +116,8 @@ add_clang_library(clangCodeGen
PatternInit.cpp
SanitizerMetadata.cpp
SwiftCallingConv.cpp
- TargetBuiltins/ARM.cpp
- TargetBuiltins/AMDGPU.cpp
- TargetBuiltins/Hexagon.cpp
- TargetBuiltins/NVPTX.cpp
- TargetBuiltins/PPC.cpp
- TargetBuiltins/RISCV.cpp
- TargetBuiltins/SPIR.cpp
- TargetBuiltins/SystemZ.cpp
- TargetBuiltins/WebAssembly.cpp
- TargetBuiltins/X86.cpp
TargetInfo.cpp
- Targets/AArch64.cpp
- Targets/AMDGPU.cpp
- Targets/ARC.cpp
- Targets/ARM.cpp
- Targets/AVR.cpp
- Targets/BPF.cpp
- Targets/CSKY.cpp
- Targets/DirectX.cpp
- Targets/Hexagon.cpp
- Targets/Lanai.cpp
- Targets/LoongArch.cpp
- Targets/M68k.cpp
- Targets/MSP430.cpp
- Targets/Mips.cpp
- Targets/NVPTX.cpp
- Targets/PNaCl.cpp
- Targets/PPC.cpp
- Targets/RISCV.cpp
- Targets/SPIR.cpp
- Targets/Sparc.cpp
- Targets/SystemZ.cpp
- Targets/TCE.cpp
- Targets/VE.cpp
- Targets/WebAssembly.cpp
- Targets/X86.cpp
- Targets/XCore.cpp
VarBypassDetector.cpp
-
DEPENDS
vt_gen
intrinsics_gen
@@ -170,4 +133,16 @@ add_clang_library(clangCodeGen
clangFrontend
clangLex
clangSerialization
+ clangCodeGenTargetBuiltins
+ clangCodeGenTargets
+ )
+
+ target_include_directories(clangCodeGen
+ PUBLIC
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/TargetBuiltins
+ ${CMAKE_CURRENT_SOURCE_DIR}/Targets
)
+
+ add_subdirectory(TargetBuiltins)
+ add_subdirectory(Targets)
diff --git a/clang/lib/CodeGen/TargetBuiltins/AMDGPU.cpp b/clang/lib/CodeGen/TargetBuiltins/AMDGPU.cpp
index b56b739094ff3..577fee05d4af6 100644
--- a/clang/lib/CodeGen/TargetBuiltins/AMDGPU.cpp
+++ b/clang/lib/CodeGen/TargetBuiltins/AMDGPU.cpp
@@ -1,4 +1,4 @@
-//===------- AMDCPU.cpp - Emit LLVM Code for builtins ---------------------===//
+//===------- AMDGPU.cpp - Emit LLVM Code for builtins ---------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
diff --git a/clang/lib/CodeGen/TargetBuiltins/CMakeLists.txt b/clang/lib/CodeGen/TargetBuiltins/CMakeLists.txt
new file mode 100644
index 0000000000000..8526c063b4593
--- /dev/null
+++ b/clang/lib/CodeGen/TargetBuiltins/CMakeLists.txt
@@ -0,0 +1,19 @@
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
+
+add_clang_library(clangCodeGenTargetBuiltins STATIC
+ ARM.cpp
+ AMDGPU.cpp
+ Hexagon.cpp
+ NVPTX.cpp
+ PPC.cpp
+ RISCV.cpp
+ SPIR.cpp
+ SystemZ.cpp
+ WebAssembly.cpp
+ X86.cpp
+)
+
+target_link_libraries(clangCodeGenTargetBuiltins
+ PRIVATE
+ clangCodeGen
+)
diff --git a/clang/lib/CodeGen/Targets/CMakeLists.txt b/clang/lib/CodeGen/Targets/CMakeLists.txt
new file mode 100644
index 0000000000000..fd79b6191b379
--- /dev/null
+++ b/clang/lib/CodeGen/Targets/CMakeLists.txt
@@ -0,0 +1,35 @@
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
+
+add_clang_library(clangCodeGenTargets STATIC
+ AArch64.cpp
+ AMDGPU.cpp
+ ARC.cpp
+ ARM.cpp
+ AVR.cpp
+ BPF.cpp
+ CSKY.cpp
+ DirectX.cpp
+ Hexagon.cpp
+ Lanai.cpp
+ LoongArch.cpp
+ M68k.cpp
+ MSP430.cpp
+ Mips.cpp
+ NVPTX.cpp
+ PNaCl.cpp
+ PPC.cpp
+ RISCV.cpp
+ SPIR.cpp
+ Sparc.cpp
+ SystemZ.cpp
+ TCE.cpp
+ VE.cpp
+ WebAssembly.cpp
+ X86.cpp
+ XCore.cpp
+)
+
+target_link_libraries(clangCodeGenTargets
+ PRIVATE
+ clangCodeGen
+)
|
@llvm/pr-subscribers-clang-codegen Author: Farzon Lotfi (farzonl) Changesfixes #133199 PR #132252 Created a second file that shared For example There were two There are two fixes. The easy fix is to rename one of them and keep one cmake file. That solution though doesn't future proof this problem in the event of a third The alternative fix is to seperate the cmake files into their own sub directories. I chose to create static libraries. It might of been possible to build an OBJECT, but I only saw examples of this in compiler-rt and test directories so assumed there was a reason it wasn't used. Full diff: https://github.com/llvm/llvm-project/pull/133619.diff 4 Files Affected:
diff --git a/clang/lib/CodeGen/CMakeLists.txt b/clang/lib/CodeGen/CMakeLists.txt
index ebe2fbd7db295..cdf9f909a3675 100644
--- a/clang/lib/CodeGen/CMakeLists.txt
+++ b/clang/lib/CodeGen/CMakeLists.txt
@@ -116,45 +116,8 @@ add_clang_library(clangCodeGen
PatternInit.cpp
SanitizerMetadata.cpp
SwiftCallingConv.cpp
- TargetBuiltins/ARM.cpp
- TargetBuiltins/AMDGPU.cpp
- TargetBuiltins/Hexagon.cpp
- TargetBuiltins/NVPTX.cpp
- TargetBuiltins/PPC.cpp
- TargetBuiltins/RISCV.cpp
- TargetBuiltins/SPIR.cpp
- TargetBuiltins/SystemZ.cpp
- TargetBuiltins/WebAssembly.cpp
- TargetBuiltins/X86.cpp
TargetInfo.cpp
- Targets/AArch64.cpp
- Targets/AMDGPU.cpp
- Targets/ARC.cpp
- Targets/ARM.cpp
- Targets/AVR.cpp
- Targets/BPF.cpp
- Targets/CSKY.cpp
- Targets/DirectX.cpp
- Targets/Hexagon.cpp
- Targets/Lanai.cpp
- Targets/LoongArch.cpp
- Targets/M68k.cpp
- Targets/MSP430.cpp
- Targets/Mips.cpp
- Targets/NVPTX.cpp
- Targets/PNaCl.cpp
- Targets/PPC.cpp
- Targets/RISCV.cpp
- Targets/SPIR.cpp
- Targets/Sparc.cpp
- Targets/SystemZ.cpp
- Targets/TCE.cpp
- Targets/VE.cpp
- Targets/WebAssembly.cpp
- Targets/X86.cpp
- Targets/XCore.cpp
VarBypassDetector.cpp
-
DEPENDS
vt_gen
intrinsics_gen
@@ -170,4 +133,16 @@ add_clang_library(clangCodeGen
clangFrontend
clangLex
clangSerialization
+ clangCodeGenTargetBuiltins
+ clangCodeGenTargets
+ )
+
+ target_include_directories(clangCodeGen
+ PUBLIC
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/TargetBuiltins
+ ${CMAKE_CURRENT_SOURCE_DIR}/Targets
)
+
+ add_subdirectory(TargetBuiltins)
+ add_subdirectory(Targets)
diff --git a/clang/lib/CodeGen/TargetBuiltins/AMDGPU.cpp b/clang/lib/CodeGen/TargetBuiltins/AMDGPU.cpp
index b56b739094ff3..577fee05d4af6 100644
--- a/clang/lib/CodeGen/TargetBuiltins/AMDGPU.cpp
+++ b/clang/lib/CodeGen/TargetBuiltins/AMDGPU.cpp
@@ -1,4 +1,4 @@
-//===------- AMDCPU.cpp - Emit LLVM Code for builtins ---------------------===//
+//===------- AMDGPU.cpp - Emit LLVM Code for builtins ---------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
diff --git a/clang/lib/CodeGen/TargetBuiltins/CMakeLists.txt b/clang/lib/CodeGen/TargetBuiltins/CMakeLists.txt
new file mode 100644
index 0000000000000..8526c063b4593
--- /dev/null
+++ b/clang/lib/CodeGen/TargetBuiltins/CMakeLists.txt
@@ -0,0 +1,19 @@
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
+
+add_clang_library(clangCodeGenTargetBuiltins STATIC
+ ARM.cpp
+ AMDGPU.cpp
+ Hexagon.cpp
+ NVPTX.cpp
+ PPC.cpp
+ RISCV.cpp
+ SPIR.cpp
+ SystemZ.cpp
+ WebAssembly.cpp
+ X86.cpp
+)
+
+target_link_libraries(clangCodeGenTargetBuiltins
+ PRIVATE
+ clangCodeGen
+)
diff --git a/clang/lib/CodeGen/Targets/CMakeLists.txt b/clang/lib/CodeGen/Targets/CMakeLists.txt
new file mode 100644
index 0000000000000..fd79b6191b379
--- /dev/null
+++ b/clang/lib/CodeGen/Targets/CMakeLists.txt
@@ -0,0 +1,35 @@
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
+
+add_clang_library(clangCodeGenTargets STATIC
+ AArch64.cpp
+ AMDGPU.cpp
+ ARC.cpp
+ ARM.cpp
+ AVR.cpp
+ BPF.cpp
+ CSKY.cpp
+ DirectX.cpp
+ Hexagon.cpp
+ Lanai.cpp
+ LoongArch.cpp
+ M68k.cpp
+ MSP430.cpp
+ Mips.cpp
+ NVPTX.cpp
+ PNaCl.cpp
+ PPC.cpp
+ RISCV.cpp
+ SPIR.cpp
+ Sparc.cpp
+ SystemZ.cpp
+ TCE.cpp
+ VE.cpp
+ WebAssembly.cpp
+ X86.cpp
+ XCore.cpp
+)
+
+target_link_libraries(clangCodeGenTargets
+ PRIVATE
+ clangCodeGen
+)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this fix. LGTM.
@nikic what is considered a neglible difference in elapsesed time? Elapsed is consistently a little more after my change in the order of 5-20 seconds. Examples below: Specs
Debug build before changes:
Release build before changes:
Release build after changes:
Debug build after changes:
|
I also did some per obj file testing for compile time and file size. File size was the same. only difference wase where files were stored Compile times again seemed negligible. Did have one after run that was slightly faster. Was not able to determine how you found 30M instructions in SPIR.cpp.o. File size
Compile time per obj file
Release before change:
Release after change:
|
@farzonl Instructions in the sense of the instructions retired during compilation, not the number of instructions in the object file :) I wouldn't expect the changes you made here to have any significant impact on build time. (I guess it might serialize the build more, maybe?) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks sensible to me.
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/204/builds/5082 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/203/builds/6269 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/205/builds/5060 Here is the relevant piece of the build log for the reference
|
While clangCodeGenTargetBuiltins and clangCodeGenTargets are static libraries clangCodeGen is not and so this is creating a circular reference in the linux amdgpu-offload CIs on ubuntu and RHEL. removing the circular reference doesn't break anything and looks to be a vestigial element of the origional PR.
I have a fix for this build failure: #133776 |
…arnings" (#133795) Reverts llvm/llvm-project#133619
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/80/builds/12049 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/23/builds/8943 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/130/builds/11827 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/169/builds/9995 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/97/builds/5787 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/118/builds/5516 Here is the relevant piece of the build log for the reference
|
…3850) fixes #133199 As of the third commit the fix to the linker missing references in `Targets/DirectX.cpp` found in #133776 was fixed by moving `HLSLBufferLayoutBuilder.cpp` to `clang/lib/CodeGen/Targets/`. It fixes the circular reference issue found in #133619 for all `-DBUILD_SHARED_LIBS=ON` builds by removing `target_link_libraries` from the sub directory cmake files. testing for amdgpu offload was done via `cmake -B ../llvm_amdgpu -S llvm -GNinja -C offload/cmake/caches/Offload.cmake -DCMAKE_BUILD_TYPE=Release` PR #132252 Created a second file that shared <TargetName>.cpp in clang/lib/CodeGen/CMakeLists.txt For example There were two AMDGPU.cpp's one in TargetBuiltins and the other in Targets. Even though these were in different directories libtool warns that it might not distinguish them because they share the same base name. There are two potential fixes. The easy fix is to rename one of them and keep one cmake file. That solution though doesn't future proof this problem in the event of a third <TargetName>.cpp and it seems teams want to just use the target name #132252 (comment). The alternative fix that this PR went with is to seperate the cmake files into their own sub directories as static libs.
…rnings (#133850) fixes llvm/llvm-project#133199 As of the third commit the fix to the linker missing references in `Targets/DirectX.cpp` found in llvm/llvm-project#133776 was fixed by moving `HLSLBufferLayoutBuilder.cpp` to `clang/lib/CodeGen/Targets/`. It fixes the circular reference issue found in llvm/llvm-project#133619 for all `-DBUILD_SHARED_LIBS=ON` builds by removing `target_link_libraries` from the sub directory cmake files. testing for amdgpu offload was done via `cmake -B ../llvm_amdgpu -S llvm -GNinja -C offload/cmake/caches/Offload.cmake -DCMAKE_BUILD_TYPE=Release` PR llvm/llvm-project#132252 Created a second file that shared <TargetName>.cpp in clang/lib/CodeGen/CMakeLists.txt For example There were two AMDGPU.cpp's one in TargetBuiltins and the other in Targets. Even though these were in different directories libtool warns that it might not distinguish them because they share the same base name. There are two potential fixes. The easy fix is to rename one of them and keep one cmake file. That solution though doesn't future proof this problem in the event of a third <TargetName>.cpp and it seems teams want to just use the target name llvm/llvm-project#132252 (comment). The alternative fix that this PR went with is to seperate the cmake files into their own sub directories as static libs.
fixes #133199
PR #132252 Created a second file that shared
<TargetName>.cpp
inclang/lib/CodeGen/CMakeLists.txt
For example There were two
AMDGPU.cpp
's one inTargetBuiltins
and the other inTargets
. Even though these were in different directorieslibtool
warns that it might not distinguish them because they share the same base name.There are two potential fixes. The easy fix is to rename one of them and keep one cmake file. That solution though doesn't future proof this problem in the event of a third
<TargetName>.cpp
and it seems teams want to just use the target name#132252 (comment).
The alternative fix is to seperate the cmake files into their own sub directories. I chose to create static libraries. It might of been possible to build an OBJECT, but I only saw examples of this in compiler-rt and test directories so assumed there was a reason it wasn't used.