View mode: basic / threaded / horizontal-split · Log in · Help
February 23, 2012
SONAME and D
dear,
for set soname with:
- gdc: -Xlinker -soname myLib.so.1
- ldc2: -soname myLib.so.1
- dmd: ?

someone know how set soname with dmd ?
February 23, 2012
Re: SONAME and D
On 02/23/2012 05:27 PM, bioinfornatics wrote:
> dear,
> for set soname with:
> - gdc: -Xlinker -soname myLib.so.1
> - ldc2: -soname myLib.so.1
> - dmd: ?
>
> someone know how set soname with dmd ?
>

dmd -L-soname=mylib.so.1

-- 
Mike Wey
February 23, 2012
Re: SONAME and D
Le jeudi 23 février 2012 à 19:46 +0100, Mike Wey a écrit :
> On 02/23/2012 05:27 PM, bioinfornatics wrote:
> > dear,
> > for set soname with:
> > - gdc: -Xlinker -soname myLib.so.1
> > - ldc2: -soname myLib.so.1
> > - dmd: ?
> >
> > someone know how set soname with dmd ?
> >
> 
> dmd -L-soname=mylib.so.1
> 

Thanks
i will do so a $(SONAME_FLAG) in my makefile and maybe i will do a pull
request for gtkd because ldc do not use -L-soname instead of dmd
February 24, 2012
Re: SONAME and D
Al 23/02/12 20:29, En/na bioinfornatics ha escrit:
> Le jeudi 23 février 2012 à 19:46 +0100, Mike Wey a écrit :
>> On 02/23/2012 05:27 PM, bioinfornatics wrote:
>>> dear,
>>> for set soname with:
>>> - gdc: -Xlinker -soname myLib.so.1
>>> - ldc2: -soname myLib.so.1
>>> - dmd: ?
>>>
>>> someone know how set soname with dmd ?
>>>
>>
>> dmd -L-soname=mylib.so.1
>>
> 
> Thanks
> i will do so a $(SONAME_FLAG) in my makefile and maybe i will do a pull
> request for gtkd because ldc do not use -L-soname instead of dmd
> 
> 

Are you able to build dynamic libraries directly with DMD?
How?
-- 
Jordi Sayol
February 24, 2012
Re: SONAME and D
Am 24.02.2012 11:40, schrieb Jordi Sayol:
> Al 23/02/12 20:29, En/na bioinfornatics ha escrit:
>> Le jeudi 23 février 2012 à 19:46 +0100, Mike Wey a écrit :
>>> On 02/23/2012 05:27 PM, bioinfornatics wrote:
>>>> dear,
>>>> for set soname with:
>>>> - gdc: -Xlinker -soname myLib.so.1
>>>> - ldc2: -soname myLib.so.1
>>>> - dmd: ?
>>>>
>>>> someone know how set soname with dmd ?
>>>>
>>>
>>> dmd -L-soname=mylib.so.1
>>>
>>
>> Thanks
>> i will do so a $(SONAME_FLAG) in my makefile and maybe i will do a pull
>> request for gtkd because ldc do not use -L-soname instead of dmd
>>
>>
>
> Are you able to build dynamic libraries directly with DMD?
> How?
-shared        generate shared library
February 24, 2012
Re: SONAME and D
Al 24/02/12 11:59, En/na David ha escrit:
>>
>> Are you able to build dynamic libraries directly with DMD?
>> How?
> -shared        generate shared library
> 

I got this:
$ dmd -fPIC -shared foo.d 
/usr/bin/ld: /usr/lib/libphobos2.a(minfo.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC
/usr/lib/libphobos2.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
--- errorlevel 1

-- 
Jordi Sayol
February 24, 2012
Re: SONAME and D
Al 24/02/12 11:59, En/na David ha escrit:
>>
>> Are you able to build dynamic libraries directly with DMD?
>> How?
> -shared        generate shared library
> 

It compiles to 32-bit but fails for 64-bit, maybe due to compiled libphobos2 (64-bit) without -fPIC argument?

Another thing.
$ dmd -fPIC -shared foo.d -m32 -offoo.so.0.0.1
generate the incorrect "foo.so.0.0.so" file name.

but with:
$ dmd -fPIC -shared foo.d -m32 -L-ofoo.so.0.0.1
the correct "foo.so.0.0.1" file name is created.

Best regards,
-- 
Jordi Sayol
February 24, 2012
Re: SONAME and D
On 02/23/2012 08:29 PM, bioinfornatics wrote:
> Le jeudi 23 février 2012 à 19:46 +0100, Mike Wey a écrit :
>> On 02/23/2012 05:27 PM, bioinfornatics wrote:
>>> dear,
>>> for set soname with:
>>> - gdc: -Xlinker -soname myLib.so.1
>>> - ldc2: -soname myLib.so.1
>>> - dmd: ?
>>>
>>> someone know how set soname with dmd ?
>>>
>>
>> dmd -L-soname=mylib.so.1
>>
>
> Thanks
> i will do so a $(SONAME_FLAG) in my makefile and maybe i will do a pull
> request for gtkd because ldc do not use -L-soname instead of dmd
>

The GtkD Makefile uses:

$(LINKERFLAG)-soname=$@.$(call stripBugfix,$(SO_VERSION))

Witch works with all the compilers, $(LINKERFLAG) is either -L or 
-Xlinker (with a space on th end).

-- 
Mike Wey
February 24, 2012
Re: SONAME and D
On 02/24/2012 06:27 AM, Jordi Sayol wrote:
>
> It compiles to 32-bit but fails for 64-bit, maybe due to compiled libphobos2 (64-bit) without -fPIC argument?
>

What? -shared works with 32-bit?

Holy crap, it does! this is awesome!

maybe make a bug report for 64 bit?
February 24, 2012
Re: SONAME and D
Al 24/02/12 20:21, En/na Ellery Newcomer ha escrit:
> On 02/24/2012 06:27 AM, Jordi Sayol wrote:
>>
>> It compiles to 32-bit but fails for 64-bit, maybe due to compiled libphobos2 (64-bit) without -fPIC argument?
>>
> 
> What? -shared works with 32-bit?
> 
> Holy crap, it does! this is awesome!
> 
> maybe make a bug report for 64 bit?
> 

better wait till libphobos2.a becomes libphobos2.so

-- 
Jordi Sayol
« First   ‹ Prev
1 2
Top | Discussion index | About this forum | D home