Jump to page: 1 2 3
Thread overview
[phobos] 32 and 64 bit libraries on Linux
Jan 03, 2011
Walter Bright
Jan 03, 2011
Jonathan M Davis
Jan 03, 2011
Walter Bright
Jan 03, 2011
Michel Fortin
Jan 03, 2011
Walter Bright
Jan 04, 2011
Michel Fortin
Jan 03, 2011
Brad Roberts
Jan 03, 2011
Walter Bright
Jan 03, 2011
Jesse Phillips
Jan 04, 2011
Walter Bright
Jan 04, 2011
Walter Bright
Jan 04, 2011
Walter Bright
Jan 04, 2011
Russel Winder
Jan 04, 2011
Walter Bright
Jan 04, 2011
Jonathan M Davis
Jan 04, 2011
Walter Bright
Jan 05, 2011
Jonathan M Davis
Jan 05, 2011
Walter Bright
Jan 08, 2011
Walter Bright
Jan 08, 2011
Jonathan M Davis
Jan 05, 2011
Jens Mueller
Jan 04, 2011
Russel Winder
January 03, 2011
Currently, dmd simply looks for libphobos.a

I suggest changing it to:

    lib32/libphobos.a    for -m32
    lib64/libphobos.a    for -m64
January 03, 2011
On Monday 03 January 2011 14:48:38 Walter Bright wrote:
> Currently, dmd simply looks for libphobos.a
> 
> I suggest changing it to:
> 
>     lib32/libphobos.a    for -m32
>     lib64/libphobos.a    for -m64

I assume that that's within the file hierarchy in the zip file? The correct directories for those varies from distribution to distribution if you're talking about /lib, /usr/lib, or /usr/local/lib. Some distros have lib for 32-bit and 64-bit. Others do lib for 64-bit and lib32 for 32-bit. However, any that have both lib32 and lib64 are going to have lib as well with either lib being a symlink to one of the other two or one of the other two being a symlink to lib.

- Jonathan M Davis
January 03, 2011
How will this interact with the config files?

I do think we should ship with both.  Even if it's only useful for us developers, I want it to be easier to use both side by side.

On Jan 3, 2011, at 2:48 PM, Walter Bright <walter at digitalmars.com> wrote:

> Currently, dmd simply looks for libphobos.a
>
> I suggest changing it to:
>
>   lib32/libphobos.a    for -m32
>   lib64/libphobos.a    for -m64
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos
January 03, 2011

Jonathan M Davis wrote:
> On Monday 03 January 2011 14:48:38 Walter Bright wrote:
> 
>> Currently, dmd simply looks for libphobos.a
>>
>> I suggest changing it to:
>>
>>     lib32/libphobos.a    for -m32
>>     lib64/libphobos.a    for -m64
>> 
>
> I assume that that's within the file hierarchy in the zip file? The correct directories for those varies from distribution to distribution if you're talking about /lib, /usr/lib, or /usr/local/lib. Some distros have lib for 32-bit and 64-bit. Others do lib for 64-bit and lib32 for 32-bit. However, any that have both lib32 and lib64 are going to have lib as well with either lib being a symlink to one of the other two or one of the other two being a symlink to lib.
>
> 

I figure the lib32 and lib64 directories being subdirectories of the directory they are installed in - i.e. dmd will search for lib32/libphobos.a or lib64/libphobos.a


January 03, 2011

Brad Roberts wrote:
> How will this interact with the config files?

The config files should point at a directory. lib32 and lib64 should be subdirectories of that.

>
> I do think we should ship with both.  Even if it's only useful for us developers, I want it to be easier to use both side by side.

Yes.

>
>
> On Jan 3, 2011, at 2:48 PM, Walter Bright <walter at digitalmars.com> wrote:
>
>> Currently, dmd simply looks for libphobos.a
>>
>> I suggest changing it to:
>>
>>   lib32/libphobos.a    for -m32
>>   lib64/libphobos.a    for -m64
>> _______________________________________________
>> phobos mailing list
>> phobos at puremagic.com
>> http://lists.puremagic.com/mailman/listinfo/phobos
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos
>
>
January 03, 2011
Le 2011-01-03 ? 18:00, Jonathan M Davis a ?crit :

> On Monday 03 January 2011 14:48:38 Walter Bright wrote:
>> Currently, dmd simply looks for libphobos.a
>> 
>> I suggest changing it to:
>> 
>>    lib32/libphobos.a    for -m32
>>    lib64/libphobos.a    for -m64
> 
> I assume that that's within the file hierarchy in the zip file? The correct directories for those varies from distribution to distribution if you're talking about /lib, /usr/lib, or /usr/local/lib. Some distros have lib for 32-bit and 64-bit. Others do lib for 64-bit and lib32 for 32-bit. However, any that have both lib32 and lib64 are going to have lib as well with either lib being a symlink to one of the other two or one of the other two being a symlink to lib.

And on OS X, multiple architectures are generally merged in the same library/executable file as a "fat" or "universal" binary. Use the command "lipo" to create one.

A naming change like this would break D for Xcode. So I'll have to release a new version and to keep it backward compatible for those who stick with older versions of DMD I'd have some detection job to do. On the other hand, creating a fat library using "lipo" wouldn't cause any disruption...

-- 
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/



January 03, 2011

Michel Fortin wrote:
> Le 2011-01-03 ? 18:00, Jonathan M Davis a ?crit :
>
> 
>> On Monday 03 January 2011 14:48:38 Walter Bright wrote:
>> 
>>> Currently, dmd simply looks for libphobos.a
>>>
>>> I suggest changing it to:
>>>
>>>    lib32/libphobos.a    for -m32
>>>    lib64/libphobos.a    for -m64
>>> 
>> I assume that that's within the file hierarchy in the zip file? The correct
>> directories for those varies from distribution to distribution if you're talking
>> about /lib, /usr/lib, or /usr/local/lib. Some distros have lib for 32-bit and
>> 64-bit. Others do lib for 64-bit and lib32 for 32-bit. However, any that have
>> both lib32 and lib64 are going to have lib as well with either lib being a
>> symlink to one of the other two or one of the other two being a symlink to lib.
>> 
>
> And on OS X, multiple architectures are generally merged in the same library/executable file as a "fat" or "universal" binary. Use the command "lipo" to create one.
>
> A naming change like this would break D for Xcode. So I'll have to release a new version and to keep it backward compatible for those who stick with older versions of DMD I'd have some detection job to do. On the other hand, creating a fat library using "lipo" wouldn't cause any disruption...
>
> 

Doing 64 bit OSX is a bit down the road. I don't think Linux supports such fat libraries.
January 03, 2011
On Mon, Jan 3, 2011 at 3:19 PM, Walter Bright <walter at digitalmars.com> wrote:
>
>
> Brad Roberts wrote:
>>
>> How will this interact with the config files?
>
> The config files should point at a directory. lib32 and lib64 should be subdirectories of that.

Why don't we have something similar to GCC. -lphobos

Ignoring /usr/lib32/libphobos.a: wrong architecture.

I don't know exactly where all this information is, but I believe it is something like this:

* provide paths to where libraries are
* convert -lphobos to libphobos.a and libphobos.so
* search for those files in the library paths (recursive I believe)
* ignore libraries meant for a different architecture

The second step isn't needed since libphobos.a is always what is looked for. I think the linker already ignores libraries of the wrong architecture.
January 03, 2011
Le 2011-01-03 ? 18:49, Walter Bright a ?crit :

> Michel Fortin wrote:
>> And on OS X, multiple architectures are generally merged in the same library/executable file as a "fat" or "universal" binary. Use the command "lipo" to create one.
>> 
>> A naming change like this would break D for Xcode. So I'll have to release a new version and to keep it backward compatible for those who stick with older versions of DMD I'd have some detection job to do. On the other hand, creating a fat library using "lipo" wouldn't cause any disruption...
> 
> Doing 64 bit OSX is a bit down the road. I don't think Linux supports such fat libraries.

Right. But what I should have said is that changing the path for the 32 bit version can easily disrupt existing toolchains. For instance, someone who wants to link both C, C++ and D code together is likely not using DMD as the driver for the linker, which implies the use of a hard-coded path to phobos; in this case changing the library's path will break things.

An option would be to keep the 32-bit version as is, and put the 64-bit version in lib64. Or you could add a symlink lib/libphobos.a pointing to lib32/libpobos.a which would keep things working as before.

Or, on the other hand, people like me can also update the toolchain (in my case that'd be when the Mac OS X version is ready).

-- 
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/



January 03, 2011

Jesse Phillips wrote:
>
> I think the linker already ignores libraries of the wrong architecture.
>
> 

No, it barfs on it.
« First   ‹ Prev
1 2 3