Hello,

Recently Mesa has started to use LLVM to optimise Gallium 3d and it
seems that the Mesa developers are quite keen on this approach. I'm
quite keen on Gallium so I thought I'd give them the benefit of the
doubt and install llvm-2.9. I like shared libraries, I think it's more
efficient to reuse the same library. There is also the security
implications if a shared library has an exploitable bug you can fix the
problem by replacing the one shared library, if a static lib has a
security bug you have to hunt down and replace everything that has that
static library compiled in. 

So I was not impressed when I saw that llvm-2.9 installs more than 70
static libraries. Configuring it with --enable shared didn't help, it
just created an extra libLLVM-2.9.so which seems to have all the other
static libs compiled into it. However, I have found (through trial and
error) that if I do some violence to the llvm Makefiles I can get it to
compile and install only shared libraries. Mesa seems happy with the
result so I thought I'd share what I've learnt in case anyone is
interested. This works for me with llvm-2.9:

./configure --prefix=/usr &&
find . -name Makefile -exec sed -i '/BUILD_ARCHIVE/d
/SHARED_LIBRARY/d
/LIBRARYNAME/a SHARED_LIBRARY = 1
/LIBRARYNAME/a NO_BUILD_ARCHIVE = 1' {} \; &&
# libCompilerDriver.a is needed by the build process:
sed -i 's#NO_BUILD_ARCHIVE#BUILD_ARCHIVE#' lib/CompilerDriver/Makefile &&
# libLLVMSupport.a is needed by the build process:
sed -i 's#NO_BUILD_ARCHIVE#BUILD_ARCHIVE#' lib/Support/Makefile &&
# libsample.a is needed by the build process:
sed -i 's#NO_BUILD_ARCHIVE#BUILD_ARCHIVE#' projects/sample/lib/sample/Makefile 
&&
make -j$(getconf _NPROCESSORS_ONLN) &&
# don't install libLLVMSupport.a
sed -i 's#BUILD_ARCHIVE#NO_BUILD_ARCHIVE#' lib/Support/Makefile &&
# don't install libCompilerDriver.a
sed -i 's#BUILD_ARCHIVE#NO_BUILD_ARCHIVE#' lib/CompilerDriver/Makefile &&
make install

Andy
-- 
http://linuxfromscratch.org/mailman/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to