Page MenuHomeFreeBSD

openzfs: fix gcc kernel module builds
ClosedPublic

Authored by rlibby on Dec 20 2020, 8:37 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jan 2, 10:55 AM
Unknown Object (File)
Fri, Dec 27, 1:37 AM
Unknown Object (File)
Dec 10 2024, 6:09 AM
Unknown Object (File)
Nov 29 2024, 2:46 AM
Unknown Object (File)
Nov 28 2024, 6:04 PM
Unknown Object (File)
Nov 27 2024, 5:17 AM
Unknown Object (File)
Nov 3 2024, 5:40 AM
Unknown Object (File)
Oct 30 2024, 2:36 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.