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)
Mar 19 2024, 7:17 AM
Unknown Object (File)
Feb 23 2024, 12:13 PM
Unknown Object (File)
Dec 20 2023, 6:02 AM
Unknown Object (File)
Dec 14 2023, 8:25 PM
Unknown Object (File)
Dec 3 2023, 1:14 PM
Unknown Object (File)
Dec 3 2023, 1:14 PM
Unknown Object (File)
Dec 3 2023, 1:13 PM
Unknown Object (File)
Dec 3 2023, 1:00 PM
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.