Skip to content

[Offload] Fix build install directory and remove 'add_llvm_library'#198622

Merged
jhuber6 merged 1 commit into
llvm:mainfrom
jhuber6:FixOpenMPInstallDir
May 19, 2026
Merged

[Offload] Fix build install directory and remove 'add_llvm_library'#198622
jhuber6 merged 1 commit into
llvm:mainfrom
jhuber6:FixOpenMPInstallDir

Conversation

@jhuber6
Copy link
Copy Markdown
Contributor

@jhuber6 jhuber6 commented May 19, 2026

Summary:
The problem is that we do not correctly set the build directory output
for offload/. Normally, it's supposed to mirror the install pattern.
This is because we both have variants and so people can use the compiler
from the build directory.

Currently, if you build more than one variant of the offload/ library
they will clobber each-other in <build>/lib/, so no cross compiling
allowed. Additionally, these will not be usable in the build directory
because the compiler will think that they are in the triple directory
when they are not.

Relatively simple fix, just copy-paste the pattern every other runtime
uses and then remove the implicit handling we get from
add_llvm_libraries. The only this it did for us was automatically map
component names to the libraries, which is easy enough to do.

Summary:
The problem is that we do not correctly set the build directory output
for offload/. Normally, it's supposed to mirror the install pattern.
This is because we both have variants and so people can use the compiler
from the build directory.

Currently, if you build more than one variant of the offload/ library
they will clobber each-other in `<build>/lib/`, so no cross compiling
allowed. Additionally, these will not be usable in the build directory
because the compiler will think that they are in the triple directory
when they are not.

Relatively simple fix, just copy-paste the pattern every other runtime
uses and then remove the implicit handling we get from
`add_llvm_libraries`. The only this it did for us was automatically map
component names to the libraries, which is easy enough to do.
@llvmorg-github-actions
Copy link
Copy Markdown

@llvm/pr-subscribers-offload

Author: Joseph Huber (jhuber6)

Changes

Summary:
The problem is that we do not correctly set the build directory output
for offload/. Normally, it's supposed to mirror the install pattern.
This is because we both have variants and so people can use the compiler
from the build directory.

Currently, if you build more than one variant of the offload/ library
they will clobber each-other in &lt;build&gt;/lib/, so no cross compiling
allowed. Additionally, these will not be usable in the build directory
because the compiler will think that they are in the triple directory
when they are not.

Relatively simple fix, just copy-paste the pattern every other runtime
uses and then remove the implicit handling we get from
add_llvm_libraries. The only this it did for us was automatically map
component names to the libraries, which is easy enough to do.


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

4 Files Affected:

  • (modified) offload/CMakeLists.txt (+11-10)
  • (modified) offload/liboffload/CMakeLists.txt (+5-10)
  • (modified) offload/libomptarget/CMakeLists.txt (+4-19)
  • (modified) offload/plugins-nextgen/CMakeLists.txt (+7-32)
diff --git a/offload/CMakeLists.txt b/offload/CMakeLists.txt
index 06ad887e3f307..e8a25ece89a11 100644
--- a/offload/CMakeLists.txt
+++ b/offload/CMakeLists.txt
@@ -90,19 +90,20 @@ set(CMAKE_CXX_STANDARD_REQUIRED NO)
 set(CMAKE_CXX_EXTENSIONS NO)
 
 # Set the path of all resulting libraries to a unified location so that it can
-# be used for testing.
-# TODO: Use common runtimes infrastructure for output and install paths
-set(LIBOMPTARGET_LIBRARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
+# be used for testing and found in the build tree.
+if(LLVM_LIBRARY_OUTPUT_INTDIR)
+  if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
+    set(LIBOMPTARGET_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${OFFLOAD_TARGET_SUBDIR})
+  else()
+    set(LIBOMPTARGET_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR})
+  endif()
+else()
+  set(LIBOMPTARGET_LIBRARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
+endif()
 set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBOMPTARGET_LIBRARY_DIR})
 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIBOMPTARGET_LIBRARY_DIR})
 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LIBOMPTARGET_LIBRARY_DIR})
 
-if(NOT LLVM_LIBRARY_OUTPUT_INTDIR)
-  set(LIBOMPTARGET_INTDIR ${LIBOMPTARGET_LIBRARY_DIR})
-else()
-  set(LIBOMPTARGET_INTDIR ${LLVM_LIBRARY_OUTPUT_INTDIR})
-endif()
-
 # Get dependencies for the different components of the project.
 include(LibomptargetGetDependencies)
 
@@ -286,7 +287,7 @@ endif()
 # TODO: Use RUNTIMES_OUTPUT_RESOURCE_LIB_DIR instead
 set(LIBOMPTARGET_LLVM_LIBRARY_DIR "${LLVM_LIBRARY_DIR}" CACHE STRING
   "Path to folder containing llvm library libomptarget.so")
-set(LIBOMPTARGET_LLVM_LIBRARY_INTDIR "${LIBOMPTARGET_INTDIR}" CACHE STRING
+set(LIBOMPTARGET_LLVM_LIBRARY_INTDIR "${LIBOMPTARGET_LIBRARY_DIR}" CACHE STRING
   "Path to folder where intermediate libraries will be output")
 
 add_subdirectory(tools/offload-tblgen)
diff --git a/offload/liboffload/CMakeLists.txt b/offload/liboffload/CMakeLists.txt
index c58096c71a5f5..61cc588c47bae 100644
--- a/offload/liboffload/CMakeLists.txt
+++ b/offload/liboffload/CMakeLists.txt
@@ -1,18 +1,13 @@
 add_subdirectory(API)
 
-add_llvm_library(
-  LLVMOffload SHARED
+add_library(LLVMOffload SHARED
   src/OffloadLib.cpp
   src/OffloadImpl.cpp
+)
+add_dependencies(LLVMOffload OffloadAPI PluginErrcodes)
 
-  LINK_COMPONENTS
-  FrontendOpenMP
-  Support
-
-  DEPENDS
-  OffloadAPI
-  PluginErrcodes
-  )
+llvm_map_components_to_libnames(llvm_libs FrontendOpenMP Support)
+target_link_libraries(LLVMOffload PRIVATE ${llvm_libs})
 
 foreach(plugin IN LISTS LIBOMPTARGET_PLUGINS_TO_BUILD)
     target_link_libraries(LLVMOffload PRIVATE omptarget.rtl.${plugin})
diff --git a/offload/libomptarget/CMakeLists.txt b/offload/libomptarget/CMakeLists.txt
index eab7ec3e4df05..4accd05c4341b 100644
--- a/offload/libomptarget/CMakeLists.txt
+++ b/offload/libomptarget/CMakeLists.txt
@@ -4,9 +4,7 @@ if(NOT TARGET "omp")
   message(FATAL_ERROR "Error: omp target dependency of libomptarget not found. Please ensure 'openmp' is on LLVM_ENABLE_RUNTIMES list.")
 endif()
 
-add_llvm_library(omptarget
-  SHARED
-
+add_library(omptarget SHARED
   device.cpp
   interface.cpp
   omptarget.cpp
@@ -21,23 +19,10 @@ add_llvm_library(omptarget
   OpenMP/OMPT/Callback.cpp
 
   KernelLanguage/API.cpp
-
-  ADDITIONAL_HEADER_DIRS
-  ${LIBOMPTARGET_INCLUDE_DIR}
-  ${LIBOMPTARGET_BINARY_INCLUDE_DIR}
-
-  LINK_COMPONENTS
-  FrontendOpenMP
-  Support
-  Object
-
-  LINK_LIBS
-  PUBLIC
-  omp
-
-  NO_INSTALL_RPATH
-  BUILDTREE_ONLY
 )
+
+llvm_map_components_to_libnames(llvm_libs FrontendOpenMP Support Object)
+target_link_libraries(omptarget PRIVATE omp ${llvm_libs})
 target_include_directories(omptarget PRIVATE
   ${LIBOMPTARGET_INCLUDE_DIR} ${LIBOMPTARGET_BINARY_INCLUDE_DIR}
 )
diff --git a/offload/plugins-nextgen/CMakeLists.txt b/offload/plugins-nextgen/CMakeLists.txt
index 5165ed173f19f..72bc1be4219e7 100644
--- a/offload/plugins-nextgen/CMakeLists.txt
+++ b/offload/plugins-nextgen/CMakeLists.txt
@@ -3,43 +3,18 @@ set(common_dir ${CMAKE_CURRENT_SOURCE_DIR}/common)
 set(common_bin_dir ${CMAKE_CURRENT_BINARY_DIR}/common)
 add_subdirectory(common)
 function(add_target_library target_name lib_name)
-  add_llvm_library(${target_name} STATIC
-    LINK_COMPONENTS
-      AggressiveInstCombine
-      Analysis
-      BinaryFormat
-      BitReader
-      BitWriter
-      CodeGen
-      Core
-      Extensions
-      FrontendOffloading
-      InstCombine
-      Instrumentation
-      IPO
-      IRReader
-      Linker
-      MC
-      Object
-      Passes
-      ProfileData
-      Remarks
-      ScalarOpts
-      Support
-      Target
-      TargetParser
-      TransformUtils
-      Vectorize
-
-    NO_INSTALL_RPATH
-    BUILDTREE_ONLY
-  )
+  add_library(${target_name} STATIC)
 
+  llvm_map_components_to_libnames(llvm_libs
+    AggressiveInstCombine Analysis BinaryFormat BitReader BitWriter CodeGen
+    Core Extensions FrontendOffloading InstCombine Instrumentation IPO IRReader
+    Linker MC Object Passes ProfileData Remarks ScalarOpts Support Target
+    TargetParser TransformUtils Vectorize)
   llvm_update_compile_flags(${target_name})
   target_include_directories(${target_name} PUBLIC ${common_dir}/include
                              ${common_bin_dir}/include)
   target_link_libraries(${target_name} PRIVATE
-                        PluginCommon ${OFFLOAD_PTHREAD_LIB})
+                        PluginCommon ${OFFLOAD_PTHREAD_LIB} ${llvm_libs})
 
   target_compile_definitions(${target_name} PRIVATE TARGET_NAME=${lib_name})
   target_compile_definitions(${target_name} PRIVATE

@jhuber6 jhuber6 requested a review from jdoerfert May 19, 2026 19:33
@jhuber6 jhuber6 merged commit 3383f0d into llvm:main May 19, 2026
12 checks passed
suryajasper pushed a commit to suryajasper/rocm-llvm-project that referenced this pull request May 20, 2026
@mgorny
Copy link
Copy Markdown
Member

mgorny commented May 21, 2026

I'm guessing this is what broke building against LLVM dylib:

[104/106] : && /usr/lib/ccache/bin/aarch64-unknown-linux-gnu-clang++ -fPIC -O2 -pipe -fPIC -fno-semantic-interposition -fvisibility-inl
ines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmiss
ing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor 
-Wsuggest-override -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunctio
n-sections -fdata-sections  -shared -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,defs -Wl,-z,nodelete -Wl,-soname,libompt
arget.so -o lib64/libomptarget.so offload/libomptarget/CMakeFiles/omptarget.dir/device.cpp.o offload/libomptarget/CMakeFiles/omptarget.
dir/interface.cpp.o offload/libomptarget/CMakeFiles/omptarget.dir/omptarget.cpp.o offload/libomptarget/CMakeFiles/omptarget.dir/Offload
RTL.cpp.o offload/libomptarget/CMakeFiles/omptarget.dir/LegacyAPI.cpp.o offload/libomptarget/CMakeFiles/omptarget.dir/PluginManager.cpp
.o offload/libomptarget/CMakeFiles/omptarget.dir/DeviceImage.cpp.o offload/libomptarget/CMakeFiles/omptarget.dir/OpenMP/API.cpp.o offlo
ad/libomptarget/CMakeFiles/omptarget.dir/OpenMP/Mapping.cpp.o offload/libomptarget/CMakeFiles/omptarget.dir/OpenMP/InteropAPI.cpp.o off
load/libomptarget/CMakeFiles/omptarget.dir/OpenMP/OMPT/Callback.cpp.o offload/libomptarget/CMakeFiles/omptarget.dir/KernelLanguage/API.
cpp.o  -Wl,-rpath,"\$ORIGIN:/var/tmp/portage/llvm-runtimes/openmp-23.0.0.9999/work/runtimes_build-.arm64/offload/libomptarget/..:/var/t
mp/portage/llvm-runtimes/openmp-23.0.0.9999/work/runtimes_build-.arm64/openmp/runtime/src:"  openmp/runtime/src/libomp.so  -lLLVMFronte
ndOpenMP  /usr/lib/llvm/23/lib64/libLLVMSupport.a  -lLLVMObject  -Wl,--version-script=/var/tmp/portage/llvm-runtimes/openmp-23.0.0.9999
/work/offload/libomptarget/exports  lib64/libomptarget.rtl.host.a  /usr/lib64/libhwloc.so  -lm  /usr/lib/llvm/23/lib64/libLLVMSupport.a
  -lrt  -ldl  -lm  /usr/lib64/libz3.so  /usr/lib64/libz.so  /usr/lib64/libzstd.so  /usr/lib/llvm/23/lib64/libLLVMDemangle.a  -lLLVMAggr
essiveInstCombine  -lLLVMAnalysis  -lLLVMBinaryFormat  -lLLVMBitReader  -lLLVMBitWriter  -lLLVMCodeGen  -lLLVMCore  -lLLVMExtensions  -
lLLVMFrontendOffloading  -lLLVMInstCombine  -lLLVMInstrumentation  -lLLVMipo  -lLLVMIRReader  -lLLVMLinker  -lLLVMMC  -lLLVMObject  -lL
LVMPasses  -lLLVMProfileData  -lLLVMRemarks  -lLLVMScalarOpts  -lLLVMTarget  -lLLVMTargetParser  -lLLVMTransformUtils  -lLLVMVectorize 
&& :
FAILED: [code=1] lib64/libomptarget.so 
: && /usr/lib/ccache/bin/aarch64-unknown-linux-gnu-clang++ -fPIC -O2 -pipe -fPIC -fno-semantic-interposition -fvisibility-inlines-hidde
n -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-
initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-
override -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections
 -fdata-sections  -shared -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,defs -Wl,-z,nodelete -Wl,-soname,libomptarget.so -
o lib64/libomptarget.so offload/libomptarget/CMakeFiles/omptarget.dir/device.cpp.o offload/libomptarget/CMakeFiles/omptarget.dir/interf
ace.cpp.o offload/libomptarget/CMakeFiles/omptarget.dir/omptarget.cpp.o offload/libomptarget/CMakeFiles/omptarget.dir/OffloadRTL.cpp.o 
offload/libomptarget/CMakeFiles/omptarget.dir/LegacyAPI.cpp.o offload/libomptarget/CMakeFiles/omptarget.dir/PluginManager.cpp.o offload
/libomptarget/CMakeFiles/omptarget.dir/DeviceImage.cpp.o offload/libomptarget/CMakeFiles/omptarget.dir/OpenMP/API.cpp.o offload/libompt
arget/CMakeFiles/omptarget.dir/OpenMP/Mapping.cpp.o offload/libomptarget/CMakeFiles/omptarget.dir/OpenMP/InteropAPI.cpp.o offload/libom
ptarget/CMakeFiles/omptarget.dir/OpenMP/OMPT/Callback.cpp.o offload/libomptarget/CMakeFiles/omptarget.dir/KernelLanguage/API.cpp.o  -Wl,-rpath,"\$ORIGIN:/var/tmp/portage/llvm-runtimes/openmp-23.0.0.9999/work/runtimes_build-.arm64/offload/libomptarget/..:/var/tmp/portage/llvm-runtimes/openmp-23.0.0.9999/work/runtimes_build-.arm64/openmp/runtime/src:"  openmp/runtime/src/libomp.so  -lLLVMFrontendOpenMP  
/usr/lib/llvm/23/lib64/libLLVMSupport.a  -lLLVMObject  -Wl,--version-script=/var/tmp/portage/llvm-runtimes/openmp-23.0.0.9999/work/offl
oad/libomptarget/exports  lib64/libomptarget.rtl.host.a  /usr/lib64/libhwloc.so  -lm  /usr/lib/llvm/23/lib64/libLLVMSupport.a  -lrt  -ldl  -lm  /usr/lib64/libz3.so  /usr/lib64/libz.so  /usr/lib64/libzstd.so  /usr/lib/llvm/23/lib64/libLLVMDemangle.a  -lLLVMAggressiveInst
Combine  -lLLVMAnalysis  -lLLVMBinaryFormat  -lLLVMBitReader  -lLLVMBitWriter  -lLLVMCodeGen  -lLLVMCore  -lLLVMExtensions  -lLLVMFront
endOffloading  -lLLVMInstCombine  -lLLVMInstrumentation  -lLLVMipo  -lLLVMIRReader  -lLLVMLinker  -lLLVMMC  -lLLVMObject  -lLLVMPasses 
 -lLLVMProfileData  -lLLVMRemarks  -lLLVMScalarOpts  -lLLVMTarget  -lLLVMTargetParser  -lLLVMTransformUtils  -lLLVMVectorize && :
/usr/aarch64-unknown-linux-gnu/binutils-bin/2.46.0/ld.bfd: cannot find -lLLVMFrontendOpenMP: No such file or directory
/usr/aarch64-unknown-linux-gnu/binutils-bin/2.46.0/ld.bfd: cannot find -lLLVMObject: No such file or directory
aarch64-unknown-linux-gnu-clang++: error: linker command failed with exit code 1 (use -v to see invocation)
[105/106] : && /usr/lib/ccache/bin/aarch64-unknown-linux-gnu-clang++ -fPIC -O2 -pipe -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmiss
ing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor 
-Wsuggest-override -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunctio
n-sections -fdata-sections  -shared -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,defs -Wl,-z,nodelete -Wl,-soname,libLLVM
Offload.so -o lib64/libLLVMOffload.so offload/liboffload/CMakeFiles/LLVMOffload.dir/src/OffloadLib.cpp.o offload/liboffload/CMakeFiles/
LLVMOffload.dir/src/OffloadImpl.cpp.o  -Wl,-rpath,"\$ORIGIN:/var/tmp/portage/llvm-runtimes/openmp-23.0.0.9999/work/runtimes_build-.arm6
4/offload/liboffload/..:"  -lLLVMFrontendOpenMP  /usr/lib/llvm/23/lib64/libLLVMSupport.a  lib64/libomptarget.rtl.host.a  -Wl,--version-
script=/var/tmp/portage/llvm-runtimes/openmp-23.0.0.9999/work/offload/liboffload/exports  /usr/lib/llvm/23/lib64/libLLVMSupport.a  -lrt  -ldl  -lm  /usr/lib64/libz3.so  /usr/lib64/libz.so  /usr/lib64/libzstd.so  /usr/lib/llvm/23/lib64/libLLVMDemangle.a  -lLLVMAggressive
InstCombine  -lLLVMAnalysis  -lLLVMBinaryFormat  -lLLVMBitReader  -lLLVMBitWriter  -lLLVMCodeGen  -lLLVMCore  -lLLVMExtensions  -lLLVMF
rontendOffloading  -lLLVMInstCombine  -lLLVMInstrumentation  -lLLVMipo  -lLLVMIRReader  -lLLVMLinker  -lLLVMMC  -lLLVMObject  -lLLVMPas
ses  -lLLVMProfileData  -lLLVMRemarks  -lLLVMScalarOpts  -lLLVMTarget  -lLLVMTargetParser  -lLLVMTransformUtils  -lLLVMVectorize && :
FAILED: [code=1] lib64/libLLVMOffload.so 
: && /usr/lib/ccache/bin/aarch64-unknown-linux-gnu-clang++ -fPIC -O2 -pipe -fPIC -fno-semantic-interposition -fvisibility-inlines-hidde
n -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections  -shared -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,defs -Wl,-z,nodelete -Wl,-soname,libLLVMOffload.so
 -o lib64/libLLVMOffload.so offload/liboffload/CMakeFiles/LLVMOffload.dir/src/OffloadLib.cpp.o offload/liboffload/CMakeFiles/LLVMOffloa
d.dir/src/OffloadImpl.cpp.o  -Wl,-rpath,"\$ORIGIN:/var/tmp/portage/llvm-runtimes/openmp-23.0.0.9999/work/runtimes_build-.arm64/offload/
liboffload/..:"  -lLLVMFrontendOpenMP  /usr/lib/llvm/23/lib64/libLLVMSupport.a  lib64/libomptarget.rtl.host.a  -Wl,--version-script=/va
r/tmp/portage/llvm-runtimes/openmp-23.0.0.9999/work/offload/liboffload/exports  /usr/lib/llvm/23/lib64/libLLVMSupport.a  -lrt  -ldl  -l
m  /usr/lib64/libz3.so  /usr/lib64/libz.so  /usr/lib64/libzstd.so  /usr/lib/llvm/23/lib64/libLLVMDemangle.a  -lLLVMAggressiveInstCombin
e  -lLLVMAnalysis  -lLLVMBinaryFormat  -lLLVMBitReader  -lLLVMBitWriter  -lLLVMCodeGen  -lLLVMCore  -lLLVMExtensions  -lLLVMFrontendOffloading  -lLLVMInstCombine  -lLLVMInstrumentation  -lLLVMipo  -lLLVMIRReader  -lLLVMLinker  -lLLVMMC  -lLLVMObject  -lLLVMPasses  -lLLV
MProfileData  -lLLVMRemarks  -lLLVMScalarOpts  -lLLVMTarget  -lLLVMTargetParser  -lLLVMTransformUtils  -lLLVMVectorize && :
/usr/aarch64-unknown-linux-gnu/binutils-bin/2.46.0/ld.bfd: cannot find -lLLVMFrontendOpenMP: No such file or directory
aarch64-unknown-linux-gnu-clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

Of course, none of them component libraries should have been tried here.

Full log: log.txt

@jhuber6
Copy link
Copy Markdown
Contributor Author

jhuber6 commented May 21, 2026

I'm guessing this is what broke building against LLVM dylib:

I have a fix waiting review #198955

xintin pushed a commit to xintin/llvm-project that referenced this pull request May 22, 2026
…lvm#198622)

Summary:
The problem is that we do not correctly set the build directory output
for offload/. Normally, it's supposed to mirror the install pattern.
This is because we both have variants and so people can use the compiler
from the build directory.

Currently, if you build more than one variant of the offload/ library
they will clobber each-other in `<build>/lib/`, so no cross compiling
allowed. Additionally, these will not be usable in the build directory
because the compiler will think that they are in the triple directory
when they are not.

Relatively simple fix, just copy-paste the pattern every other runtime
uses and then remove the implicit handling we get from
`add_llvm_libraries`. The only this it did for us was automatically map
component names to the libraries, which is easy enough to do.
shiltian pushed a commit that referenced this pull request May 24, 2026
PR #198622, which landed as 3383f0d, causes 272 `libomptarget ::
nvptx64-nvidia-cuda` test fails on my system with:

```
clang: error: bitcode library '/home/jdenny/llvm/build/\./lib/x86_64-unknown-linux-gnu/nvptx64-nvidia-cuda' does not exist
```

This patch fixes that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants