On Sat, Apr 14, 2018 at 10:26:22PM +0200, Pierre Labastie wrote:
> 
> >>
> >> Do we need to adjust the book's instructions?
> >>
> > 
> > I'd say not before understanding what is going on... Let me try building 
> > rust
> > with the new instructions, after installing llvm 6, and removing completely
> > llvm 5 (using porg).
> > 
> 
> And then... Another error on my side:
> ---------
> [...]
> cargo:rustc-link-search=native=/sources/rust/rustc-1.25.0-src/build/x86_64-unkno
> wn-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/rustc_llvm-7878
> f9d37a1306fb/out
> 
> --- stderr
> llvm-config: error: missing: /usr/lib/libLLVMDemangle.so
> llvm-config: error: missing: /usr/lib/libLLVMSupport.so
[...]
> [... fifty so lines like that ...]
> llvm-config: error: missing: /usr/lib/libLLVMX86AsmParser.so
> llvm-config: error: missing: /usr/lib/libLLVMX86Disassembler.so
> thread 'main' panicked at 'command did not execute successfully:
> "/usr/bin/llvm-config" "--link-shared" "--libs" "--system-libs" "asmparser"
> "bitreader" "bitwriter" "instrumentation" "interpreter" "ipo" "linker" "lto"
> "mcjit" "x86"
> ---------------
> And indeed, running the command:
> ---------------
> $ llvm-config --link-shared --libs
> ---------------
> returns the same list of errors as above, while
> ---------------
> $  llvm-config --libs
> ---------------
> returns a bunch of static libraries without errors.
> 
> I think there is a switch for building shared libraries in llvm. The book was
> using it at a time, but there were problems with mesa IIRC.
> 
> The switch is -DBUILD_SHARED_LIBS=ON, and the documentation still says:
> ``BUILD_SHARED_LIBS is only recommended for use by LLVM developers. If you
> want to build LLVM as a shared library, you should use the
> LLVM_BUILD_LLVM_DYLIB option.''
> 
> The book uses the LLVM_BUILD_LLVM_DYLIB option.
> 
Indeed it does, but I see that I also use -DLLVM_LINK_LLVM_DYLIB=ON.
I assume that might have been in the book at some time, but it's
what I've been using without obvious problems.

This is my only machine which currently has 6.0 (5.0.1 seems to be
good enough) and for the above commands I get:

ken@origin /sources/scripts/lfs-dev/git $llvm-config --version
6.0.0
ken@origin /sources/scripts/lfs-dev/git $llvm-config --libs
-lLLVM-6.0
ken@origin /sources/scripts/lfs-dev/git $llvm-config --link-shared --libs
-lLLVM-6.0

I very rarely remove the static libs, I just rename them so that I
have to take special measures to make them available (needed for
e.g. some of kde).  I have

ls -l /usr/lib/libLLVM*

lrwxrwxrwx 1 root root       14 Mar 28 04:26 /usr/lib/libLLVM-5.0.1.so -> 
libLLVM-5.0.so
-rwxr-xr-x 1 root root 45474200 Mar 28 04:21 /usr/lib/libLLVM-5.0.so
lrwxrwxrwx 1 root root       14 Apr 10 00:56 /usr/lib/libLLVM-6.0.0.so -> 
libLLVM-6.0.so
-rwxr-xr-x 1 root root 49620320 Apr 10 00:53 /usr/lib/libLLVM-6.0.so
-rw-r--r-- 1 root root   812692 Apr 10 00:29 
/usr/lib/libLLVMAMDGPUAsmParser.a.hidden
-rw-r--r-- 1 root root   320266 Apr 10 00:29 
/usr/lib/libLLVMAMDGPUAsmPrinter.a.hidden
[...]
-rw-r--r-- 1 root root   182332 Apr 10 00:12 /usr/lib/libLLVMDemangle.a.hidden
[...]
lrwxrwxrwx 1 root root       14 Apr 10 00:56 /usr/lib/libLLVM.so -> 
libLLVM-6.0.so
-rw-r--r-- 1 root root  2904212 Apr 10 00:13 /usr/lib/libLLVMSupport.a.hidden
[...]
-rw-r--r-- 1 root root  1053706 Apr 10 00:51 
/usr/lib/libLLVMX86AsmParser.a.hidden
[...]
-rw-r--r-- 1 root root  1503248 Apr 10 00:51 
/usr/lib/libLLVMX86Disassembler.a.hidden

So, I think -DLLVM_LINK_LLVM_DYLIB=ON is probably the difference.

> So: three persons; three different outcomes...
> 
> Let me rebuild llvm with -DBUILD_SHARED_LIBS=ON. I'll give the results
> tomorrow (my time), since llvm+rustc build time ~ 3 hours, and I'll be
> sleeping when it ends.
> 
> Pierre
> 

Sorry to offer that different suggestion after you have gone to bed.

I'll try a couple of manual DESTDIR llvm builds to confirm what gets
installed, including clang and compiler-rt (does anybody know of
anything that actually needs compiler-rt, I don't bother building it
on all machines and so far nothing seems to need it ?).

ĸen
-- 
In my seventh decade astride this planet, and as my own cells degrade,
there are some things I cannot do now: skydiving, marathon running,
calculus. I couldn't do them in my 20s either, so no big loss.
            -- Derek Smalls, formerly of Spinal Tap
-- 
http://lists.linuxfromscratch.org/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to