summaryrefslogtreecommitdiffstats
path: root/recipes-devtools/clang/clang/0021-llvm-Add-lz-to-linker-cmdline-if-enabled.patch
blob: 8a8d35afcdc70317146f53f1d5050e95029f1681 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From d46267d3d548dbfae92f4958090af4567778c4bd Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 4 Jan 2020 01:00:06 -0800
Subject: [PATCH] llvm: Add -lz to linker cmdline if enabled

cmake's detection mechanism confuses libz.so during cross build and ends
up linking with libz from build host which could be a different
architecture and fail link

see
https://reviews.llvm.org/D70764#1803559

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 llvm/lib/Support/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/Support/CMakeLists.txt b/llvm/lib/Support/CMakeLists.txt
index 26332d4f539..8b58516330b 100644
--- a/llvm/lib/Support/CMakeLists.txt
+++ b/llvm/lib/Support/CMakeLists.txt
@@ -1,5 +1,5 @@
 if(LLVM_ENABLE_ZLIB)
-  set(system_libs ${ZLIB_LIBRARY})
+  set(system_libs z)
 endif()
 
 if( MSVC OR MINGW )