Page MenuHomeFreeBSD

openzfs: fix gcc kernel module builds

Authored by rlibby on Dec 20 2020, 8:37 AM.


  • Suppress -Wredundant-decls. Ultimately this warning is harmless in any case, and it does not look like there is a simple way to avoid redundant declarations in this case without a lot of header pollution (e.g. having openzfs's shim param.h pulling in sys/kernel.h for hz).
  • Suppress -Wnested-externs, which is useless anyway.

Unfortunately it was not sufficient just to modify OPENZFS_CFLAGS,
because the warning suppressions need to appear on the command line
after they are explicitly enabled by CWARNFLAGS from sys/conf/,
but OPENZFS_CFLAGS get added before due to use of -I for the shims.

Test Plan
make buildkernel
env MAKEOBJDIRPREFIX=/usr/obj/gcc9 CROSS_TOOLCHAIN=amd64-gcc9 make buildkernel

Diff Detail

R10 FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

@gnn did you want to take a look at this patch before it goes in? It is just turning down nuisance warnings for gcc compatibility.

This revision was not accepted when it landed; it landed in state Needs Review.Dec 27 2020, 11:06 PM
This revision was automatically updated to reflect the committed changes.