# git rev-parse -q --verify 1619b69edce14c4a4665fa8ff4c587dcc77202a9^{commit} 1619b69edce14c4a4665fa8ff4c587dcc77202a9 already have revision, skipping fetch # git checkout -q -f -B kisskb 1619b69edce14c4a4665fa8ff4c587dcc77202a9 # git clean -qxdf # < git log -1 # commit 1619b69edce14c4a4665fa8ff4c587dcc77202a9 # Author: Michael Ellerman # Date: Tue Sep 14 22:17:23 2021 +1000 # # powerpc/boot: Fix build failure since GCC 4.9 removal # # Stephen reported that the build was broken since commit # 6d2ef226f2f1 ("compiler_attributes.h: drop __has_attribute() support for # gcc4"), with errors such as: # # include/linux/compiler_attributes.h:296:5: warning: "__has_attribute" is not defined, evaluates to 0 [-Wundef] # 296 | #if __has_attribute(__warning__) # | ^~~~~~~~~~~~~~~ # make[2]: *** [arch/powerpc/boot/Makefile:225: arch/powerpc/boot/crt0.o] Error 1 # # But we expect __has_attribute() to always be defined now that we've # stopped using GCC 4. # # Linus debugged it to the point of reading the GCC sources, and noticing # that the problem is that __has_attribute() is not defined when # preprocessing assembly files, which is what we're doing here. # # Our assembly files don't include, or need, compiler_attributes.h, but # they are getting it unconditionally from the -include in BOOT_CFLAGS, # which is then added in its entirety to BOOT_AFLAGS. # # That -include was added in commit 77433830ed16 ("powerpc: boot: include # compiler_attributes.h") so that we'd have "fallthrough" and other # attributes defined for the C files in arch/powerpc/boot. But it's not # needed for assembly files. # # The minimal fix is to move the addition to BOOT_CFLAGS of -include # compiler_attributes.h until after we've copied BOOT_CFLAGS into # BOOT_AFLAGS. That avoids including compiler_attributes.h for asm files, # but makes no other change to BOOT_CFLAGS or BOOT_AFLAGS. # # Reported-by: Stephen Rothwell # Debugged-by: Linus Torvalds # Signed-off-by: Michael Ellerman # Tested-by: Guenter Roeck # Signed-off-by: Linus Torvalds # < /opt/cross/kisskb/korg/gcc-10.1.0-nolibc/sh4-linux/bin/sh4-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-10.1.0-nolibc/sh4-linux/bin/sh4-linux-ld --version # < git log --format=%s --max-count=1 1619b69edce14c4a4665fa8ff4c587dcc77202a9 # < make -s -j 32 ARCH=sh O=/kisskb/build/linus_se7619_defconfig_sh4-gcc10 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-10.1.0-nolibc/sh4-linux/bin/sh4-linux- se7619_defconfig # < make -s -j 32 ARCH=sh O=/kisskb/build/linus_se7619_defconfig_sh4-gcc10 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-10.1.0-nolibc/sh4-linux/bin/sh4-linux- help # make -s -j 32 ARCH=sh O=/kisskb/build/linus_se7619_defconfig_sh4-gcc10 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-10.1.0-nolibc/sh4-linux/bin/sh4-linux- olddefconfig # make -s -j 32 ARCH=sh O=/kisskb/build/linus_se7619_defconfig_sh4-gcc10 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-10.1.0-nolibc/sh4-linux/bin/sh4-linux- Generating include/generated/machtypes.h :1515:2: warning: #warning syscall clone3 not implemented [-Wcpp] In file included from /kisskb/src/arch/sh/include/asm/hw_irq.h:6, from /kisskb/src/include/linux/irq.h:593, from /kisskb/src/include/asm-generic/hardirq.h:17, from /kisskb/src/arch/sh/include/asm/hardirq.h:9, from /kisskb/src/include/linux/hardirq.h:11, from /kisskb/src/include/linux/interrupt.h:11, from /kisskb/src/include/linux/serial_core.h:13, from /kisskb/src/include/linux/serial_sci.h:6, from /kisskb/src/arch/sh/kernel/cpu/sh2/setup-sh7619.c:11: /kisskb/src/include/linux/sh_intc.h:100:63: warning: division 'sizeof (void *) / sizeof (void)' does not compute the number of array elements [-Wsizeof-pointer-div] 100 | #define _INTC_ARRAY(a) a, __same_type(a, NULL) ? 0 : sizeof(a)/sizeof(*a) | ^ /kisskb/src/include/linux/sh_intc.h:105:24: note: in expansion of macro '_INTC_ARRAY' 105 | _INTC_ARRAY(vectors), _INTC_ARRAY(groups), \ | ^~~~~~~~~~~ /kisskb/src/include/linux/sh_intc.h:124:8: note: in expansion of macro 'INTC_HW_DESC' 124 | .hw = INTC_HW_DESC(vectors, groups, mask_regs, \ | ^~~~~~~~~~~~ /kisskb/src/arch/sh/kernel/cpu/sh2/setup-sh7619.c:58:8: note: in expansion of macro 'DECLARE_INTC_DESC' 58 | static DECLARE_INTC_DESC(intc_desc, "sh7619", vectors, NULL, | ^~~~~~~~~~~~~~~~~ /kisskb/src/include/linux/sh_intc.h:100:63: warning: division 'sizeof (void *) / sizeof (void)' does not compute the number of array elements [-Wsizeof-pointer-div] 100 | #define _INTC_ARRAY(a) a, __same_type(a, NULL) ? 0 : sizeof(a)/sizeof(*a) | ^ /kisskb/src/include/linux/sh_intc.h:106:2: note: in expansion of macro '_INTC_ARRAY' 106 | _INTC_ARRAY(mask_regs), _INTC_ARRAY(prio_regs), \ | ^~~~~~~~~~~ /kisskb/src/include/linux/sh_intc.h:124:8: note: in expansion of macro 'INTC_HW_DESC' 124 | .hw = INTC_HW_DESC(vectors, groups, mask_regs, \ | ^~~~~~~~~~~~ /kisskb/src/arch/sh/kernel/cpu/sh2/setup-sh7619.c:58:8: note: in expansion of macro 'DECLARE_INTC_DESC' 58 | static DECLARE_INTC_DESC(intc_desc, "sh7619", vectors, NULL, | ^~~~~~~~~~~~~~~~~ /kisskb/src/include/linux/sh_intc.h:100:63: warning: division 'sizeof (void *) / sizeof (void)' does not compute the number of array elements [-Wsizeof-pointer-div] 100 | #define _INTC_ARRAY(a) a, __same_type(a, NULL) ? 0 : sizeof(a)/sizeof(*a) | ^ /kisskb/src/include/linux/sh_intc.h:107:2: note: in expansion of macro '_INTC_ARRAY' 107 | _INTC_ARRAY(sense_regs), _INTC_ARRAY(ack_regs), \ | ^~~~~~~~~~~ /kisskb/src/include/linux/sh_intc.h:124:8: note: in expansion of macro 'INTC_HW_DESC' 124 | .hw = INTC_HW_DESC(vectors, groups, mask_regs, \ | ^~~~~~~~~~~~ /kisskb/src/arch/sh/kernel/cpu/sh2/setup-sh7619.c:58:8: note: in expansion of macro 'DECLARE_INTC_DESC' 58 | static DECLARE_INTC_DESC(intc_desc, "sh7619", vectors, NULL, | ^~~~~~~~~~~~~~~~~ /kisskb/src/include/linux/sh_intc.h:100:63: warning: division 'sizeof (void *) / sizeof (void)' does not compute the number of array elements [-Wsizeof-pointer-div] 100 | #define _INTC_ARRAY(a) a, __same_type(a, NULL) ? 0 : sizeof(a)/sizeof(*a) | ^ /kisskb/src/include/linux/sh_intc.h:107:27: note: in expansion of macro '_INTC_ARRAY' 107 | _INTC_ARRAY(sense_regs), _INTC_ARRAY(ack_regs), \ | ^~~~~~~~~~~ /kisskb/src/include/linux/sh_intc.h:124:8: note: in expansion of macro 'INTC_HW_DESC' 124 | .hw = INTC_HW_DESC(vectors, groups, mask_regs, \ | ^~~~~~~~~~~~ /kisskb/src/arch/sh/kernel/cpu/sh2/setup-sh7619.c:58:8: note: in expansion of macro 'DECLARE_INTC_DESC' 58 | static DECLARE_INTC_DESC(intc_desc, "sh7619", vectors, NULL, | ^~~~~~~~~~~~~~~~~ /kisskb/src/drivers/tty/serial/sh-sci.c: In function 'sci_remap_port': /kisskb/src/drivers/tty/serial/sh-sci.c:2662:19: warning: unused variable 'sport' [-Wunused-variable] 2662 | struct sci_port *sport = to_sci_port(port); | ^~~~~ Completed OK # rm -rf /kisskb/build/linus_se7619_defconfig_sh4-gcc10 # Build took: 0:00:18.706653