Skip to content

Commit 0bcc57c

Browse files
committed
llvm: Do not use cmake infra to detect libzstd
OE's version is build using plain make not cmake as a result we do not have the cmake support files and this probing method can get this info from build host and force linking with libzstd from /usr/lib which is not what we want when cross building. Fixes errors building llvm-config like /usr/lib/libzstd.so.1.5.2: error adding symbols: file in wrong format | clang-15: error: linker command failed with exit code 1 (use -v to see invocation) | ninja: build stopped: subcommand failed. Upstream-Status: Inappropriate [OE-Specific] Signed-off-by: Khem Raj <[email protected]>
1 parent 1e6ff46 commit 0bcc57c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/Support/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ if (HAS_WERROR_GLOBAL_CTORS)
2222
endif()
2323

2424
if(LLVM_ENABLE_ZLIB)
25-
list(APPEND imported_libs ZLIB::ZLIB)
25+
list(APPEND imported_libs z)
2626
endif()
2727

2828
if(LLVM_ENABLE_ZSTD)
@@ -34,7 +34,7 @@ if(LLVM_ENABLE_ZSTD)
3434
endif()
3535

3636
if(LLVM_ENABLE_ZSTD)
37-
list(APPEND imported_libs ${zstd_target})
37+
list(APPEND imported_libs zstd)
3838
endif()
3939

4040
if( WIN32 )
@@ -339,7 +339,7 @@ if(LLVM_ENABLE_ZLIB)
339339
get_property(zlib_library TARGET ZLIB::ZLIB PROPERTY LOCATION)
340340
endif()
341341
get_library_name(${zlib_library} zlib_library)
342-
set(llvm_system_libs ${llvm_system_libs} "${zlib_library}")
342+
set(llvm_system_libs ${llvm_system_libs} z)
343343
endif()
344344

345345
if(LLVM_ENABLE_ZSTD)
@@ -353,7 +353,7 @@ if(LLVM_ENABLE_ZSTD)
353353
endif()
354354
if (zstd_target STREQUAL zstd::libzstd_shared)
355355
get_library_name(${zstd_library} zstd_library)
356-
set(llvm_system_libs ${llvm_system_libs} "${zstd_library}")
356+
set(llvm_system_libs ${llvm_system_libs} zstd)
357357
else()
358358
set(llvm_system_libs ${llvm_system_libs} "${zstd_STATIC_LIBRARY}")
359359
endif()

0 commit comments

Comments
 (0)