[arch-general] RFC: Mesa and shared LLVM libraries

Armin K. krejzi at email.com
Sun Mar 3 15:04:37 EST 2013


Hello everyone,

First, I am aware that ArchLinux is against patching packages to 
implement some features, but this might be worth the effort.

Tom Stellard of AMD has announced a R600 backend patch against LLVM 3.2 
few days ago [1]. It's basically his repository (llvm-amdgpu-snapshot)
diffed against upstream LLVM (llvm).

By applying the patch to ArchLinux LLVM package, one could benefit from
enabling Mesa to link against LLVM shared library. Doing so, space would
be saved and so the memory at runtime, too (I guess since it will use 
shared mappings).

I've done some work regarding that. I've managed to split libLLVM-3.2.so 
from llvm package and put it into libllvm package.

The package is a bit big though - the shared library contains all (~100) 
static libraries linked into one single library.

The result is like this:

Targets (1): libllvm-3.2-5

Total Installed Size:   21.77 MiB

Building MesaLib against shared libLLVM-3.2.so saves space drastically. 
For all MesaLib produced packages, the output is like this one:

Targets (6): ati-dri-9.1-2  intel-dri-9.1-2  mesa-9.1-2 
mesa-libgl-9.1-2  nouveau-dri-9.1-2  svga-dri-9.1-2

Total Installed Size:   82.13 MiB
Net Upgrade Size:       -282.07 MiB

260 MB saved ... Looks nice to me.

R600 backend will be part of LLVM 3.3 anyways, and this can be used in 
the future without patching anything.

I am attaching patches for llvm and mesa PKGBUILDs to incorporate these 
changes. Do as you may please.

If someone is interested in forwarding this to -dev-public list it would 
be nice.

Have a nice evening.

(As a side note, somehow llvm tarball sha256sum was wrong when I 
downloaded it).

[1] http://lists.freedesktop.org/archives/mesa-dev/2013-March/035561.html


More information about the arch-general mailing list