[oe] [meta-initramfs][PATCH] kexecboot_0.6: fix build with gcc 5

Khem Raj raj.khem at gmail.com
Sun Oct 4 22:58:58 UTC 2015


On Sun, Oct 4, 2015 at 3:49 PM, Andrea Adami <andrea.adami at gmail.com> wrote:
> On Fri, Sep 25, 2015 at 6:38 AM, Khem Raj <raj.khem at gmail.com> wrote:
>
>> On Thu, Sep 24, 2015 at 2:11 PM, Andrea Adami <andrea.adami at gmail.com>
>> wrote:
>> > On Thu, Sep 24, 2015 at 6:55 AM, Khem Raj <raj.khem at gmail.com> wrote:
>> >
>> >> On Wed, Sep 23, 2015 at 3:29 PM, Andrea Adami <andrea.adami at gmail.com>
>> >> wrote:
>> >> > +-inline void
>> >> > ++extern inline void
>> >>
>> >> would it be better to make it static inline ?
>> >>
>> >
>> > Apparently not...
>>
>> well I meant to move the defintion of this function to header and not
>> just modify the declaration.
>>
>>
> Khem,
>
> what do you think if I simply modify the declaration from inline void to
> void? There is a single definition and it uses inline.
>
> Declaration in rgb.h
> + /* Convert RGBA uint32 to red/green/blue/alpha components */
> +-inline void
> ++void
> + rgba2comp(kx_rgba rgba, kx_ccomp *red, kx_ccomp *green,
> +               kx_ccomp *blue, kx_ccomp *alpha);
>
> Definition in rgb.c is
> ....
> #include "rgb.h"
> #include "rgbtab.h"
>
> inline void
> rgba2comp(kx_rgba rgba, kx_ccomp *red, kx_ccomp *green,
> kx_ccomp *blue, kx_ccomp *alpha)
> {
>         *alpha = (kx_ccomp) (rgba & 0x000000FF);
>         *blue =  (kx_ccomp)((rgba & 0x0000FF00) >> 8);
>         *green = (kx_ccomp)((rgba & 0x00FF0000) >> 16);
>         *red =   (kx_ccomp)((rgba & 0xFF000000) >> 24);
> }
>
> It compiles and if I understand correctly the function will be callable
> from other files. Do you see any drawbacks? This would be a minimal change
> for upstream.
>
> About 'static inline' I think I get what you mean but please note the
> function is only used in one source file so I guess I could just define it
> 'static inline' there (or in a header if it would be used more than once ).
> Do you suggest to modify all the occurrences in the sources?
>

remove the declaration from header if its only used in one source
file. and make the one in source file as static inline
is the function definition in same file as its use ?

> Thanks in advance
> Andrea
>
>
>
>> >
>> > rgba2comp is used in rgb.c and fb.c.
>> > Making it static inline leads to the following error:
>> >
>> > | In file included from
>> >
>> /tmp/build/tmp-glibc/work/poodle-oe-linux-gnueabi/kexecboot/0.6-r0/kexecboot-0.6/fb.h:39:0,
>> > |                  from
>> >
>> /tmp/build/tmp-glibc/work/poodle-oe-linux-gnueabi/kexecboot/0.6-r0/kexecboot-0.6/gui.h:25,
>> > |                  from
>> >
>> /tmp/build/tmp-glibc/work/poodle-oe-linux-gnueabi/kexecboot/0.6-r0/kexecboot-0.6/kexecboot.c:43:
>> > |
>> >
>> /tmp/build/tmp-glibc/work/poodle-oe-linux-gnueabi/kexecboot/0.6-r0/kexecboot-0.6/rgb.h:55:1:
>> > warning: 'rgba2comp' declared 'static' but never defined
>> [-Wunused-function]
>> > |  rgba2comp(kx_rgba rgba, kx_ccomp *red, kx_ccomp *green,
>> > |  ^
>> > | arm-oe-linux-gnueabi-gcc  -march=armv5e -marm  -mthumb-interwork
>> > --sysroot=/tmp/build/tmp-glibc/sysroots/poodle -Wall -O2 -pipe -g
>> > -feliminate-unused-debug-types  -Wl,-O1 -Wl,--hash-style=gnu
>> > -Wl,--as-needed -o kexecboot util.o cfgparser.o devicescan.o evdevs.o
>> fb.o
>> > gui.o menu.o xpm.o rgb.o tui.o kexecboot.o fstype/fstype.o
>> machine/zaurus.o
>> > | fb.o: In function `compose_color':
>> > |
>> >
>> /tmp/build/tmp-glibc/work/poodle-oe-linux-gnueabi/kexecboot/0.6-r0/kexecboot-0.6/fb.c:34:
>> > undefined reference to `rgba2comp'
>> > | collect2: error: ld returned 1 exit status
>> >
>> > BTW, I didn't test that patch compiling with gcc 4 yet. It is just meant
>> as
>> > a fix for gcc 5 w/out  touching much code.
>> > Thanks for your review, suggestions are appreciated!
>> >
>> > Cheers
>> > Andrea
>> > --
>> > _______________________________________________
>> > Openembedded-devel mailing list
>> > Openembedded-devel at lists.openembedded.org
>> > http://lists.openembedded.org/mailman/listinfo/openembedded-devel
>> --
>> _______________________________________________
>> Openembedded-devel mailing list
>> Openembedded-devel at lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-devel
>>
> --
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel



More information about the Openembedded-devel mailing list