[llvm-dev] LLD and LLVM_LINK_LLVM_DYLIB

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[llvm-dev] LLD and LLVM_LINK_LLVM_DYLIB

Nicholas Krause via llvm-dev
Hi all,

I recently gave LLD a try and it definitely works fine. However one cannot
build it together with LLVM_LINK_LLVM_DYLIB:
ELF/Driver.cpp and ELF/DriverUtils.cpp pull in llvm/Support/CommandLine.h
which defines the command line options so these global variables end up in
libLLVM-4.0svn.so via liblldELF.
If this shared library is then linked into bin/lld or bin/opt one gets
errors because of "Option '...' registered more than once" as they are also
present in the binaries themselves.

Is it possible to keep the global variables for command line options out of
libLLVM-4.0svn.so?

Regards,
Jonas

--
Jonas Hahnfeld, MATSE-Auszubildender

IT Center
Group: High Performance Computing
Division: Computational Science and Engineering
RWTH Aachen University
Seffenter Weg 23
D 52074  Aachen (Germany)
[hidden email]
www.itc.rwth-aachen.de



_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

smime.p7s (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] LLD and LLVM_LINK_LLVM_DYLIB

Nicholas Krause via llvm-dev
Hi Hahnfeld,

I just compiled with LLVM_LINK_LLVM_DYLIB enabled [1] and build lld with `ninja lld`. It built fine. What am I missing?

[1] $ cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_THREADS=On -DLLVM_ENABLE_LLD=true -DLLVM_LINK_LLVM_DYLIB=true -DLLVM_ENABLE_PROJECTS='clang;lld' ../llvm-project/llvm

On Wed, Jan 4, 2017 at 10:31 PM, Hahnfeld, Jonas via llvm-dev <[hidden email]> wrote:
Hi all,

I recently gave LLD a try and it definitely works fine. However one cannot
build it together with LLVM_LINK_LLVM_DYLIB:
ELF/Driver.cpp and ELF/DriverUtils.cpp pull in llvm/Support/CommandLine.h
which defines the command line options so these global variables end up in
libLLVM-4.0svn.so via liblldELF.
If this shared library is then linked into bin/lld or bin/opt one gets
errors because of "Option '...' registered more than once" as they are also
present in the binaries themselves.

Is it possible to keep the global variables for command line options out of
libLLVM-4.0svn.so?

Regards,
Jonas

--
Jonas Hahnfeld, MATSE-Auszubildender

IT Center
Group: High Performance Computing
Division: Computational Science and Engineering
RWTH Aachen University
Seffenter Weg 23
D 52074  Aachen (Germany)
[hidden email]
www.itc.rwth-aachen.de



_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev



_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] LLD and LLVM_LINK_LLVM_DYLIB

Nicholas Krause via llvm-dev
It builds fine but I cannot execute the resulting binary which aborts with the mentioned error.
However I don't use LLVM_ENABLE_PROJECTS, I don't know if that changes the way libLLVM-4.0svn.so is linked...

Cheers,
Jonas

Am Freitag, den 06.01.2017, 13:44 +0900 schrieb Rui Ueyama:
Hi Hahnfeld,

I just compiled with LLVM_LINK_LLVM_DYLIB enabled [1] and build lld with `ninja lld`. It built fine. What am I missing?

[1] $ cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_THREADS=On -DLLVM_ENABLE_LLD=true -DLLVM_LINK_LLVM_DYLIB=true -DLLVM_ENABLE_PROJECTS='clang;lld' ../llvm-project/llvm

On Wed, Jan 4, 2017 at 10:31 PM, Hahnfeld, Jonas via llvm-dev <[hidden email]> wrote:
Hi all,

I recently gave LLD a try and it definitely works fine. However one cannot
build it together with LLVM_LINK_LLVM_DYLIB:
ELF/Driver.cpp and ELF/DriverUtils.cpp pull in llvm/Support/CommandLine.h
which defines the command line options so these global variables end up in
libLLVM-4.0svn.so via liblldELF.
If this shared library is then linked into bin/lld or bin/opt one gets
errors because of "Option '...' registered more than once" as they are also
present in the binaries themselves.

Is it possible to keep the global variables for command line options out of
libLLVM-4.0svn.so?

