Page MenuHomeFreeBSD

openzfs: fix gcc kernel module builds
ClosedPublic

Authored by rlibby on Dec 20 2020, 8:37 AM.
Tags
None
Referenced Files
F149506084: D27685.id80967.diff
Tue, Mar 24, 10:05 PM
Unknown Object (File)
Thu, Mar 19, 8:27 AM
Unknown Object (File)
Thu, Mar 19, 7:33 AM
Unknown Object (File)
Tue, Mar 17, 3:50 AM
Unknown Object (File)
Sun, Mar 15, 10:40 AM
Unknown Object (File)
Tue, Mar 10, 1:47 AM
Unknown Object (File)
Mon, Mar 9, 12:28 PM
Unknown Object (File)
Mon, Mar 9, 6:02 AM
Subscribers

Details

Summary
  • 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/kern.mk,
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

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
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.