Bug 283134 - lang/ldc: build against llvm 15 only
Summary: lang/ldc: build against llvm 15 only
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Jose Alonso Cardenas Marquez
URL:
Keywords:
Depends on:
Blocks: 283013
  Show dependency treegraph
 
Reported: 2024-12-04 20:38 UTC by Dimitry Andric
Modified: 2025-01-04 17:40 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (acm)


Attachments
lang/ldc: build against llvm 15 only (2.79 KB, patch)
2024-12-04 20:40 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2024-12-04 20:38:31 UTC
During the exp-run for bug 283013 ("update LLVM_DEFAULT to 18") it
turned out that lang/ldc fails to build, with an error similar
to:

-- Found LLVM: /usr/local/llvm18 (found suitable version "18.1.8", minimum required is "15.0")
-- Using LLVM Version 18.1
-- LDC version identifier: 1.39.0
-- -- Building LDC with dynamic compilation support (LDC_DYNAMIC_COMPILE): OFF
-- -- Building LDC with integrated LLD linker (LDC_WITH_LLD): ON
-- -- Building LDC with enabled assertions (LDC_ENABLE_ASSERTIONS): OFF
CMake Error at cmake/Modules/ExtractDMDSystemLinker.cmake:42 (message):
  Failed to link empty D program using
  '/wrkdirs/usr/ports/lang/ldc/work/ldc2-1.39.0-freebsd-x86_64/bin/ldmd2
  -wi':

  ld-elf.so.1: Shared object "libLLVM-15.so" not found, required by "ldmd2"
Call Stack (most recent call first):
  CMakeLists.txt:630 (include)

The issue is that the prebuilt bootstrap D compiler is linked against libLLVM-15.so:

$ ldd /wrkdirs/usr/ports/lang/ldc/work/ldc2-1.39.0-freebsd-x86_64/bin/ldc2
/wrkdirs/usr/ports/lang/ldc/work/ldc2-1.39.0-freebsd-x86_64/bin/ldc2:
        libLLVM-15.so => /usr/local/llvm15/lib/libLLVM-15.so (0x2643fb200000)
        libthr.so.3 => /lib/libthr.so.3 (0x2643f91d6000)
        libm.so.5 => /lib/libm.so.5 (0x2643faa83000)
        libc++.so.1 => /lib/libc++.so.1 (0x2643f9b25000)
        libcxxrt.so.1 => /lib/libcxxrt.so.1 (0x264403214000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x264403624000)
        libc.so.7 => /lib/libc.so.7 (0x264403837000)
        libexecinfo.so.1 => /usr/lib/libexecinfo.so.1 (0x264404122000)
        librt.so.1 => /lib/librt.so.1 (0x2644021d0000)
        libz.so.6 => /lib/libz.so.6 (0x26440493d000)
        libzstd.so.1 => /usr/local/lib/libzstd.so.1 (0x264405463000)
        libsys.so.7 => /lib/libsys.so.7 (0x264406507000)
        libelf.so.2 => /lib/libelf.so.2 (0x2644071b8000)
        [vdso] (0x2643f8a63000)

Therefore, this port cannot really build against any other package than devel/llvm15.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2024-12-04 20:40:54 UTC
Created attachment 255632 [details]
lang/ldc: build against llvm 15 only
Comment 2 commit-hook freebsd_committer freebsd_triage 2025-01-04 17:39:51 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=5160e2389af822d23f4cddca861165460066361f

commit 5160e2389af822d23f4cddca861165460066361f
Author:     Gleb Popov <arrowd@FreeBSD.org>
AuthorDate: 2025-01-04 17:37:46 +0000
Commit:     Gleb Popov <arrowd@FreeBSD.org>
CommitDate: 2025-01-04 17:38:51 +0000

    lang/ldc: Update to 1.40.0

    PR:             283134
    Sponsored by:   Future Crew, LLC

 lang/ldc/Makefile                         |  5 +++--
 lang/ldc/distinfo                         | 10 +++++-----
 lang/ldc/files/patch-CMakeLists.txt (new) | 18 ++++++++++++++++++
 lang/ldc/pkg-plist                        | 17 +++++++++--------
 4 files changed, 35 insertions(+), 15 deletions(-)