[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: error compiling GUI - string constants
From: |
David Chisnall |
Subject: |
Re: error compiling GUI - string constants |
Date: |
Fri, 28 Jul 2017 13:40:47 +0100 |
On 28 Jul 2017, at 13:16, Ivan Vučica <address@hidden> wrote:
>
> Isn't it this? I'm intentionally grabbing an older version - I'm not sure
> which is the oldest GCC we support, but 3.4.5 documents alias:
>
> https://gcc.gnu.org/onlinedocs/gcc-3.4.5/gcc/Function-Attributes.html
>
> Quoting:
>
> =====
> alias ("target")
> The alias attribute causes the declaration to be emitted as an alias for
> another symbol, which must be specified. For instance,
> void __f () { /* Do something.
> */; }
> void f () __attribute__ ((weak, alias ("__f")));
>
>
> declares `f' to be a weak alias for `__f'. In C++, the mangled name for the
> target must be used.
>
> Not all target machines support this attribute.
>
> ====
It’s documented as a function attribute. It kind-of works as a variable
attribute, but probably doesn’t.
> Though, again, as I asked before: why do we want this?
>
> I'm not sure we *need* anything more than the macro. Wouldn't we need this
> extra symbol only if we care about better binary compat (maybe for Darling's
> sake)?
It also helps bridging from other languages. Macros as a colossal pain to
expose over FFIs, public symbols are trivial. dlsym works if it’s an alias,
doesn’t work if it’s a macro.
David
Re: error compiling GUI - string constants, Josh Freeman, 2017/07/26
- Re: error compiling GUI - string constants, David Chisnall, 2017/07/27
- Re: error compiling GUI - string constants, Fred Kiefer, 2017/07/27
- Re: error compiling GUI - string constants, David Chisnall, 2017/07/28
- Re: error compiling GUI - string constants, Ivan Vučica, 2017/07/28
- Re: error compiling GUI - string constants,
David Chisnall <=
- Re: error compiling GUI - string constants, Ivan Vučica, 2017/07/28