* [U-Boot] GCC 5.x compile errors
@ 2015-06-30 22:02 ANDY KENNEDY
2015-07-01 5:53 ` Albert ARIBAUD
0 siblings, 1 reply; 3+ messages in thread
From: ANDY KENNEDY @ 2015-06-30 22:02 UTC (permalink / raw)
To: u-boot
Attempted to build u-boot with gcc 5.x for mipsel 32. Result was that
I get brokenness around arch/mips/include/asm/io.h and
arch/mips/include/asm/system.h. The source lines all look something
like:
extern inline void func()
{
func text ;
}
Question: Is that valid C text? I have never seen such. Also, what
does this mean from a header file? The way I read this is
extern = the following declare exists in global space (no code here)
inline = use this function definition in line in place of creating a
text ref section
I would expect these two to be mutually exclusive????
Please enlighten me!
Thanks,
Andy
^ permalink raw reply [flat|nested] 3+ messages in thread* [U-Boot] GCC 5.x compile errors
2015-06-30 22:02 [U-Boot] GCC 5.x compile errors ANDY KENNEDY
@ 2015-07-01 5:53 ` Albert ARIBAUD
2015-07-01 14:43 ` Daniel Schwierzeck
0 siblings, 1 reply; 3+ messages in thread
From: Albert ARIBAUD @ 2015-07-01 5:53 UTC (permalink / raw)
To: u-boot
Hello ANDY,
On Tue, 30 Jun 2015 22:02:38 +0000, ANDY KENNEDY
<ANDY.KENNEDY@adtran.com> wrote:
> Attempted to build u-boot with gcc 5.x for mipsel 32. Result was that
> I get brokenness around arch/mips/include/asm/io.h and
> arch/mips/include/asm/system.h. The source lines all look something
> like:
>
> extern inline void func()
> {
> func text ;
> }
>
> Question: Is that valid C text? I have never seen such. Also, what
> does this mean from a header file? The way I read this is
>
> extern = the following declare exists in global space (no code here)
>
> inline = use this function definition in line in place of creating a
> text ref section
>
> I would expect these two to be mutually exclusive????
>
> Please enlighten me!
Actually, extern vs static takes a meaning for inline functions
different from the one for traditional non-inline ones.
"If you specify both inline and extern in the function
definition, then the definition is used only for inlining.
In no case is the function compiled on its own, not even
if you refer to its address explicitly. Such an address
becomes an external reference, as if you had only declared
the function, and had not defined it."
See https://gcc.gnu.org/onlinedocs/gcc/Inline.html for all the gory
details on inline functions (this is for the latest version; if you're
working with a specific, older, gcc version, look up the corresponding
page, in case subtle changes were introduced).
> Thanks,
> Andy
Amicalement,
--
Albert.
^ permalink raw reply [flat|nested] 3+ messages in thread* [U-Boot] GCC 5.x compile errors
2015-07-01 5:53 ` Albert ARIBAUD
@ 2015-07-01 14:43 ` Daniel Schwierzeck
0 siblings, 0 replies; 3+ messages in thread
From: Daniel Schwierzeck @ 2015-07-01 14:43 UTC (permalink / raw)
To: u-boot
Am 01.07.2015 um 07:53 schrieb Albert ARIBAUD:
> Hello ANDY,
>
> On Tue, 30 Jun 2015 22:02:38 +0000, ANDY KENNEDY
> <ANDY.KENNEDY@adtran.com> wrote:
>> Attempted to build u-boot with gcc 5.x for mipsel 32. Result was that
>> I get brokenness around arch/mips/include/asm/io.h and
>> arch/mips/include/asm/system.h. The source lines all look something
>> like:
>>
>> extern inline void func()
>> {
>> func text ;
>> }
>>
>> Question: Is that valid C text? I have never seen such. Also, what
>> does this mean from a header file? The way I read this is
>>
>> extern = the following declare exists in global space (no code here)
>>
>> inline = use this function definition in line in place of creating a
>> text ref section
>>
>> I would expect these two to be mutually exclusive????
>>
>> Please enlighten me!
>
> Actually, extern vs static takes a meaning for inline functions
> different from the one for traditional non-inline ones.
>
> "If you specify both inline and extern in the function
> definition, then the definition is used only for inlining.
> In no case is the function compiled on its own, not even
> if you refer to its address explicitly. Such an address
> becomes an external reference, as if you had only declared
> the function, and had not defined it."
>
> See https://gcc.gnu.org/onlinedocs/gcc/Inline.html for all the gory
> details on inline functions (this is for the latest version; if you're
> working with a specific, older, gcc version, look up the corresponding
> page, in case subtle changes were introduced).
>
the kernel changed it all to "static inline" long time ago. We should do
the same. I'll send a patch to fix it.
--
- Daniel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-07-01 14:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-30 22:02 [U-Boot] GCC 5.x compile errors ANDY KENNEDY
2015-07-01 5:53 ` Albert ARIBAUD
2015-07-01 14:43 ` Daniel Schwierzeck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox