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,WEIRD_PORT autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,fea50f781bb229dc X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: About static libraries and Debian policy Date: Sun, 16 May 2010 11:13:47 +0100 Organization: A noiseless patient Spider Message-ID: References: <85f51aeb-cac9-4591-921a-a7f50c8ef142@a21g2000yqn.googlegroups.com> <1pup1z7a4f1pq$.of30sejrqe4m.dlg@40tude.net> <87hbmae33k.fsf@ludovic-brenta.org> <87sk5sdega.fsf@ludovic-brenta.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Sun, 16 May 2010 10:13:50 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="KCXegvZb5vh43D+f3BR6Ew"; logging-data="30054"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19qaDDV8LV8ayQUFSSizxAWF/pbKlc9pyU=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (darwin) Cancel-Lock: sha1:6NEHrpQhy1LYe9g+IrDBHNk6F/U= sha1:UYipWt4aBHHeKhFUxqXonhxTVew= Xref: g2news2.google.com comp.lang.ada:11658 Date: 2010-05-16T11:13:47+01:00 List-Id: Ludovic Brenta writes: > Simon Wright writes on comp.lang.ada: >> Ludovic Brenta writes: >> >>> That's because GNAT GPL includes a non-standard 'libaddr2line.a' >>> produced from binutils (and therefore pure GPL) and calls that to >>> produce the symbolic tracebacks. GCC (from the FSF) lacks this >>> library. I patched GCC to use an alternate mechanism instead, >>> i.e. fork()/exec() and call /usr/bin/addr2line. This restores the >>> functionality in the FSF version of GNAT. >> >> Ludovic, could you point me towards the patch for this? On Mac OS X, we >> don't have addr2line, the equivalent is atos. > > Latest version: > http://green.ada-france.org:8081/revision/file/adfe332edf9057b6de622519fd9161421c5c9c76/debian/patches/ada-symbolic-tracebacks.diff > > HTH Thanks for that, I'm sure it'll help. As an alternative, could use one of the GNAT.OS_Lib.Spawn calls? I notice that towards the end the comment says + -- version dependant variants for the option names. Therefore our + -- implementation spawns a shell script that does normalization of + -- the option and then executes addr2line and communicates with it + -- through a bidirectional pipe. but it looks to me as though it spawns addr2line drectly? + char *const argv[] = { "addr2line", + exe_name, + "--demangle=gnat", + "--functions", + "--basenames", + NULL }; + char *const envp[] = { NULL }; + if (execve("/usr/bin/addr2line", argv, envp) < 0) { + CLOSE1; CLOSE2; + }