Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Dec 2024 21:07:58 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 283241] lang/rust: superfluous dependency on devel/llvm with option PORT_LLVM
Message-ID:  <bug-283241-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D283241

            Bug ID: 283241
           Summary: lang/rust: superfluous dependency on devel/llvm with
                    option PORT_LLVM
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: ports-bugs@FreeBSD.org
          Reporter: gnikl@justmail.de
                CC: brooks@FreeBSD.org, rust@FreeBSD.org
                CC: brooks@FreeBSD.org, rust@FreeBSD.org

I am aware that PORT_LLVM is considered an experimental option as stated in=
 bug
#274743.

lang/rust built with PORT_LLVM_USES set to llvm:min=3D19,lib,noexport

# pkg info -dBb -F rust-1.83.0.pkg [PORT_LLVM set]
rust-1.83.0
Shared Libs required:
        libzstd.so.1
Shared Libs provided:
        libstd-a806a8676d7bc991.so
        librustc_driver-e0652d09b319a00a.so
Depends on     :
        llvm19-19.1.5

-> pkg recorded a dependency on llvm19 but libLLVM is not in list of requir=
ed
libraries. Indeed, "readelf -d" for librustc_driver.so shows only system
libraries (and libzstd.so.1)

# pkg info -dBb -F rust-1.83.0.pkg [PORT_LLVM unset, LTO set]
rust-1.83.0
Shared Libs required:
        libzstd.so.1
Shared Libs provided:
        libstd-a17289310c839863.so
        librustc_driver-2171cb97ac6fdb3f.so
        libLLVM.so.19.1-rust-1.83.0-stable

-> no dependency on LLVM, but in the list of provided shared libraries is a=
 so
of the rust included LLVM 19.1

# pkg info -dBb -F rust-1.83.0.pkg [PORT_LLVM set, LTO set]
rust-1.83.0
Shared Libs required:
        libzstd.so.1
        libLLVM.so.19.1
Shared Libs provided:
        libstd-a806a8676d7bc991.so
        librustc_driver-e0652d09b319a00a.so
Depends on     :
        llvm19-19.1.5

-> depends on llvm19 and requires libLLVM.so.19.1. readelf -d confirms that
librustc_driver.so requires libLLVM.

# pkg info -dBb -F rust-1.83.0.pkg [PORT_LLVM set but changed from lib to
build]
rust-1.83.0
Shared Libs required:
        libzstd.so.1
Shared Libs provided:
        libstd-a806a8676d7bc991.so
        librustc_driver-e0652d09b319a00a.so

-> no recorded dependency on devel/llvm. This is what I expected in the fir=
st
place.

Q1) What exactly does option LTO accomplish?
I assumed it would enable LTO for the build of lang/rust. Having a pkg
dependency on devel/llvm is surprising,

Q2) Why does the port expose shared libraries?
All libraries (libstd, librustc_driver and libLLVM...-stable) seem to be
private libraries only used by the built tools. Could/should the port use
BUNDLE_LIBS?

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-283241-7788>