[cfe-dev] clang/llvm cmake static build broken on Linux

Vince Harron vharron at google.com
Mon Dec 29 09:49:57 PST 2014


The first checkin with support for LLVM_BUILD_STATIC has this linking
error, so the flag just isn't intended do what I expected.  I am able to
build lldb-platform/lldb-gdbserver statically with this flag so it's
working for me.

Vince


On Sun, Dec 28, 2014 at 7:56 AM, Vince Harron <vharron at google.com> wrote:

> Hi all,
>
> I just grabbed tot.  I'm still able to build dynamic but static linking
> isn't working for me anymore.
>
> I'm not sure if I should be directing this to cfe-dev or llvm-dev
>
> [305/306] Linking CXX executable bin/clang-3.6
>
> /usr/bin/ld: dynamic STT_GNU_IFUNC symbol `strcmp' with pointer equality
> in
> `/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libc.a(strcmp.o)'
> can not be used when making an executable; recompile with -fPIE and relink
> with -pie"
>
> Repro steps:
>
> #!/bin/bash -ex
>
> ROOT_DIR=$HOME/ll/static-fail
>
> mkdir $ROOT_DIR
> cd $ROOT_DIR
> svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
> cd llvm/tools
> svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
> cd $ROOT_DIR
> mkdir build
> cd build
> cmake -G Ninja ../llvm -DCMAKE_BUILD_TYPE=Release -DLLVM_BUILD_STATIC=True
> ninja clang
>
>
> --
>
> Vince Harron | Technical Lead Manager | vharron at google.com | 858-442-0868
>



-- 

Vince Harron | Technical Lead Manager | vharron at google.com | 858-442-0868
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20141229/363baaff/attachment.html>


More information about the cfe-dev mailing list