cirosantilli / linux-kernel-module-cheat

The perfect emulation setup to study and develop the Linux kernel v5.4.3, kernel modules, QEMU, gem5 and x86_64, ARMv7 and ARMv8 userland and baremetal assembly, ANSI C, C++ and POSIX. GDB step debug and KGDB just work. Powered by Buildroot and crosstool-NG. Highly automated. Thoroughly documented. Automated tests. "Tested" in an Ubuntu 24.04 host.
https://cirosantilli.com/linux-kernel-module-cheat
GNU General Public License v3.0
4.21k stars 605 forks source link

Buildroot 2018.08 and GCC 9.2.0 build fails with "__EI___errno_location' specifies less restrictive attributes than its target" #97

Open cirosantilli opened 5 years ago

cirosantilli commented 5 years ago

At LKMC 5cdbd57de09b64f48d06351b065dc8949493d7e8

cd submodules/gcc
git checkout gcc-9_2_0-release
cd ../..
./build-buildroot -aA --buildroot-build-id gcc-9-2 -- toolchain

outcome after several minutes:

In file included from <command-line>:                                                                                                                                                                                                                                           
./../include/libc-symbols.h:471:26: error: '__EI___errno_location' specifies less restrictive attributes than its target '__errno_location': 'const', 'nothrow' [-Werror=missing-attributes]                                                                                    
  471 |   extern __typeof (name) __EI_##name \                                                                                                                                                                                                                                  
      |                          ^~~~~                                                                                                                                                                                                                                          
./../include/libc-symbols.h:475:29: note: in expansion of macro '__hidden_ver1'                          
  475 | #  define hidden_def(name)  __hidden_ver1(__GI_##name, name, name);                                                                                                                                                                                                     
      |                             ^~~~~~~~~~~~~                                                                                                                                                                                                                               
./../include/libc-symbols.h:539:32: note: in expansion of macro 'hidden_def'                                                                                                                                                                                                    
  539 | # define libc_hidden_def(name) hidden_def (name)                                                                                                                                                                                                                        
      |                                ^~~~~~~~~~                                                                                                                                                                                                                               
errno-loc.c:28:1: note: in expansion of macro 'libc_hidden_def'                                                                                                                                                                                                                 
   28 | libc_hidden_def (__errno_location)                                                                                                                                                                                                                                      
      | ^~~~~~~~~~~~~~~                                                                          
errno-loc.c:24:1: note: '__EI___errno_location' target declared here                                                                                                                                                                                                            
   24 | __errno_location (void)                                                                                                                                                                                                                                                 
      | ^~~~~~~~~~~~~~~~                                                                                                                                                                                                                                                        
cc1: all warnings being treated as errors

TODO: should have added --no-all.

realazizk commented 4 years ago

when building with a newer gcc use --disable-werror as a parameter to configure