Opened 2 months ago

Closed 2 months ago

#70404 closed defect (fixed)

llvm-18: libLLVM.dylib not loaded at runtime

Reported by: sletz (Stéphane Letz) Owned by:
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: cjones051073 (Chris Jones), jeremyhu (Jeremy Huddleston Sequoia)
Port: llvm-18 llvm-devel

Description (last modified by ryandesign (Ryan Carsten Schmidt))

My project using llvm-18 correctly build but I get this error at runtime:

Library not loaded: '@rpath/libLLVM.dylib'

The same happens with llvm-devel and the project is correctly working with llvm-17.

Change History (27)

comment:1 Changed 2 months ago by jmroot (Joshua Root)

Cc: cjones051073 jeremyhu added
Keywords: llvm-18 removed
Port: llvm-18 llvm-devel added
Summary: Link with with llvm-18llvm-18: libLLVM.dylib not loaded at runtime

comment:2 Changed 2 months ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)

The way that rpath works on macOS is that when you link with a library that uses rpath, you have to supply a linker flag to tell it what @rpath should expand to. Looks like our llvm ports have been using @rpath for libLLVM.dylib for a long time, so if old versions worked without you having to specify the rpath manually, maybe that's something that can be fixed in the new llvm versions. Until then, you can do it manually, for example by using the linker flag -rpath /opt/local/libexec/llvm-18/lib.

comment:3 Changed 2 months ago by sletz (Stéphane Letz)

Why not adding the appropriate -rpath XX in llvm-config ?

comment:4 Changed 2 months ago by cjones051073 (Chris Jones)

Please supply complete build logs showing the error. Without them its very hard to comment further.

comment:5 Changed 2 months ago by cjones051073 (Chris Jones)

Priority: HighNormal

comment:6 Changed 2 months ago by cjones051073 (Chris Jones)

On a quick look I see nothing different about libLLVM.dylib between version s 17 and 18

Larissa ~/Projects/MacPorts/ports > otool -L /opt/local/libexec/llvm-17/lib/libLLVM.dylib                          
/opt/local/libexec/llvm-17/lib/libLLVM.dylib:
	@rpath/libLLVM.dylib (compatibility version 1.0.0, current version 17.0.6)
	/opt/local/lib/libffi.8.dylib (compatibility version 10.0.0, current version 10.4.0)
	/opt/local/lib/libedit.0.dylib (compatibility version 1.0.0, current version 1.72.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1345.100.2)
	/opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.3.1)
	/opt/local/lib/libzstd.1.dylib (compatibility version 1.0.0, current version 1.5.5)
	/opt/local/lib/libncurses.6.dylib (compatibility version 6.0.0, current version 6.0.0)
	/opt/local/lib/libxml2.2.dylib (compatibility version 15.0.0, current version 15.5.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1700.255.0)
Larissa ~/Projects/MacPorts/ports > otool -l /opt/local/libexec/llvm-17/lib/libLLVM.dylib | grep LC_RPATH -B 1 -A 2
Load command 20
          cmd LC_RPATH
      cmdsize 32
         path @loader_path/../lib (offset 12)
Larissa ~/Projects/MacPorts/ports > otool -L /opt/local/libexec/llvm-18/lib/libLLVM.dylib                         
/opt/local/libexec/llvm-18/lib/libLLVM.dylib:
	@rpath/libLLVM.dylib (compatibility version 1.0.0, current version 18.1.8)
	/opt/local/lib/libffi.8.dylib (compatibility version 10.0.0, current version 10.4.0)
	/opt/local/lib/libedit.0.dylib (compatibility version 1.0.0, current version 1.73.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1345.100.2)
	/opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.3.1)
	/opt/local/lib/libzstd.1.dylib (compatibility version 1.0.0, current version 1.5.6)
	/opt/local/lib/libncurses.6.dylib (compatibility version 6.0.0, current version 6.0.0)
	/opt/local/lib/libxml2.2.dylib (compatibility version 16.0.0, current version 16.0.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1700.255.0)
Larissa ~/Projects/MacPorts/ports > otool -l /opt/local/libexec/llvm-18/lib/libLLVM.dylib | grep LC_RPATH -B 1 -A 2
Load command 20
          cmd LC_RPATH
      cmdsize 32
         path @loader_path/../lib (offset 12)

sletz - In order for anyone to really help you here you are going to need to provide

  1. Complete build logs, showing the full compilation command and flags and all the errors you get.
  2. Steps to reproduce, if this is not part of a port build.

comment:7 Changed 2 months ago by cjones051073 (Chris Jones)

In addition, can you also run otool on the binary giving you the error, using the two different sets of flags in the example above, and post what you get. Please do this both for when the binary is built with clang 17 and clang 18

comment:8 Changed 2 months ago by sletz (Stéphane Letz)

This project: https://github.com/grame-cncm/faust

1) install llvm-18

2) make developer

3) link step of the "faust" binary : https://gist.github.com/sletz/57615fcaf886b972449e8bf28cb2e362

4) runtime error when doing : build/bin/faust

build/bin/faust dyld[74799]: Library not loaded: '@rpath/libLLVM.dylib'

Referenced from: '/Users/letz/Developpements/faust/build/bin/faust' Reason: tried: '/Users/letz/Qt6/6.2.0/macos/lib/libLLVM.dylib' (no such file), '/usr/local/cuda/lib/libLLVM.dylib' (no such file), '/libLLVM.dylib' (no such file), '/opt/local/lib/libLLVM.dylib' (no such file), '/opt/local/lib/libLLVM.dylib' (no such file), '/usr/local/lib/libLLVM.dylib' (no such file), '/usr/lib/libLLVM.dylib' (no such file)

5) otool -L build/bin/faust build/bin/faust:

@rpath/libLLVM.dylib (compatibility version 1.0.0, current version 18.1.8) /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.36.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)

Version 1, edited 2 months ago by sletz (Stéphane Letz) (previous) (next) (diff)

comment:9 Changed 2 months ago by sletz (Stéphane Letz)

  1. With llvm-17: https://gist.github.com/sletz/52a658344df142b5374246eec7cbbe79
  2. otool -L build/bin/faust
    build/bin/faust:
    	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
    	/opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.3.1)
    	/opt/local/lib/libzstd.1.dylib (compatibility version 1.0.0, current version 1.5.6)
    	/opt/local/lib/libncurses.6.dylib (compatibility version 6.0.0, current version 6.0.0)
    	/opt/local/lib/libxml2.2.dylib (compatibility version 16.0.0, current version 16.2.0)
    	@rpath/libc++.1.dylib (compatibility version 1.0.0, current version 1.0.0)
    

==> So I understand that the link with LLVM is static with llvm-17, and dynamic with llvm-18 ?

Last edited 2 months ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:10 Changed 2 months ago by cjones051073 (Chris Jones)

I don't really see anything here that points to an issue on the MacPorts side. If there is an issue it is either 1. with faust or 2. something related to what is different in LLVM 18 compared to LLVM 17 that causes problems with faust's build system.

Either way, you need to discuss this with the faust developers, as I don't see anything wrong here (yet...) from the 'MacPorts' side of things

comment:11 Changed 2 months ago by cjones051073 (Chris Jones)

b.t.w. Could you please also post the *complete* output of *everything* you get when you run make developer. I mean everything. I specifically want to see how faust configures itself.

when I do it I get this

