Summary: | devel/llvm*: --link-shared is broken | ||
---|---|---|---|
Product: | Ports & Packages | Reporter: | Jan Beich <jbeich> |
Component: | Individual Port(s) | Assignee: | Brooks Davis <brooks> |
Status: | Closed FIXED | ||
Severity: | Affects Only Me | CC: | bar, brooks, lantw44, val, x11 |
Priority: | --- | Keywords: | needs-patch |
Version: | Latest | Flags: | jbeich:
maintainer-feedback?
(brooks) |
Hardware: | Any | ||
OS: | Any |
Description
Jan Beich
2017-10-23 16:14:20 UTC
Trying to get Meson build working in Mesa git master, same problem. Actually it doesn't use --link-shared, it uses default (which is static for some reason). And even static is broken. Meson doesn't use --system-libs anymore https://github.com/mesonbuild/meson/pull/2443/files but even if I add that back: $ llvm-config50 --system-libs -lrt -l/usr/lib/libexecinfo.so -ltinfo -lpthread -lz -lm /usr/bin/ld: cannot find -l/usr/lib/libexecinfo.so How is *anything* working with such broken llvm-config?? o_0 Just encountered the -l/usr/lib/libexecinfo.so problem when building the Crystal compiler with llvm50. This didn't happen before!! llvm40 worked… Okay I found where the execinfo full path comes from!! https://github.com/Kitware/CMake/blob/40dea7e4b2e1c4518337bba284a233bf6f788a1a/Modules/FindBacktrace.cmake#L75 A quick fix is to change that line to: set(Backtrace_LIBRARY "execinfo") But it seems like having a full path there is correct from CMake's point of view, llvm-config just turns the CMake variables into linker flags wrong. Oh and to fix shared link, add: CMAKE_ARGS+= -DLLVM_LINK_LLVM_DYLIB=ON after: CMAKE_ARGS= -DLLVM_BUILD_LLVM_DYLIB=ON Turns out if you build the monolithic dylib (libLLVM-5.0.so) but don't link it, llvm-config will assume you actually have the tiny separate libs. ¯\_(ツ)_/¯ Looks like we have some awkward workarounds coming… '.replace("-l/usr/lib/libexecinfo.so","-lexecinfo")' @ https://github.com/freebsd/freebsd-ports/commit/6ef96cb042430f118614feefd97a411ba22838a4 This should be fixed on cmake/llvm level, not in llvm consumers… A commit references this bug: Author: brooks Date: Wed Jan 10 01:43:37 UTC 2018 New revision: 458590 URL: https://svnweb.freebsd.org/changeset/ports/458590 Log: Upgrade to 5.0.1. Correct shared linkage with llvm-config50.[0] PR: 223191 [0] Submitted by: greg@unrelenting.technology MFH: 2008Q1 Changes: head/devel/llvm50/Makefile head/devel/llvm50/distinfo A commit references this bug: Author: brooks Date: Wed Jan 10 04:02:22 UTC 2018 New revision: 458596 URL: https://svnweb.freebsd.org/changeset/ports/458596 Log: Correct llvm-config40 output with shared libraries. PR: 223191 Submitted by: greg@unrelenting.technology MFH: 2018Q1 Changes: head/devel/llvm40/Makefile Seems to be fixed other than merging to 2018Q1. I reverted the upgrade, it's unfetchable. (In reply to Antoine Brodin from comment #9) I have it build overnight, fetched at 3:11 AM (CET). I repeated some test with curl -I for every file in distfiles and now it seems still fetchable. (In reply to Antoine Brodin from comment #9) What errors are you seeing? Reopen due to revert in llvm50. A commit references this bug: Author: brooks Date: Wed Jan 10 19:21:50 UTC 2018 New revision: 458680 URL: https://svnweb.freebsd.org/changeset/ports/458680 Log: Upgrade to 5.0.1. Add a local distfile backup while LLVM sorts out mirror issues. Correct shared linkage with llvm-config50.[0] PR: 223191 [0] Submitted by: greg@unrelenting.technology [0] MFH: 2018Q1 Changes: head/devel/llvm50/Makefile head/devel/llvm50/distinfo Recommitted with local dist backup. A commit references this bug: Author: feld Date: Fri Feb 2 10:08:36 UTC 2018 New revision: 460693 URL: https://svnweb.freebsd.org/changeset/ports/460693 Log: MFH: r458590 Upgrade to 5.0.1. Correct shared linkage with llvm-config50.[0] PR: 223191 [0] Submitted by: greg@unrelenting.technology Changes: _U branches/2018Q1/ branches/2018Q1/devel/llvm50/Makefile branches/2018Q1/devel/llvm50/distinfo A commit references this bug: Author: feld Date: Fri Feb 2 10:09:19 UTC 2018 New revision: 460694 URL: https://svnweb.freebsd.org/changeset/ports/460694 Log: MFH: r458596 Correct llvm-config40 output with shared libraries. PR: 223191 Submitted by: greg@unrelenting.technology Changes: _U branches/2018Q1/ branches/2018Q1/devel/llvm40/Makefile Brooks, can you apply the same fix to devel/llvm-devel as well? $ llvm-config-devel --link-shared --libs OMP: Info #270: omp_set_nested routine deprecated, please use omp_set_max_active_levels instead. llvm-config: error: missing: /usr/local/llvm-devel/lib/libLLVMDemangle.so llvm-config: error: missing: /usr/local/llvm-devel/lib/libLLVMSupport.so llvm-config: error: missing: /usr/local/llvm-devel/lib/libLLVMBinaryFormat.so llvm-config: error: missing: /usr/local/llvm-devel/lib/libLLVMRemarks.so llvm-config: error: missing: /usr/local/llvm-devel/lib/libLLVMCore.so [...] Also, Clang has a separate knob as of LLVM 9.0. https://github.com/llvm/llvm-project/commit/2e97d2aa1bd3 A commit references this bug: Author: brooks Date: Mon Jul 15 19:49:52 UTC 2019 New revision: 506706 URL: https://svnweb.freebsd.org/changeset/ports/506706 Log: Upgrade to a newer snapshot. Chase the switch to python 3.6 as default. Enable LLVM_LINK_LLVM_DYLIB and CLANG_LINK_LLVM_DYLIB.[0] PR: 223191 [0] Requested by: jbeich [0] Changes: head/devel/llvm-devel/Makefile head/devel/llvm-devel/Makefile.snapshot head/devel/llvm-devel/distinfo head/devel/llvm-devel/pkg-plist |