arter97 / exfat-linux

EOL exFAT filesystem module for Linux kernel. Everyone should be using https://github.com/namjaejeon/linux-exfat-oot instead.
Other
262 stars 59 forks source link

Build error when CONFIG_GCC_PLUGIN_RANDSTRUCT enabled in kernel. #2

Closed barthess closed 4 years ago

barthess commented 4 years ago
/usr/src/exfat-linux/fatent.c:97:2: error: positional initialization of field in ‘struct’ declared with ‘designated_init’ attribute [-Werror=designated-init]
   97 |  exfat_ent_get,
      |  ^~~~~~~~~~~~~
/usr/src/exfat-linux/fatent.c:97:2: note: (near initialization for ‘exfat_ent_ops’)
/usr/src/exfat-linux/fatent.c:97:2: error: invalid initializer
/usr/src/exfat-linux/fatent.c:97:2: note: (near initialization for ‘exfat_ent_ops.<anonymous>’)
/usr/src/exfat-linux/fatent.c:98:2: error: positional initialization of field in ‘struct’ declared with ‘designated_init’ attribute [-Werror=designated-init]
   98 |  exfat_ent_set
      |  ^~~~~~~~~~~~~
/usr/src/exfat-linux/fatent.c:98:2: note: (near initialization for ‘exfat_ent_ops’)
cc1: some warnings being treated as errors

Reproduces in 5.3.0 and 5.2.14 I have no ideas how to properly fix it so no patch submitted.

arter97 commented 4 years ago

Can you post the full defconfig used for that kernel?

I'm not familiar with gcc-plugins and somehow I'm failing to enable CONFIG_GCC_PLUGIN_RANDSTRUCT.

barthess commented 4 years ago

I don't know what is defconfig. I just "make xconfig". Then go to "General architecture-dependent options" -> "GCC plugins" and tick "Randomize layout of sensitive kernel structures" checkbox. See my .config file in attache. .config.gz

arter97 commented 4 years ago

There were some code refactoring done and ent_ops were one of them.

My development workflow still can't enable GCC plugins for some reason. If you find the next release still having the issue, please open another issue.

Thanks.