LLVM dependency for ports

mrbeastie0x19

Member

Reaction score: 58
Messages: 96

On FreeBSD 13 Release

Code:
 pkg install xorg

Pulls in llvm12 from graphics/mesa-driver

Questions:

Why is it needed as a runtime dependency? I thought it was used for a compiler. Why does a program need a compiler framework to run?
Why is it needed as a build dependency? Does the base system compiler not work for building this port?

The issue I have is twofold:

LLVM is massive. It takes storage, I already have a version in the base system and it takes a long time for my computer to compile it. Even using pkgs it takes a long time to download and extract this particular package (comparatively to the rest of Xorg the time goes from a matter of seconds to minutes, in the case of compile times on slower machines the difference is huge, and I mean from being slow but manageable to basically giving up on the ports system as a whole).

LLVM is messy. It installs a bunch of different binaries and creates directories all over the place (/usr/local/llvm), all of this for what looks like functionality already included in the base system. It would be fine if there was a singular version of it (as there is in base) but the existence of multiple versions is just not very organised.

Considering Xorg is basically the only serious contender for graphics devices at the minute there does not appear to be a solution around this problem.

Any suggestions, or do we just have to live with it atm.
 

Zirias

Son of Beastie

Reaction score: 1,562
Messages: 2,685

Why is it needed as a runtime dependency? I thought it was used for a compiler. Why does a program need a compiler framework to run?
Compilers come with runtime support libraries. I didn't have a look, so this runtime dependency might be an error, but it's also perfectly possible that a library bundled with llvm12 is linked…

One weakness of FreeBSD's ports/packages is that there isn't a way to build multiple packages from a single port (like many Linux distros do with things like separated -devel packages). If you need a shared library from one port, you have to pull in the whole port.

Why is it needed as a build dependency? Does the base system compiler not work?
Most certainly. C and C++ standards are still seeing new versions from time to time, but, more importantly, compilers have their "proprietary" extensions. This can even lead to unfortunate situations like needing a very old compiler to build one piece of software.
 

angry_vincent

New Member

Reaction score: 4
Messages: 9

shaders, point/line/triangle rasterization and vertex processing is implemented with LLVMpipe, it is essential part of mesa and requires LLVM at runtime ( and build time ). Currently, there is no way around this
 
OP
M

mrbeastie0x19

Member

Reaction score: 58
Messages: 96

shaders, point/line/triangle rasterization and vertex processing is implemented with LLVMpipe, it is essential part of mesa and requires LLVM at runtime ( and build time ). Currently, there is no way around this
Ah that is the issue. Can it not be used with base LLVM?
 

angry_vincent

New Member

Reaction score: 4
Messages: 9

No, base llvm has no headers and required libraries, only compiler and some other tools. I could not tell details, maybe to avoid ABI changes that newer version of llvm could have
 

Phishfry

Beastie's Twin

Reaction score: 2,669
Messages: 5,589

Why not spin out these LLVM runtime binaries into a port instead of installing two (or more) LLVM compilers?

Here is an analogy in my world.
I make a shaft in the lathe. But now to install the shaft in the boat I have to take the lathe with me to the boat.

Get my point?
 
OP
M

mrbeastie0x19

Member

Reaction score: 58
Messages: 96

From what I can see LLVMpipe requires llvm-devel on Debian, which looking at sid requires

/usr/include/llvm
/usr/include/llvm-c
/usr/lib/LLVMgold.so
/usr/lib/libLTO.so
/usr/share/doc/llvm-dev/NEWS.Debian.gz
/usr/share/doc/llvm-dev/changelog.gz
/usr/share/doc/llvm-dev/copyright
/usr/share/emacs/site-lisp/llvm
/usr/share/vim/addons/syntax/llvm.vim
/usr/share/vim/addons/syntax/tablegen.vim

Most of these are obviously unnecessary for us.

Fedora is more verbose: https://rpmfind.net/linux/RPM/fedora/devel/rawhide/x86_64/l/llvm-devel-13.0.0~rc1-2.fc36.x86_64.html

Why is there no way to pull in a small number of header files rather than the kitchen sink, is this something being considered?
 

kpedersen

Son of Beastie

Reaction score: 2,095
Messages: 2,953

I maintain a personal port for Emscripten (Clang/LLVM -> ASM.js compiler). I personally include LLVM runtimes as part of this package rather than drag in an additional dep. So it half solves the problem. However it seems that this is generally not the preferred way by a lot of porters.
 
Top