Regards,
Jonas

--
Jonas Hahnfeld, MATSE-Auszubildender

IT Center
Group: High Performance Computing
Division: Computational Science and Engineering
RWTH Aachen University
Seffenter Weg 23
D 52074  Aachen (Germany)
[hidden email]
www.itc.rwth-aachen.de



_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev



_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

smime.p7s (8K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] LLD and LLVM_LINK_LLVM_DYLIB

Nicholas Krause via llvm-dev
Thanks for the info. I can reproduce the issue. But because of lack of cmake knowledge, I don't know how to fix that now. If no one will take a look at this, I'll investigate it.

On Fri, Jan 6, 2017 at 2:51 PM, Hahnfeld, Jonas <[hidden email]> wrote:
It builds fine but I cannot execute the resulting binary which aborts with the mentioned error.
However I don't use LLVM_ENABLE_PROJECTS, I don't know if that changes the way libLLVM-4.0svn.so is linked...

Cheers,
Jonas

Am Freitag, den 06.01.2017, 13:44 +0900 schrieb Rui Ueyama:
Hi Hahnfeld,

I just compiled with LLVM_LINK_LLVM_DYLIB enabled [1] and build lld with `ninja lld`. It built fine. What am I missing?

[1] $ cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_THREADS=On -DLLVM_ENABLE_LLD=true -DLLVM_LINK_LLVM_DYLIB=true -DLLVM_ENABLE_PROJECTS='clang;lld' ../llvm-project/llvm

On Wed, Jan 4, 2017 at 10:31 PM, Hahnfeld, Jonas via llvm-dev <[hidden email]> wrote:
Hi all,

I recently gave LLD a try and it definitely works fine. However one cannot
build it together with LLVM_LINK_LLVM_DYLIB:
ELF/Driver.cpp and ELF/DriverUtils.cpp pull in llvm/Support/CommandLine.h
which defines the command line options so these global variables end up in
libLLVM-4.0svn.so via liblldELF.
If this shared library is then linked into bin/lld or bin/opt one gets
errors because of "Option '...' registered more than once" as they are also
present in the binaries themselves.

Is it possible to keep the global variables for command line options out of
libLLVM-4.0svn.so?

Regards,
Jonas

--
Jonas Hahnfeld, MATSE-Auszubildender

IT Center
Group: High Performance Computing
Division: Computational Science and Engineering
RWTH Aachen University
Seffenter Weg 23
D 52074  Aachen (Germany)
[hidden email]
www.itc.rwth-aachen.de



_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev




_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] LLD and LLVM_LINK_LLVM_DYLIB

Nicholas Krause via llvm-dev
I've dealt with similar issues on the LLDB side, I think I can help
you with this.

pl

On 6 January 2017 at 09:39, Rui Ueyama via llvm-dev
<[hidden email]> wrote:

> Thanks for the info. I can reproduce the issue. But because of lack of cmake
> knowledge, I don't know how to fix that now. If no one will take a look at
> this, I'll investigate it.
>
> On Fri, Jan 6, 2017 at 2:51 PM, Hahnfeld, Jonas
> <[hidden email]> wrote:
>>
>> It builds fine but I cannot execute the resulting binary which aborts with
>> the mentioned error.
>> However I don't use LLVM_ENABLE_PROJECTS, I don't know if that changes the
>> way libLLVM-4.0svn.so is linked...
>>
>> Cheers,
>> Jonas
>>
>> Am Freitag, den 06.01.2017, 13:44 +0900 schrieb Rui Ueyama:
>>
>> Hi Hahnfeld,
>>
>> I just compiled with LLVM_LINK_LLVM_DYLIB enabled [1] and build lld with
>> `ninja lld`. It built fine. What am I missing?
>>
>> [1] $ cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_THREADS=On
>> -DLLVM_ENABLE_LLD=true -DLLVM_LINK_LLVM_DYLIB=true
>> -DLLVM_ENABLE_PROJECTS='clang;lld' ../llvm-project/llvm
>>
>> On Wed, Jan 4, 2017 at 10:31 PM, Hahnfeld, Jonas via llvm-dev
>> <[hidden email]> wrote:
>>
>> Hi all,
>>
>> I recently gave LLD a try and it definitely works fine. However one cannot
>> build it together with LLVM_LINK_LLVM_DYLIB:
>> ELF/Driver.cpp and ELF/DriverUtils.cpp pull in llvm/Support/CommandLine.h
>> which defines the command line options so these global variables end up in
>> libLLVM-4.0svn.so via liblldELF.
>> If this shared library is then linked into bin/lld or bin/opt one gets
>> errors because of "Option '...' registered more than once" as they are
>> also
>> present in the binaries themselves.
>>
>> Is it possible to keep the global variables for command line options out
>> of
>> libLLVM-4.0svn.so?
>>
>> Regards,
>> Jonas
>>
>> --
>> Jonas Hahnfeld, MATSE-Auszubildender
>>
>> IT Center
>> Group: High Performance Computing
>> Division: Computational Science and Engineering
>> RWTH Aachen University
>> Seffenter Weg 23
>> D 52074  Aachen (Germany)
>> [hidden email]
>> www.itc.rwth-aachen.de
>>
>>
>>
>> _______________________________________________
>> LLVM Developers mailing list
>> [hidden email]
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>>
>>
>
>
> _______________________________________________
> LLVM Developers mailing list
> [hidden email]
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] LLD and LLVM_LINK_LLVM_DYLIB

