Bug creation and email sending has been disabled, file new bugs at gcc.gnu.org/bugzilla
Bug 153 - add option to list all libraries from pragma(lib, "...")
Summary: add option to list all libraries from pragma(lib, "...")
Status: NEW
Alias: None
Product: GDC
Classification: Unclassified
Component: gdc (show other bugs)
Version: development
Hardware: All Linux
: --- enhancement
Assignee: Iain Buclaw
URL:
Depends on:
Blocks:
 
Reported: 2014-08-19 05:15 CEST by Ketmar Dark
Modified: 2014-08-20 10:58 CEST (History)
1 user (show)

See Also:


Attachments
quick-and-dirty hack that adds option -fwrite-pragma-libs= (2.82 KB, patch)
2014-08-19 06:16 CEST, Ketmar Dark
Details | Diff
new quick-and-dirty patch (2.86 KB, patch)
2014-08-20 10:58 CEST, Ketmar Dark
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ketmar Dark 2014-08-19 05:15:38 CEST
i fully understand that full support for pragma(lib) is nearly impossible. but can we at least add CLI flag that will instruct compiler to write all libraries from that pragma to some file during compilation?

this way build tools can pass something like "-fwrite-pragma-lib-to=linklibssmth" and then invoke linker with -Wl,@linklibssmth

build tool can create this files for each compiled module and then pass 'em all to linker.

this is far from full supporting of pragma(lib), but it at least will allow build tools to extract, cache and use that info without built-in (or external) D parser.

and gdc should do it during 'real' compilation to avoid execing gdc second time just to obtain this info. we always can do 'gdc -c -o /dev/null' if we want only info w/o object files.
Comment 1 Ketmar Dark 2014-08-19 06:16:16 CEST
Created attachment 75 [details]
quick-and-dirty hack that adds option -fwrite-pragma-libs=

i attached a very quick and dirty hack that implements my proposal. my own build system already uses it, and i'm really happy. ;-)
Comment 2 Ketmar Dark 2014-08-19 06:19:23 CEST
p.s. seems that this should go to DMD bugtracker (as it touches frontend too), but i'm pretty sure that it will be rejected. ;-)
Comment 3 Iain Buclaw 2014-08-20 09:53:37 CEST
This can be done instead in the backend, so that is OK.  (Bonus points, no need for a frontend global.option flag either)
Comment 4 Ketmar Dark 2014-08-20 10:58:54 CEST
Created attachment 76 [details]
new quick-and-dirty patch

oh, yes, i'm soooo stupid. here is new patch which touches only backend. additionally, it emits more informative warning if there is no "-fwrite-pragma-libs=" option and no warning at all if the option is given.