Patchwork Backtrace library [1/3]

login
register
mail settings
Submitter Ian Taylor
Date Sept. 13, 2012, 4:59 a.m.
Message ID <CAKOQZ8wb794pF3kpDVaFTqL2ghf-1w1=wVMKiBd9nURiRDXCbQ@mail.gmail.com>
Download mbox | patch
Permalink /patch/183493/
State New
Headers show

Comments

Ian Taylor - Sept. 13, 2012, 4:59 a.m.
On Wed, Sep 12, 2012 at 2:04 PM, Joseph S. Myers
<joseph@codesourcery.com> wrote:
> On Wed, 12 Sep 2012, Ian Lance Taylor wrote:
>
>> On Wed, Sep 12, 2012 at 9:23 AM, Joseph S. Myers
>> <joseph@codesourcery.com> wrote:
>> > On Tue, 11 Sep 2012, Ian Lance Taylor wrote:
>> >
>> >> The configury is fairly standard.  Note that libbacktrace is built as
>> >> both a host library (to link into the compilers) and as a target library
>> >> (to link into libgo and possibly other libraries).
>> >
>> > Under what circumstances will the library be built for the target - only
>> > if a relevant language such as Go is being built, or unconditionally?
>>
>> My intent is to only build it when something needs it, e.g., libgo.  I
>> don't know if I've expressed that intent correctly.
>
> I think that if a library is listed in target_libs in config-lang.in for
> at least one language, and if all languages with it so listed are
> disabled, then that library will be disabled - but if no languages list it
> in config-lang.in, it will be enabled by default.

Looks right.  If libbacktrace is approved and committed, I will
included this patch to gcc/go/config-lang.in.  I tested that it indeed
causes libbacktrace to be built only for the host, not for the target,
when not building Go.

Ian

Patch

Index: gcc/go/config-lang.in
===================================================================
--- gcc/go/config-lang.in	(revision 191171)
+++ gcc/go/config-lang.in	(working copy)
@@ -28,7 +28,7 @@  language="go"

 compilers="go1\$(exeext)"

-target_libs="target-libgo target-libffi"
+target_libs="target-libgo target-libffi target-libbacktrace"

 # The Go frontend is written in C++, so we need to build the C++
 # compiler during stage 1.