From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Ada interacting with Windows 8.1+ GUI Date: Fri, 26 Oct 2018 14:42:24 +0100 Organization: A noiseless patient Spider Message-ID: References: <5fb88cf6-47da-4c28-a660-9ddf06522b12@googlegroups.com> <5b897611-5e95-4bc8-b5b9-a8df97299cd6@googlegroups.com> <61c2515d-29fd-4b96-8138-88d7f5419fb5@googlegroups.com> <0001HW.218345810081A9777000053542EF@news.individual.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="61a52a3a2bba14e91e699bf7dc753aa2"; logging-data="15748"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+lXAkQiVw60zvQ8bDXMkmp+3nExfFlpoc=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (darwin) Cancel-Lock: sha1:MSEJnQKg0v7NXjFP05Q5l0T5JXk= sha1:B4C0kpDXjR3BoNC9lKZEpJ0FwyA= Xref: reader02.eternal-september.org comp.lang.ada:54716 Date: 2018-10-26T14:42:24+01:00 List-Id: Bill Findlay writes: > On 26 Oct 2018, Simon Wright wrote > (in article ): > >> joakimds@kth.se writes: >> >> > Isn't it easy for the compiler to optimize away/remove the code that >> > is not used? >> >> Not so much in a library package where some subprograms don't have to be >> used by the overall program. >> >> You can compile with -ffunction-sections -fdata-sections which say each >> subprogram/data object resp. is to have its own section. If your linker >> supports (the equivalent of) -gc-sections. linking with it means that >> only the used sections get linked. This is fine for (arm-eabi) embedded >> systems & (probably) Linux. which use GNU ld, but not on macOS. Can't >> say for Windows. >> >> GNAT provides gnatelim, which analyses your code and (?) regenerates it >> without the unused objects. No idea how well this works. > > Does : > > -Wl,-dead_strip -Wl,-dead_strip > > not work on macOS instead of: I don't think you have to say it twice! - but, yes, thanks > -Wl,--gc-sections -Wl,--as-needed I wasn't aware of --as-needed. Seems only to eliminate whole shared libraries, not an issue on arm-eabi!