Nicholas Krause via llvm-dev
Try if https://reviews.llvm.org/D28397 does the trick for you.

On 6 January 2017 at 10:48, Pavel Labath <[hidden email]> wrote:

> I've dealt with similar issues on the LLDB side, I think I can help
> you with this.
>
> pl
>
> On 6 January 2017 at 09:39, Rui Ueyama via llvm-dev
> <[hidden email]> wrote:
>> Thanks for the info. I can reproduce the issue. But because of lack of cmake
>> knowledge, I don't know how to fix that now. If no one will take a look at
>> this, I'll investigate it.
>>
>> On Fri, Jan 6, 2017 at 2:51 PM, Hahnfeld, Jonas
>> <[hidden email]> wrote:
>>>
>>> It builds fine but I cannot execute the resulting binary which aborts with
>>> the mentioned error.
>>> However I don't use LLVM_ENABLE_PROJECTS, I don't know if that changes the
>>> way libLLVM-4.0svn.so is linked...
>>>
>>> Cheers,
>>> Jonas
>>>
>>> Am Freitag, den 06.01.2017, 13:44 +0900 schrieb Rui Ueyama:
>>>
>>> Hi Hahnfeld,
>>>
>>> I just compiled with LLVM_LINK_LLVM_DYLIB enabled [1] and build lld with
>>> `ninja lld`. It built fine. What am I missing?
>>>
>>> [1] $ cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_THREADS=On
>>> -DLLVM_ENABLE_LLD=true -DLLVM_LINK_LLVM_DYLIB=true
>>> -DLLVM_ENABLE_PROJECTS='clang;lld' ../llvm-project/llvm
>>>
>>> On Wed, Jan 4, 2017 at 10:31 PM, Hahnfeld, Jonas via llvm-dev
>>> <[hidden email]> wrote:
>>>
>>> Hi all,
>>>
>>> I recently gave LLD a try and it definitely works fine. However one cannot
>>> build it together with LLVM_LINK_LLVM_DYLIB:
>>> ELF/Driver.cpp and ELF/DriverUtils.cpp pull in llvm/Support/CommandLine.h
>>> which defines the command line options so these global variables end up in
>>> libLLVM-4.0svn.so via liblldELF.
>>> If this shared library is then linked into bin/lld or bin/opt one gets
>>> errors because of "Option '...' registered more than once" as they are
>>> also
>>> present in the binaries themselves.
>>>
>>> Is it possible to keep the global variables for command line options out
>>> of
>>> libLLVM-4.0svn.so?
>>>
>>> Regards,
>>> Jonas
>>>
>>> --
>>> Jonas Hahnfeld, MATSE-Auszubildender
>>>
>>> IT Center
>>> Group: High Performance Computing
>>> Division: Computational Science and Engineering
>>> RWTH Aachen University
>>> Seffenter Weg 23
>>> D 52074  Aachen (Germany)
>>> [hidden email]
>>> www.itc.rwth-aachen.de
>>>
>>>
>>>
>>> _______________________________________________
>>> LLVM Developers mailing list
>>> [hidden email]
>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>>>
>>>
>>
>>
>> _______________________________________________
>> LLVM Developers mailing list
>> [hidden email]
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>>
_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] LLD and LLVM_LINK_LLVM_DYLIB

