D Linking library behaviour

bioinfornatics bioinfornatics at fedoraproject.org
Fri Nov 9 04:59:06 PST 2012


On Friday, 9 November 2012 at 10:41:29 UTC, Maxim Fomin wrote:
> On Friday, 9 November 2012 at 09:08:29 UTC, bioinfornatics 
> wrote:
>> On Friday, 9 November 2012 at 08:28:40 UTC, Maxim Fomin wrote:
>>> On Friday, 9 November 2012 at 08:22:53 UTC, bioinfornatics 
>>> wrote:
>>>> Hi,
>>>> ...
>>>
>>> You should create an object file and then make a shared 
>>> library from it.
>>
>> the problem is not how to create a library the command given 
>> below works fine. If i use generate object file with model 
>> FPIC and after create the lib from these file the problem is 
>> same. the generated library has some unused link.
>> Could you do the try with both gdc/ldc to know if that is same?
>
> If I understood right, the problem is in extra linkage. Using 
> your libFoo.d:
> # dmd libFoo.d -c -fPIC
> # gcc libFoo.o --shared -o libFoo.so.1
> # ldd libFoo.so.1
> 	linux-vdso.so.1 (0x00007fff87307000)
> 	libc.so.6 => /lib64/libc.so.6 (0x00007f57b7f50000)
> 	/lib64/ld-linux-x86-64.so.2 (0x00007f57b8517000)
>
> I have no gdc/ldc so I cannot tell which options should you 
> use, but I believe it is possible by using similar method: 
> generating object file and manually creating library from that 
> file.

Thanks good to see that gcc do not put extra link as does ldc



More information about the Digitalmars-d mailing list