View mode: basic / threaded / horizontal-split · Log in · Help
January 05, 2012
Re: CURL question on ubuntuforums.org
On 05/01/2012 13:41, Jacob Carlborg wrote:
> On 2012-01-05 11:00, Nick Sabalausky wrote:
>> "Joshua Reusch"<yoschi@arkandos.de> wrote in message
>> news:je26q8$19oo$1@digitalmars.com...
>>>
>>> OT: Why does dmd ignore the pragma(lib, ...) in the etc.c.curl module
>>> while rdmd seems to recognize it?
>>
>> What I think is happening:
>>
>> The pragma(lib, ...) causes DMD's -deps=filename option to include the
>> library file in the dependency list that gets output. RDMD takes that
>> list
>> and sends everything in it back to DMD on the command line.
>> Apperently, DMD
>> is only forwarding libs to the linker when it receives them on the
>> command
>> line (though I don't know why, sounds like a bug to me).
>
> Isn't that what it's supposed to do, just forward the lib to the linker?
>

The only time pragma(lib) works is when the file it's in is provided on 
the command line. rdmd can work around this as it invokes dmd twice, 
there's not a lot that can be done otherwise though.

-- 
Robert
http://octarineparrot.com/
January 06, 2012
Re: CURL question on ubuntuforums.org
On 2012-01-05 15:04, Robert Clipsham wrote:
> On 05/01/2012 13:41, Jacob Carlborg wrote:
>> On 2012-01-05 11:00, Nick Sabalausky wrote:
>>> "Joshua Reusch"<yoschi@arkandos.de> wrote in message
>>> news:je26q8$19oo$1@digitalmars.com...
>>>>
>>>> OT: Why does dmd ignore the pragma(lib, ...) in the etc.c.curl module
>>>> while rdmd seems to recognize it?
>>>
>>> What I think is happening:
>>>
>>> The pragma(lib, ...) causes DMD's -deps=filename option to include the
>>> library file in the dependency list that gets output. RDMD takes that
>>> list
>>> and sends everything in it back to DMD on the command line.
>>> Apperently, DMD
>>> is only forwarding libs to the linker when it receives them on the
>>> command
>>> line (though I don't know why, sounds like a bug to me).
>>
>> Isn't that what it's supposed to do, just forward the lib to the linker?
>>
>
> The only time pragma(lib) works is when the file it's in is provided on
> the command line. rdmd can work around this as it invokes dmd twice,
> there's not a lot that can be done otherwise though.
>

You mean it doesn't work for .di files, I'm aware of that.

http://d.puremagic.com/issues/show_bug.cgi?id=2776

-- 
/Jacob Carlborg
January 06, 2012
Re: CURL question on ubuntuforums.org
On 06/01/2012 13:58, Jacob Carlborg wrote:
>> The only time pragma(lib) works is when the file it's in is provided on
>> the command line. rdmd can work around this as it invokes dmd twice,
>> there's not a lot that can be done otherwise though.
>>
>
> You mean it doesn't work for .di files, I'm aware of that.
>
> http://d.puremagic.com/issues/show_bug.cgi?id=2776

dmd -c a.d
dmd -c b.d
dmd a.d b.d

...

Cue linker errors if A or B has a pragma(lib) in it and relevant extern 
declarations.

-- 
Robert
http://octarineparrot.com/
January 06, 2012
Re: CURL question on ubuntuforums.org
"Robert Clipsham" <robert@octarineparrot.com> wrote in message 
news:je7lcu$1ggl$1@digitalmars.com...
> On 06/01/2012 13:58, Jacob Carlborg wrote:
>>> The only time pragma(lib) works is when the file it's in is provided on
>>> the command line. rdmd can work around this as it invokes dmd twice,
>>> there's not a lot that can be done otherwise though.
>>>
>>
>> You mean it doesn't work for .di files, I'm aware of that.
>>
>> http://d.puremagic.com/issues/show_bug.cgi?id=2776
>
> dmd -c a.d
> dmd -c b.d
> dmd a.d b.d
>
> ...
>
> Cue linker errors if A or B has a pragma(lib) in it and relevant extern 
> declarations.
>

Did you mean that last line to be "dmd a.obj b.obj"?
January 06, 2012
Re: CURL question on ubuntuforums.org
On 06/01/2012 20:35, Nick Sabalausky wrote:
> Did you mean that last line to be "dmd a.obj b.obj"?

Uuurrr, oops. Yes I did, sorry about that.

-- 
Robert
http://octarineparrot.com/
January 06, 2012
Re: CURL question on ubuntuforums.org
"Robert Clipsham" <robert@octarineparrot.com> wrote in message 
news:je7mss$1j23$1@digitalmars.com...
> On 06/01/2012 20:35, Nick Sabalausky wrote:
>> Did you mean that last line to be "dmd a.obj b.obj"?
>
> Uuurrr, oops. Yes I did, sorry about that.
>

I see. Now it makes more sense :)
January 06, 2012
Re: CURL question on ubuntuforums.org
On 2012-01-06 21:26, Robert Clipsham wrote:
> On 06/01/2012 13:58, Jacob Carlborg wrote:
>>> The only time pragma(lib) works is when the file it's in is provided on
>>> the command line. rdmd can work around this as it invokes dmd twice,
>>> there's not a lot that can be done otherwise though.
>>>
>>
>> You mean it doesn't work for .di files, I'm aware of that.
>>
>> http://d.puremagic.com/issues/show_bug.cgi?id=2776
>
> dmd -c a.d
> dmd -c b.d
> dmd a.d b.d
>
> ...
>
> Cue linker errors if A or B has a pragma(lib) in it and relevant extern
> declarations.
>

Oh, yeah, that problem as well.

-- 
/Jacob Carlborg
Next ›   Last »
1 2
Top | Discussion index | About this forum | D home