Nicholas Krause via llvm-dev
Wow, that was fast! Unfortunately I probably won't have enough to time to test
again until mid of next week :-/

> -----Original Message-----
> From: Pavel Labath [mailto:[hidden email]]
> Sent: Friday, January 06, 2017 2:05 PM
> To: Hahnfeld, Jonas
> Cc: [hidden email]; Rui Ueyama
> Subject: Re: [llvm-dev] LLD and LLVM_LINK_LLVM_DYLIB
>
> Try if https://reviews.llvm.org/D28397 does the trick for you.
>
> On 6 January 2017 at 10:48, Pavel Labath <[hidden email]> wrote:
> > I've dealt with similar issues on the LLDB side, I think I can help
> > you with this.
> >
> > pl
> >
> > On 6 January 2017 at 09:39, Rui Ueyama via llvm-dev
> > <[hidden email]> wrote:
> >> Thanks for the info. I can reproduce the issue. But because of lack
> >> of cmake knowledge, I don't know how to fix that now. If no one will
> >> take a look at this, I'll investigate it.
> >>
> >> On Fri, Jan 6, 2017 at 2:51 PM, Hahnfeld, Jonas
> >> <[hidden email]> wrote:
> >>>
> >>> It builds fine but I cannot execute the resulting binary which
> >>> aborts with the mentioned error.
> >>> However I don't use LLVM_ENABLE_PROJECTS, I don't know if that
> >>> changes the way libLLVM-4.0svn.so is linked...
> >>>
> >>> Cheers,
> >>> Jonas
> >>>
> >>> Am Freitag, den 06.01.2017, 13:44 +0900 schrieb Rui Ueyama:
> >>>
> >>> Hi Hahnfeld,
> >>>
> >>> I just compiled with LLVM_LINK_LLVM_DYLIB enabled [1] and build lld
> >>> with `ninja lld`. It built fine. What am I missing?
> >>>
> >>> [1] $ cmake -GNinja -DCMAKE_BUILD_TYPE=Debug
> >>> -DLLVM_ENABLE_THREADS=On -DLLVM_ENABLE_LLD=true
> >>> -DLLVM_LINK_LLVM_DYLIB=true -DLLVM_ENABLE_PROJECTS='clang;lld'
> >>> ../llvm-project/llvm
> >>>
> >>> On Wed, Jan 4, 2017 at 10:31 PM, Hahnfeld, Jonas via llvm-dev
> >>> <[hidden email]> wrote:
> >>>
> >>> Hi all,
> >>>
> >>> I recently gave LLD a try and it definitely works fine. However one
> >>> cannot build it together with LLVM_LINK_LLVM_DYLIB:
> >>> ELF/Driver.cpp and ELF/DriverUtils.cpp pull in
> >>> llvm/Support/CommandLine.h which defines the command line options
> so
> >>> these global variables end up in libLLVM-4.0svn.so via liblldELF.
> >>> If this shared library is then linked into bin/lld or bin/opt one
> >>> gets errors because of "Option '...' registered more than once" as
> >>> they are also present in the binaries themselves.
> >>>
> >>> Is it possible to keep the global variables for command line options
> >>> out of libLLVM-4.0svn.so?
> >>>
> >>> Regards,
> >>> Jonas
> >>>
> >>> --
> >>> Jonas Hahnfeld, MATSE-Auszubildender
> >>>
> >>> IT Center
> >>> Group: High Performance Computing
> >>> Division: Computational Science and Engineering RWTH Aachen
> >>> University Seffenter Weg 23 D 52074  Aachen (Germany)
> >>> [hidden email] www.itc.rwth-aachen.de
> >>>
> >>>
> >>>
> >>> _______________________________________________
> >>> LLVM Developers mailing list
> >>> [hidden email]
> >>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
> >>>
> >>>
> >>
> >>
> >> _______________________________________________
> >> LLVM Developers mailing list
> >> [hidden email]
> >> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
> >>

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

smime.p7s (7K) Download Attachment