[Scons-dev] SCons, D, and shared objects

Bill Deegan bill at baddogconsulting.com
Wed Jun 21 10:23:57 EDT 2017


Would this apply only to shared objects built from D source code?
Or would it have to apply to all shared object whether built from c/c++ or
D ?



On Wed, Jun 21, 2017 at 3:39 AM, Russel Winder <russel at winder.org.uk> wrote:

> In the beginning, DMD always created statically linked executables and
> static libraries. Go has gone that route as well. However to interwork
> with C and C++, D has had to embrace shared objects. I had begun to
> hack something together in the dmd, ldc, and gdc tools sometime back.
> Now for SCons 3.0 I'd like to have it working properly. On Linux and
> UNIX with dmd and ldc anyway. OSX and macOS remain a problem for dmd,
> and gdc hasn't really caught up yet.
>
> There is a problem.
>
> The C and C++ tools assume that on Linux for shared libraries creation,
> the objects should have the extension .os instead of .o. The D
> compilers do not accept this, they demand .o extension. So what is the
> problem? SHOBJSUFFIX. This is a global value shared by all tools. The
> default is .o. One of the C or C++ compiler tools sets it to .os. This
> is not a problem for builds that explicitly declare environments and
> limit the tools to D tools – which is what I do for all my builds which
> is why the problem has only recent;y come to light. If you use not
> envronment or a new environment with no tools specification you get all
> the tools and so the extension is forced to .os and all D compilations
> for shared libraries fail.
>
> So my problem is how to incorporate a SHDOBJSUFFIX so as to separate D
> builds to work around this problem. What I need to know is where the
> TARGET symbol is construction so I can create a variant of the default
> for the D tooling. All the compilation commands rely on TARGET and
> SOURCE and TARGET appears always to use SHOBJSUFFIX for shared object
> building.
>
> Sorry about the long explanation. I am hoping that I have just missed
> something very simple, and that someone can tell me what this is – or
> at least point me int he right direction.
>
> --
> Russel.
> ============================================================
> =================
> Dr Russel Winder      t: +44 20 7585 2200   voip:
> sip:russel.winder at ekiga.net
> 41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at winder.org.uk
> London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
> _______________________________________________
> Scons-dev mailing list
> Scons-dev at scons.org
> https://pairlist2.pair.net/mailman/listinfo/scons-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist2.pair.net/pipermail/scons-dev/attachments/20170621/a3b92206/attachment-0001.html>


More information about the Scons-dev mailing list