ports/lang/ldc
Dimitry Andric c580801b31 lang/ldc: fix build with LLVM_DEFAULT=19
When building lang/ldc with LLVM_DEFAULT=19, linking ldc-profdata fails with:

  FAILED: bin/ldc-profdata
  : && /usr/local/llvm19/bin/clang++ -O2 -pipe -fPIC -fstack-protector-strong -fno-strict-aliasing -DDMDV2 -O2 -pipe -fPIC -fstack-protector-strong -fno-strict-aliasing   -DNDEBUG -fstack-protector-strong     -Xlinker --dependency-file=tools/CMakeFiles/ldc-profdata.dir/link.d tools/CMakeFiles/ldc-profdata.dir/ldc-profdata/llvm-profdata-19.1.cpp.o -o bin/ldc-profdata  -lLLVM-19  -L/usr/local/llvm19/lib && :
  ld: error: undefined symbol: pthread_create
  >>> referenced by llvm-profdata-19.1.cpp
  >>>               tools/CMakeFiles/ldc-profdata.dir/ldc-profdata/llvm-profdata-19.1.cpp.o:(std::__1::future<void> std::__1::__make_async_assoc_state[abi:sn190107]<void, std::__1::__async_func<std::__1::function<void ()>>>(std::__1::__async_func<std::__1::function<void ()>>&&))
  clang++: error: linker command failed with exit code 1 (use -v to see invocation)

This is because the link command line is missing -lpthread. For the
tools/ subdirectory, use the CMAKE_THREAD_LIBS_INIT macro to fix the
target_link_libraries() directive.

PR:		284344
Approved by:	acm (maintainer)
MFH:		2025Q1
2025-02-01 00:01:38 +01:00
..
files lang/ldc: fix build with LLVM_DEFAULT=19 2025-02-01 00:01:38 +01:00
distinfo
Makefile
pkg-descr
pkg-plist