April 13, 2008 Re: -L-ldl needed on Linux | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bill Baxter | Bill Baxter wrote: > Lars Ivar Igesund wrote: >> >> It may be that it is derelict's fault for not working with the tools, but >> there is also the relevant bugzilla entries >> http://d.puremagic.com/issues/show_bug.cgi?id=1663 >> >> and >> >> http://d.puremagic.com/issues/show_bug.cgi?id=1690 >> >> pragma(lib) should be implemented on all platforms, or removed from the spec >> entirely. > > That's certainly a problem. > > However, Derelict supports DSSS, so that's not really an excuse for Derelict. It could use DSSS's pragma(link). > > --bb How is that going to help with the final executable? No linking is done during the compilation of static libraries, so even if I did add that to Derelict's dsss.conf files, the user would still have to link to libdl when compiling the executable. |
April 13, 2008 Re: -L-ldl needed on Linux | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mike Parker | Mike Parker wrote:
> Bill Baxter wrote:
>> Lars Ivar Igesund wrote:
>
>>>
>>> It may be that it is derelict's fault for not working with the tools, but
>>> there is also the relevant bugzilla entries
>>> http://d.puremagic.com/issues/show_bug.cgi?id=1663
>>>
>>> and
>>>
>>> http://d.puremagic.com/issues/show_bug.cgi?id=1690
>>>
>>> pragma(lib) should be implemented on all platforms, or removed from the spec
>>> entirely.
>>
>> That's certainly a problem.
>>
>> However, Derelict supports DSSS, so that's not really an excuse for Derelict. It could use DSSS's pragma(link).
>>
>> --bb
>
> How is that going to help with the final executable? No linking is done during the compilation of static libraries, so even if I did add that to Derelict's dsss.conf files, the user would still have to link to libdl when compiling the executable.
You wouldn't put it in Derelict's dsss.conf, you'd put it in derelict/util/loader.d. And it would end up in the .di file, where it would be found by dsss later when users are trying to compile something that uses loader.
--bb
|
April 13, 2008 Re: -L-ldl needed on Linux | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bill Baxter | Bill Baxter wrote:
> Mike Parker wrote:
>> Bill Baxter wrote:
>>> Lars Ivar Igesund wrote:
>>
>>>>
>>>> It may be that it is derelict's fault for not working with the tools, but
>>>> there is also the relevant bugzilla entries
>>>> http://d.puremagic.com/issues/show_bug.cgi?id=1663
>>>>
>>>> and
>>>>
>>>> http://d.puremagic.com/issues/show_bug.cgi?id=1690
>>>>
>>>> pragma(lib) should be implemented on all platforms, or removed from the spec
>>>> entirely.
>>>
>>> That's certainly a problem.
>>>
>>> However, Derelict supports DSSS, so that's not really an excuse for Derelict. It could use DSSS's pragma(link).
>>>
>>> --bb
>>
>> How is that going to help with the final executable? No linking is done during the compilation of static libraries, so even if I did add that to Derelict's dsss.conf files, the user would still have to link to libdl when compiling the executable.
>
> You wouldn't put it in Derelict's dsss.conf, you'd put it in derelict/util/loader.d. And it would end up in the .di file, where it would be found by dsss later when users are trying to compile something that uses loader.
>
I see now. I've updated the Derelict trunk with the pragma link.
|
April 13, 2008 Re: -L-ldl needed on Linux | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mike Parker | Mike Parker wrote: > Bill Baxter wrote: >> Mike Parker wrote: >>> Bill Baxter wrote: >>>> Lars Ivar Igesund wrote: >>> >>>>> >>>>> It may be that it is derelict's fault for not working with the >>>>> tools, but >>>>> there is also the relevant bugzilla entries >>>>> http://d.puremagic.com/issues/show_bug.cgi?id=1663 >>>>> >>>>> and >>>>> >>>>> http://d.puremagic.com/issues/show_bug.cgi?id=1690 >>>>> >>>>> pragma(lib) should be implemented on all platforms, or removed from >>>>> the spec >>>>> entirely. >>>> >>>> That's certainly a problem. >>>> >>>> However, Derelict supports DSSS, so that's not really an excuse for Derelict. It could use DSSS's pragma(link). >>>> >>>> --bb >>> >>> How is that going to help with the final executable? No linking is done during the compilation of static libraries, so even if I did add that to Derelict's dsss.conf files, the user would still have to link to libdl when compiling the executable. >> >> You wouldn't put it in Derelict's dsss.conf, you'd put it in derelict/util/loader.d. And it would end up in the .di file, where it would be found by dsss later when users are trying to compile something that uses loader. >> > > I see now. I've updated the Derelict trunk with the pragma link. For reference, this is where I think that pragma lib should be available from the compiler instead, such that the correct lib will be linked even with a different build tool. -- Lars Ivar Igesund blog at http://larsivi.net DSource, #d.tango & #D: larsivi Dancing the Tango |
April 13, 2008 Re: -L-ldl needed on Linux | ||||
---|---|---|---|---|
| ||||
Posted in reply to Lars Ivar Igesund | Lars Ivar Igesund wrote:
> Mike Parker wrote:
>
>> Bill Baxter wrote:
>>> Mike Parker wrote:
>>>> Bill Baxter wrote:
>>>>> Lars Ivar Igesund wrote:
>>>>>> It may be that it is derelict's fault for not working with the
>>>>>> tools, but
>>>>>> there is also the relevant bugzilla entries
>>>>>> http://d.puremagic.com/issues/show_bug.cgi?id=1663
>>>>>>
>>>>>> and
>>>>>>
>>>>>> http://d.puremagic.com/issues/show_bug.cgi?id=1690
>>>>>>
>>>>>> pragma(lib) should be implemented on all platforms, or removed from
>>>>>> the spec
>>>>>> entirely.
>>>>> That's certainly a problem.
>>>>>
>>>>> However, Derelict supports DSSS, so that's not really an excuse for
>>>>> Derelict. It could use DSSS's pragma(link).
>>>>>
>>>>> --bb
>>>> How is that going to help with the final executable? No linking is
>>>> done during the compilation of static libraries, so even if I did add
>>>> that to Derelict's dsss.conf files, the user would still have to link
>>>> to libdl when compiling the executable.
>>> You wouldn't put it in Derelict's dsss.conf, you'd put it in
>>> derelict/util/loader.d. And it would end up in the .di file, where it
>>> would be found by dsss later when users are trying to compile something
>>> that uses loader.
>>>
>> I see now. I've updated the Derelict trunk with the pragma link.
>
> For reference, this is where I think that pragma lib should be available
> from the compiler instead, such that the correct lib will be linked even
> with a different build tool.
Agreed. I think it's yet another one of those things that has been debated, hailed by all, then ignored, then forgotten.
But DSSS takes the feature from Bud, I believe. So if all D-aware build tools implement it, then it's not so bad. Of course that doesn't help 'make' users.
Incidentially, this may be a good time to once again bring up Gregor's proposal of dmd -v spitting out pragmas in addition to imports. It would make supporting things like pragma("link") much easier for any build tool that wanted to.
--bb
|
April 14, 2008 Re: -L-ldl needed on Linux | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bill Baxter | Bill Baxter wrote:
> Just wondering why I have to give dsss the -L-ldl flag manually when I compile a Derelict-using program under Linux.
>
> Seems like it shouldn't be neecessary for me to have to specify that. But who's to blame?
> * Is it DMD's fault for not including in the default link libs?
> * Is it DSSS's fault for not picking up that it's needed (or for not puttin it in the default list of flags?)
> * Is it Derelict's fault for somehow not telling DSSS that it wants to use libdl on Linux?
>
> Any of those seem possible. So anyone know the answer?
>
> Or is it just my fault for thinking I shouldn't have to stick a version(linux) block in my dsss.conf file?
>
> --bb
It's sort of the Linux way I guess. You have to do this using C++ to use any of the dynamic binding functions. A dsss link pragma seems to be the solution for the moment. Or, you can list lib 'dl' in your dsss.conf and you will get a warning on windows but it will still link correctly.
buildflags=-g -lldl -debug -unittest -Dddocs -profile
OPTLINK (R) for Win32 Release 8.00.1
Copyright (C) Digital Mars 1989-2004 All rights reserved.
dl.lib
Warning 2: File Not Found dl.lib
|
April 14, 2008 Re: -L-ldl needed on Linux | ||||
---|---|---|---|---|
| ||||
Posted in reply to Spacen Jasset | Spacen Jasset wrote:
> Bill Baxter wrote:
>> Just wondering why I have to give dsss the -L-ldl flag manually when I compile a Derelict-using program under Linux.
>>
>> Seems like it shouldn't be neecessary for me to have to specify that. But who's to blame?
>> * Is it DMD's fault for not including in the default link libs?
>> * Is it DSSS's fault for not picking up that it's needed (or for not puttin it in the default list of flags?)
>> * Is it Derelict's fault for somehow not telling DSSS that it wants to use libdl on Linux?
>>
>> Any of those seem possible. So anyone know the answer?
>>
>> Or is it just my fault for thinking I shouldn't have to stick a version(linux) block in my dsss.conf file?
>>
>> --bb
>
> It's sort of the Linux way I guess. You have to do this using C++ to use any of the dynamic binding functions. A dsss link pragma seems to be the solution for the moment. Or, you can list lib 'dl' in your dsss.conf and you will get a warning on windows but it will still link correctly.
>
> buildflags=-g -lldl -debug -unittest -Dddocs -profile
>
>
> OPTLINK (R) for Win32 Release 8.00.1
> Copyright (C) Digital Mars 1989-2004 All rights reserved.
> dl.lib
> Warning 2: File Not Found dl.lib
>
Mike/Aldacron added the link pragma to Derelict's svn yesterday. So at least with DSSS (and bud I think) the -L-ldl is no longer needed for building programs with Derelict.
--bb
|
Copyright © 1999-2021 by the D Language Foundation