lkml.org 
[lkml]   [2020]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [RFC PATCH next-20200930] treewide: Convert macro and uses of __section(foo) to __section("foo")
On Wed, Sep 30, 2020 at 3:06 PM Joe Perches <joe@perches.com> wrote:
>
> On Wed, 2020-09-30 at 14:40 -0700, Nick Desaulniers wrote:
> > On Wed, Sep 30, 2020 at 12:16 PM Joe Perches <joe@perches.com> wrote:
> > > Use a more generic form for __section that requires quotes to avoid
> > > complications with clang and gcc differences.
> > >
> > > Remove the quote operator # from compiler_attributes.h __section macro.
> > >
> > > Convert all unquoted __section(foo) uses to quoted __section("foo").
> > > Also convert __attribute__((section("foo"))) uses to __section("foo")
> > > even if the __attribute__ has multiple list entry forms.
> > >
> > > Signed-off-by: Joe Perches <joe@perches.com>
> > > ---
> > >
> > > This is the current output from the script against next-20200930
> > > attached in this link:
> > >
> > > https://lore.kernel.org/lkml/0e582a7f5144a33f465978d97701f9b3dcc377f3.camel@perches.com/
> > >
> > > It might be useful to run the script immediately before
> > > the next -rc1.
> >
> > $ ARCH=powerpc CROSS_COMPILE=powerpc64le-linux-gnu- make CC=clang -j71
> > powernv_defconfig
> > $ ARCH=powerpc CROSS_COMPILE=powerpc64le-linux-gnu- make CC=clang -j71
> > ...
> > arch/powerpc/boot/main.c:193:44: error: expected ';' after top level declarator
> > static char cmdline[BOOT_COMMAND_LINE_SIZE]
>
> The script does not convert files in
>
> scripts/
> tools/
> uapi/
> and include/linux/compiler_attributes.h
>
> It otherwise assumes that any __attribute__((__section__
> use should be converted to __section.
>
> If this ppc file is the only file outside of the
> listed exclusions, I can either exclude it directly
> or add compiler.h to it.
>
> You have a preference?

If compiler_types.h which includes compiler_attributes.h is being
implicitly including by Kbuild add `-include` flags to most
translation units in the kernel, it would be nice to be able to use it
everywhere. I consider open coded __attribute__'s a portability bug.
So including the header in arch/powerpc/boot/*.c would be my
preference.

>
> Perhaps these are also possible files that need exclusions:
>
> ./arch/x86/boot/video.h:#define __videocard struct card_info __section(".videocards") __attribute__((used))
> ./arch/x86/boot/compressed/pgtable_64.c:unsigned long *trampoline_32bit __section(".data");
> ./arch/x86/boot/tty.c:static void __section(".inittext") serial_putchar(int ch)
> ./arch/x86/boot/tty.c:static void __section(".inittext") bios_putchar(int ch)
> ./arch/x86/boot/tty.c:void __section(".inittext") putchar(int ch)
> ./arch/x86/boot/tty.c:void __section(".inittext") puts(const char *str)
> ./arch/s390/boot/startup.c:static struct diag210 _diag210_tmp_dma __section(".dma.data");
> ./arch/powerpc/boot/main.c: __section("__builtin_cmdline");
> ./arch/powerpc/boot/ps3.c: __section("__builtin_cmdline");
>
>


--
Thanks,
~Nick Desaulniers

\
 
 \ /
  Last update: 2020-10-01 00:23    [W:0.114 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site