Larissa ~/Projects/faust > make developer
if test -d .git; then git submodule update --init --recursive; fi
Submodule 'architecture/android/app/oboe' (https://github.com/google/oboe) registered for path 'architecture/android/app/oboe'
Submodule 'architecture/max-msp/py2max' (https://github.com/shakfu/py2max.git) registered for path 'architecture/max-msp/py2max'
Submodule 'architecture/smartKeyboard/android/app/oboe' (https://github.com/google/oboe) registered for path 'architecture/smartKeyboard/android/app/oboe'
Submodule 'libraries' (https://github.com/grame-cncm/faustlibraries.git) registered for path 'libraries'
Submodule 'tools/faust2ck' (https://github.com/ccrma/faust2ck) registered for path 'tools/faust2ck'
Submodule 'tools/physicalModeling/mesh2faust/spectra' (https://github.com/yixuan/spectra.git) registered for path 'tools/physicalModeling/mesh2faust/spectra'
Cloning into '/Users/chris/Projects/faust/architecture/android/app/oboe'...
Cloning into '/Users/chris/Projects/faust/architecture/max-msp/py2max'...
Cloning into '/Users/chris/Projects/faust/architecture/smartKeyboard/android/app/oboe'...
Cloning into '/Users/chris/Projects/faust/libraries'...
Cloning into '/Users/chris/Projects/faust/tools/faust2ck'...
Cloning into '/Users/chris/Projects/faust/tools/physicalModeling/mesh2faust/spectra'...
Submodule path 'architecture/android/app/oboe': checked out '7146098e03573eeaf6ad48176ab12b37fec18237'
Submodule path 'architecture/max-msp/py2max': checked out '3aaa8cad3f2d777a5e586c8a3b8063e1e9092c5b'
Submodule path 'architecture/smartKeyboard/android/app/oboe': checked out '7146098e03573eeaf6ad48176ab12b37fec18237'
Submodule path 'libraries': checked out '58f6796286bef9dfbf3d5cc976f7d46a5ed2ab70'
Submodule path 'tools/faust2ck': checked out 'db879cb88158a2c708f0d1159cddc376ce65b9bd'
Submodule path 'tools/physicalModeling/mesh2faust/spectra': checked out '8c7242e08f0fb7f6a0022cfe232e3dc5b5bd4eb4'
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C build cmake BACKENDS=all.cmake TARGETS=developer.cmake
mkdir faustdir
cd faustdir && /opt/local/bin/cmake -C ../backends/all.cmake -C ../targets/developer.cmake -DCMAKE_BUILD_TYPE=Release "-DWORKLET=off" -DINCLUDE_LLVM=OFF -DUSE_LLVM_CONFIG=ON -DLLVM_PACKAGE_VERSION= -DLLVM_LIBS="" -DLLVM_LIB_DIR="" -DLLVM_INCLUDE_DIRS="" -DLLVM_DEFINITIONS="" -DLLVM_LD_FLAGS=""  -DLIBSDIR=lib -DBUILD_HTTP_STATIC=OFF -G 'Unix Makefiles' ..
loading initial cache file ../backends/all.cmake
loading initial cache file ../targets/developer.cmake
-- The C compiler identification is AppleClang 15.0.0.15000309
-- The CXX compiler identification is AppleClang 15.0.0.15000309
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring version 2.74.9
CMake Error at misc/llvm.cmake:103 (message):
  Cannot find program llvm-config (llvm-config or derived expected)
Call Stack (most recent call first):
  CMakeLists.txt:93 (llvm_config)


-- Configuring incomplete, errors occurred!
make[1]: *** [cmake] Error 1
make: *** [developer] Error 2

which is expected as we do not provide by default a llvm-config command in the default PATH in MacPorts. These are the versions that each of the llvm versions provides

Larissa ~/Projects/MacPorts/ports > port contents llvm-18 | grep llvm-config
  /opt/local/bin/llvm-config-mp-18
  /opt/local/libexec/llvm-18/bin/llvm-config
  /opt/local/libexec/llvm-18/include/llvm/Config/llvm-config.h
Larissa ~/Projects/MacPorts/ports > port contents llvm-17 | grep llvm-config
  /opt/local/bin/llvm-config-mp-17
  /opt/local/libexec/llvm-17/bin/llvm-config
  /opt/local/libexec/llvm-17/include/llvm/Config/llvm-config.h

It is up to users to decide which they wish to use and configure their builds appropriately to use the correct version.

My bet is whatever llvm-config your build is finding, it probably isn't one from MacPorts, and also quite likely not the correct version for LLVM 17 or 18.

comment:12 in reply to:  9 Changed 2 months ago by ryandesign (Ryan Carsten Schmidt)

Replying to sletz:

==> So I understand that the link with LLVM is static with llvm-17, and dynamic with llvm-18 ?

That is not the conclusion I reach.

With your llvm 18 log, I see -L/opt/local/libexec/llvm-18/lib and -lLLVM-18 hence libLLVM gets linked in and somebody has to tell the linker what @rpath should expand to (namely /opt/local/libexec/llvm-18/lib).

With your llvm 17 log, I see -L/opt/local/libexec/llvm-17/lib but no -LLLVM-17 hence it is not linked in hence there is no problem with its rpath.

By the way we do have a very out-of-date port for faust that I have neglected for years. If you or anybody wants to help update it that would be great.

comment:13 Changed 2 months ago by cjones051073 (Chris Jones)

Yes, I had also noticed that LLVM-18 appears to include this versioned sym link to libLLVM.dylib, that is not there with LLVM-17 (or 16 for that matter either)

Larissa ~/Projects/MacPorts/ports > ls -lth /opt/local/libexec/llvm-17/lib/libLLVM*.dylib
-rwxr-xr-x  1 root  admin   117M 11 Mar 14:15 /opt/local/libexec/llvm-17/lib/libLLVM.dylib
Larissa ~/Projects/MacPorts/ports > ls -lth /opt/local/libexec/llvm-18/lib/libLLVM*.dylib
lrwxr-xr-x  1 root  admin    13B 24 Jun 11:07 /opt/local/libexec/llvm-18/lib/libLLVM-18.dylib -> libLLVM.dylib
-rwxr-xr-x  1 root  admin   116M 24 Jun 11:06 /opt/local/libexec/llvm-18/lib/libLLVM.dylib

I am not aware of anything specifically on the MacPorts side, in the port file for LLVM that is doing this, so I presumed it was something new, intentional, on the LLVM side with version 18.

If this is what is causing problems with faust, then this is still an issue on the faust side with how its build is being configured, I would say.

comment:14 Changed 2 months ago by cjones051073 (Chris Jones)

I really want to see what llvm-config the build is picking up, as I strongly suspect it is likely not the correct one for the MacPorts LLVM installation (17 or 18) being targeted.

comment:15 Changed 2 months ago by sletz (Stéphane Letz)

which llvm-config

/opt/local/bin/llvm-config

comment:16 in reply to:  15 Changed 2 months ago by cjones051073 (Chris Jones)

Replying to sletz:

which llvm-config

/opt/local/bin/llvm-config

OK, so I guess you use 'port select llvm' ?

Do you correctly change that for when you switch between LLVm 17 and 18 ?

comment:17 Changed 2 months ago by cjones051073 (Chris Jones)

b.t.w. this likely explains the linkage differences between LLVM 17 and 18

Larissa ~/Projects/MacPorts/ports > /opt/local/libexec/llvm-18/bin/llvm-config --libs
-lLLVM-18
Larissa ~/Projects/MacPorts/ports > /opt/local/libexec/llvm-17/bin/llvm-config --libs
-lLLVMWindowsManifest -lLLVMXRay -lLLVMLibDriver -lLLVMDlltoolDriver -lLLVMCoverage -lLLVMLineEditor -lLLVMXCoreDisassembler -lLLVMXCoreCodeGen -lLLVMXCoreDesc -lLLVMXCoreInfo -lLLVMX86TargetMCA -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMX86Desc -lLLVMX86Info -lLLVMWebAssemblyDisassembler -lLLVMWebAssemblyAsmParser -lLLVMWebAssemblyCodeGen -lLLVMWebAssemblyUtils -lLLVMWebAssemblyDesc -lLLVMWebAssemblyInfo -lLLVMVEDisassembler -lLLVMVEAsmParser -lLLVMVECodeGen -lLLVMVEDesc -lLLVMVEInfo -lLLVMSystemZDisassembler -lLLVMSystemZAsmParser -lLLVMSystemZCodeGen -lLLVMSystemZDesc -lLLVMSystemZInfo -lLLVMSparcDisassembler -lLLVMSparcAsmParser -lLLVMSparcCodeGen -lLLVMSparcDesc -lLLVMSparcInfo -lLLVMRISCVTargetMCA -lLLVMRISCVDisassembler -lLLVMRISCVAsmParser -lLLVMRISCVCodeGen -lLLVMRISCVDesc -lLLVMRISCVInfo -lLLVMPowerPCDisassembler -lLLVMPowerPCAsmParser -lLLVMPowerPCCodeGen -lLLVMPowerPCDesc -lLLVMPowerPCInfo -lLLVMNVPTXCodeGen -lLLVMNVPTXDesc -lLLVMNVPTXInfo -lLLVMMSP430Disassembler -lLLVMMSP430AsmParser -lLLVMMSP430CodeGen -lLLVMMSP430Desc -lLLVMMSP430Info -lLLVMMipsDisassembler -lLLVMMipsAsmParser -lLLVMMipsCodeGen -lLLVMMipsDesc -lLLVMMipsInfo -lLLVMLoongArchDisassembler -lLLVMLoongArchAsmParser -lLLVMLoongArchCodeGen -lLLVMLoongArchDesc -lLLVMLoongArchInfo -lLLVMLanaiDisassembler -lLLVMLanaiCodeGen -lLLVMLanaiAsmParser -lLLVMLanaiDesc -lLLVMLanaiInfo -lLLVMHexagonDisassembler -lLLVMHexagonCodeGen -lLLVMHexagonAsmParser -lLLVMHexagonDesc -lLLVMHexagonInfo -lLLVMBPFDisassembler -lLLVMBPFAsmParser -lLLVMBPFCodeGen -lLLVMBPFDesc -lLLVMBPFInfo -lLLVMAVRDisassembler -lLLVMAVRAsmParser -lLLVMAVRCodeGen -lLLVMAVRDesc -lLLVMAVRInfo -lLLVMARMDisassembler -lLLVMARMAsmParser -lLLVMARMCodeGen -lLLVMARMDesc -lLLVMARMUtils -lLLVMARMInfo -lLLVMAMDGPUTargetMCA -lLLVMAMDGPUDisassembler -lLLVMAMDGPUAsmParser -lLLVMAMDGPUCodeGen -lLLVMAMDGPUDesc -lLLVMAMDGPUUtils -lLLVMAMDGPUInfo -lLLVMAArch64Disassembler -lLLVMAArch64AsmParser -lLLVMAArch64CodeGen -lLLVMAArch64Desc -lLLVMAArch64Utils -lLLVMAArch64Info -lLLVMOrcJIT -lLLVMWindowsDriver -lLLVMMCJIT -lLLVMJITLink -lLLVMInterpreter -lLLVMExecutionEngine -lLLVMRuntimeDyld -lLLVMOrcTargetProcess -lLLVMOrcShared -lLLVMDWP -lLLVMDebugInfoLogicalView -lLLVMDebugInfoGSYM -lLLVMOption -lLLVMObjectYAML -lLLVMObjCopy -lLLVMMCA -lLLVMMCDisassembler -lLLVMLTO -lLLVMCFGuard -lLLVMFrontendOpenACC -lLLVMFrontendHLSL -lLLVMExtensions -lPolly -lPollyISL -lLLVMPasses -lLLVMCoroutines -lLLVMipo -lLLVMInstrumentation -lLLVMVectorize -lLLVMLinker -lLLVMFrontendOpenMP -lLLVMDWARFLinkerParallel -lLLVMDWARFLinker -lLLVMGlobalISel -lLLVMMIRParser -lLLVMAsmPrinter -lLLVMSelectionDAG -lLLVMCodeGen -lLLVMTarget -lLLVMObjCARCOpts -lLLVMCodeGenTypes -lLLVMIRPrinter -lLLVMInterfaceStub -lLLVMFileCheck -lLLVMFuzzMutate -lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMTransformUtils -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMFuzzerCLI -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMTableGen -lLLVMSupport -lLLVMDemangle

comment:18 Changed 2 months ago by cjones051073 (Chris Jones)

Larissa ~/Projects/MacPorts/ports > /opt/local/libexec/llvm-17/bin/llvm-config --libs --link-shared
llvm-config: error: libLLVM-17.dylib is missing
Larissa ~/Projects/MacPorts/ports > /opt/local/libexec/llvm-17/bin/llvm-config --libs --link-static
-lLLVMWindowsManifest -lLLVMXRay -lLLVMLibDriver -lLLVMDlltoolDriver -lLLVMCoverage -lLLVMLineEditor -lLLVMXCoreDisassembler -lLLVMXCoreCodeGen -lLLVMXCoreDesc -lLLVMXCoreInfo -lLLVMX86TargetMCA -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMX86Desc -lLLVMX86Info -lLLVMWebAssemblyDisassembler -lLLVMWebAssemblyAsmParser -lLLVMWebAssemblyCodeGen -lLLVMWebAssemblyUtils -lLLVMWebAssemblyDesc -lLLVMWebAssemblyInfo -lLLVMVEDisassembler -lLLVMVEAsmParser -lLLVMVECodeGen -lLLVMVEDesc -lLLVMVEInfo -lLLVMSystemZDisassembler -lLLVMSystemZAsmParser -lLLVMSystemZCodeGen -lLLVMSystemZDesc -lLLVMSystemZInfo -lLLVMSparcDisassembler -lLLVMSparcAsmParser -lLLVMSparcCodeGen -lLLVMSparcDesc -lLLVMSparcInfo -lLLVMRISCVTargetMCA -lLLVMRISCVDisassembler -lLLVMRISCVAsmParser -lLLVMRISCVCodeGen -lLLVMRISCVDesc -lLLVMRISCVInfo -lLLVMPowerPCDisassembler -lLLVMPowerPCAsmParser -lLLVMPowerPCCodeGen -lLLVMPowerPCDesc -lLLVMPowerPCInfo -lLLVMNVPTXCodeGen -lLLVMNVPTXDesc -lLLVMNVPTXInfo -lLLVMMSP430Disassembler -lLLVMMSP430AsmParser -lLLVMMSP430CodeGen -lLLVMMSP430Desc -lLLVMMSP430Info -lLLVMMipsDisassembler -lLLVMMipsAsmParser -lLLVMMipsCodeGen -lLLVMMipsDesc -lLLVMMipsInfo -lLLVMLoongArchDisassembler -lLLVMLoongArchAsmParser -lLLVMLoongArchCodeGen -lLLVMLoongArchDesc -lLLVMLoongArchInfo -lLLVMLanaiDisassembler -lLLVMLanaiCodeGen -lLLVMLanaiAsmParser -lLLVMLanaiDesc -lLLVMLanaiInfo -lLLVMHexagonDisassembler -lLLVMHexagonCodeGen -lLLVMHexagonAsmParser -lLLVMHexagonDesc -lLLVMHexagonInfo -lLLVMBPFDisassembler -lLLVMBPFAsmParser -lLLVMBPFCodeGen -lLLVMBPFDesc -lLLVMBPFInfo -lLLVMAVRDisassembler -lLLVMAVRAsmParser -lLLVMAVRCodeGen -lLLVMAVRDesc -lLLVMAVRInfo -lLLVMARMDisassembler -lLLVMARMAsmParser -lLLVMARMCodeGen -lLLVMARMDesc -lLLVMARMUtils -lLLVMARMInfo -lLLVMAMDGPUTargetMCA -lLLVMAMDGPUDisassembler -lLLVMAMDGPUAsmParser -lLLVMAMDGPUCodeGen -lLLVMAMDGPUDesc -lLLVMAMDGPUUtils -lLLVMAMDGPUInfo -lLLVMAArch64Disassembler -lLLVMAArch64AsmParser -lLLVMAArch64CodeGen -lLLVMAArch64Desc -lLLVMAArch64Utils -lLLVMAArch64Info -lLLVMOrcJIT -lLLVMWindowsDriver -lLLVMMCJIT -lLLVMJITLink -lLLVMInterpreter -lLLVMExecutionEngine -lLLVMRuntimeDyld -lLLVMOrcTargetProcess -lLLVMOrcShared -lLLVMDWP -lLLVMDebugInfoLogicalView -lLLVMDebugInfoGSYM -lLLVMOption -lLLVMObjectYAML -lLLVMObjCopy -lLLVMMCA -lLLVMMCDisassembler -lLLVMLTO -lLLVMCFGuard -lLLVMFrontendOpenACC -lLLVMFrontendHLSL -lLLVMExtensions -lPolly -lPollyISL -lLLVMPasses -lLLVMCoroutines -lLLVMipo -lLLVMInstrumentation -lLLVMVectorize -lLLVMLinker -lLLVMFrontendOpenMP -lLLVMDWARFLinkerParallel -lLLVMDWARFLinker -lLLVMGlobalISel -lLLVMMIRParser -lLLVMAsmPrinter -lLLVMSelectionDAG -lLLVMCodeGen -lLLVMTarget -lLLVMObjCARCOpts -lLLVMCodeGenTypes -lLLVMIRPrinter -lLLVMInterfaceStub -lLLVMFileCheck -lLLVMFuzzMutate -lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMTransformUtils -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMFuzzerCLI -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMTableGen -lLLVMSupport -lLLVMDemangle
Larissa ~/Projects/MacPorts/ports > /opt/local/libexec/llvm-18/bin/llvm-config --libs --link-shared
-lLLVM-18
Larissa ~/Projects/MacPorts/ports > /opt/local/libexec/llvm-18/bin/llvm-config --libs --link-static
-lLLVMWindowsManifest -lLLVMXRay -lLLVMLibDriver -lLLVMDlltoolDriver -lLLVMTextAPIBinaryReader -lLLVMCoverage -lLLVMLineEditor -lLLVMXCoreDisassembler -lLLVMXCoreCodeGen -lLLVMXCoreDesc -lLLVMXCoreInfo -lLLVMX86TargetMCA -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMX86Desc -lLLVMX86Info -lLLVMWebAssemblyDisassembler -lLLVMWebAssemblyAsmParser -lLLVMWebAssemblyCodeGen -lLLVMWebAssemblyUtils -lLLVMWebAssemblyDesc -lLLVMWebAssemblyInfo -lLLVMVEDisassembler -lLLVMVEAsmParser -lLLVMVECodeGen -lLLVMVEDesc -lLLVMVEInfo -lLLVMSystemZDisassembler -lLLVMSystemZAsmParser -lLLVMSystemZCodeGen -lLLVMSystemZDesc -lLLVMSystemZInfo -lLLVMSparcDisassembler -lLLVMSparcAsmParser -lLLVMSparcCodeGen -lLLVMSparcDesc -lLLVMSparcInfo -lLLVMRISCVTargetMCA -lLLVMRISCVDisassembler -lLLVMRISCVAsmParser -lLLVMRISCVCodeGen -lLLVMRISCVDesc -lLLVMRISCVInfo -lLLVMPowerPCDisassembler -lLLVMPowerPCAsmParser -lLLVMPowerPCCodeGen -lLLVMPowerPCDesc -lLLVMPowerPCInfo -lLLVMNVPTXCodeGen -lLLVMNVPTXDesc -lLLVMNVPTXInfo -lLLVMMSP430Disassembler -lLLVMMSP430AsmParser -lLLVMMSP430CodeGen -lLLVMMSP430Desc -lLLVMMSP430Info -lLLVMMipsDisassembler -lLLVMMipsAsmParser -lLLVMMipsCodeGen -lLLVMMipsDesc -lLLVMMipsInfo -lLLVMLoongArchDisassembler -lLLVMLoongArchAsmParser -lLLVMLoongArchCodeGen -lLLVMLoongArchDesc -lLLVMLoongArchInfo -lLLVMLanaiDisassembler -lLLVMLanaiCodeGen -lLLVMLanaiAsmParser -lLLVMLanaiDesc -lLLVMLanaiInfo -lLLVMHexagonDisassembler -lLLVMHexagonCodeGen -lLLVMHexagonAsmParser -lLLVMHexagonDesc -lLLVMHexagonInfo -lLLVMBPFDisassembler -lLLVMBPFAsmParser -lLLVMBPFCodeGen -lLLVMBPFDesc -lLLVMBPFInfo -lLLVMAVRDisassembler -lLLVMAVRAsmParser -lLLVMAVRCodeGen -lLLVMAVRDesc -lLLVMAVRInfo -lLLVMARMDisassembler -lLLVMARMAsmParser -lLLVMARMCodeGen -lLLVMARMDesc -lLLVMARMUtils -lLLVMARMInfo -lLLVMAMDGPUTargetMCA -lLLVMAMDGPUDisassembler -lLLVMAMDGPUAsmParser -lLLVMAMDGPUCodeGen -lLLVMAMDGPUDesc -lLLVMAMDGPUUtils -lLLVMAMDGPUInfo -lLLVMAArch64Disassembler -lLLVMAArch64AsmParser -lLLVMAArch64CodeGen -lLLVMAArch64Desc -lLLVMAArch64Utils -lLLVMAArch64Info -lLLVMOrcDebugging -lLLVMOrcJIT -lLLVMWindowsDriver -lLLVMMCJIT -lLLVMJITLink -lLLVMInterpreter -lLLVMExecutionEngine -lLLVMRuntimeDyld -lLLVMOrcTargetProcess -lLLVMOrcShared -lLLVMDWP -lLLVMDebugInfoLogicalView -lLLVMDebugInfoGSYM -lLLVMOption -lLLVMObjectYAML -lLLVMObjCopy -lLLVMMCA -lLLVMMCDisassembler -lLLVMLTO -lLLVMFrontendOpenACC -lLLVMFrontendHLSL -lLLVMFrontendDriver -lLLVMExtensions -lPolly -lPollyISL -lLLVMPasses -lLLVMHipStdPar -lLLVMCoroutines -lLLVMCFGuard -lLLVMipo -lLLVMInstrumentation -lLLVMVectorize -lLLVMLinker -lLLVMFrontendOpenMP -lLLVMFrontendOffloading -lLLVMDWARFLinkerParallel -lLLVMDWARFLinkerClassic -lLLVMDWARFLinker -lLLVMGlobalISel -lLLVMMIRParser -lLLVMAsmPrinter -lLLVMSelectionDAG -lLLVMCodeGen -lLLVMTarget -lLLVMObjCARCOpts -lLLVMCodeGenTypes -lLLVMIRPrinter -lLLVMInterfaceStub -lLLVMFileCheck -lLLVMFuzzMutate -lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMTransformUtils -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMFuzzerCLI -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMTableGen -lLLVMSupport -lLLVMDemangle

I guess faust does not explicitly state if if wants the shared or static lib versions when using llvm-config ?

It would appear if you want to stick with the static libs, then you must use the option --link-static with LLVM 18. With LLVm 17 it is the default.

comment:19 Changed 2 months ago by cjones051073 (Chris Jones)

I was curious as to the difference between LLVM 17 and 18, in particular with regard to the versioned dylib, and found this

https://github.com/llvm/llvm-project/issues/39599

The last few post are the most relevant, and I think confirms this is(was) and LLVM bug fixed in the latest version.

comment:20 Changed 2 months ago by sletz (Stéphane Letz)

OK adding --link-static is needed, but then I get:

Undefined symbols for architecture arm64:

"_ZSTD_compress", referenced from:

so at least -lzstd is missing.

And with LLVM 18: llvm-config --system-libs ==> gives nothing

and with LLVM 17: lvm-config --system-libs ==> gives -lm -lz -lzstd -lcurses -lxml2

So something seems still wrong.

Last edited 2 months ago by sletz (Stéphane Letz) (previous) (diff)

comment:21 Changed 2 months ago by cjones051073 (Chris Jones)

Yes, that indeed seems wrong. I don’t see what we are doing on the MacPorts side to cause this so suggest you file a bug report with LLVM and see what they say.

Last edited 2 months ago by cjones051073 (Chris Jones) (previous) (diff)

comment:22 Changed 2 months ago by cjones051073 (Chris Jones)

I think you need to pass the --link-static option with --system-libs as well for it to work properly

Larissa ~/Projects/MacPorts/ports > /opt/local/libexec/llvm-18/bin/llvm-config --link-static --system-libs
-lm -lz -lzstd -lcurses -lxml2
Larissa ~/Projects/MacPorts/ports > /opt/local/libexec/llvm-18/bin/llvm-config --link-shared --system-libs

Larissa ~/Projects/MacPorts/ports > /opt/local/libexec/llvm-17/bin/llvm-config --link-static --system-libs
-lm -lz -lzstd -lcurses -lxml2
Larissa ~/Projects/MacPorts/ports > /opt/local/libexec/llvm-17/bin/llvm-config --link-shared --system-libs
llvm-config: error: libLLVM-17.dylib is missing

whether or not this behaviour is intentional or not I do not know, but either way its something you should discuss with LLVM directly.

Last edited 2 months ago by cjones051073 (Chris Jones) (previous) (diff)

comment:23 Changed 2 months ago by cjones051073 (Chris Jones)

It would seem this is intentional, see

https://reviews.llvm.org/D27805?id=

Basically , I suggest whenever you use llvm-config inside the faust configuration to always use the static link flag..

comment:24 Changed 2 months ago by sletz (Stéphane Letz)

I use llvm-config with --link-static and --system-libs, but as I said some library ar still missing.

comment:25 Changed 2 months ago by sletz (Stéphane Letz)

Sorry I misread your comment : llvm-config --link-static --system-libs returns : -lm -lz -lzstd -lcurses -lxml2

comment:26 Changed 2 months ago by sletz (Stéphane Letz)

OK, all working now, thanks for your help!

comment:27 Changed 2 months ago by cjones051073 (Chris Jones)

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.