Thread overview
Re: Object file extensions
Jan 21, 2014
Brad Roberts
Jan 21, 2014
H. S. Teoh
Jan 21, 2014
Brad Roberts
Jan 22, 2014
Russel Winder
January 21, 2014
On 1/21/14 10:38 AM, Russel Winder wrote:
> The tradition (AIUI) on Linux is for PIC object files to have
> extension .os. DMD however refuses to recognize this extension. Is this
> something to fix?
>

That's not a naming convention I've ever seen.  Is it something that maybe libtool does under the covers?
January 21, 2014
On Tue, Jan 21, 2014 at 12:29:56PM -0800, Walter Bright wrote:
> On 1/21/2014 10:38 AM, Russel Winder wrote:
> >The tradition (AIUI) on Linux is for PIC object files to have extension .os. DMD however refuses to recognize this extension. Is this something to fix?
> 
> Hmm, I've never heard of that tradition! And:
> 
>     cc foo.c -c -fPIC
> 
> generates foo.o, not foo.os (on Ubuntu).

I would've thought it was .so, not .os. Perhaps a typo on the part of the OP?


T

-- 
Nearly all men can stand adversity, but if you want to test a man's character, give him power. -- Abraham Lincoln
January 21, 2014
On 1/21/14 12:36 PM, H. S. Teoh wrote:
> On Tue, Jan 21, 2014 at 12:29:56PM -0800, Walter Bright wrote:
>> On 1/21/2014 10:38 AM, Russel Winder wrote:
>>> The tradition (AIUI) on Linux is for PIC object files to have
>>> extension .os. DMD however refuses to recognize this extension. Is this
>>> something to fix?
>>
>> Hmm, I've never heard of that tradition! And:
>>
>>      cc foo.c -c -fPIC
>>
>> generates foo.o, not foo.os (on Ubuntu).
>
> I would've thought it was .so, not .os. Perhaps a typo on the part of
> the OP?

Not for the object file coming out of the compiler.  Shared libraries are produced by the librarian (ld, link, etc).

January 22, 2014
On Tue, 2014-01-21 at 18:38 +0000, Russel Winder wrote:
> The tradition (AIUI) on Linux is for PIC object files to have extension .os. DMD however refuses to recognize this extension. Is this something to fix?

Hummm… clearly I only use SCons for compiling and thus over-inferred.

For platforms that have PIC and non-PIC compilation, SCons uses .o for non-PIC and .os for PIC so that you can compile for shared and static libraries concurrently in the same tree. Waf and CMake have other conventions for handling this: they don't ;-)

I have changed the SCons D builder to only use .o extension even though the .o/.os is used for C, C++ and Fortran. This is sad as I am trying to get D in as a peer of these rather than second class citizen.

-- 
Russel. ============================================================================= Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder@ekiga.net 41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel@winder.org.uk London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder