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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.albasani.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Bill Findlay Newsgroups: comp.lang.ada Subject: Re: Ada interacting with Windows 8.1+ GUI Date: Fri, 26 Oct 2018 13:52:17 +0100 Organization: none Message-ID: <0001HW.218345810081A9777000053542EF@news.individual.net> References: <5fb88cf6-47da-4c28-a660-9ddf06522b12@googlegroups.com> <5b897611-5e95-4bc8-b5b9-a8df97299cd6@googlegroups.com> <61c2515d-29fd-4b96-8138-88d7f5419fb5@googlegroups.com> Reply-To: findlaybill@blueyonder.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: individual.net 8e+xoprobDmMWZcMGduxjAjwt1Mp+Z9tRHQ0aKz8CqQBTHxrK5 X-Orig-Path: not-for-mail Cancel-Lock: sha1:8Fjec/mIL9hsFPNu8sSy1iQq0A4= User-Agent: Hogwasher/5.19 Xref: reader02.eternal-september.org comp.lang.ada:54715 Date: 2018-10-26T13:52:17+01:00 List-Id: 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: -Wl,--gc-sections -Wl,--as-needed ? -- Bill Findlay