Page MenuHomeFreeBSD

bsd.symver.mk: pass $CFLAGS to $CPP invocation
ClosedPublic

Authored by emaste on May 24 2024, 4:18 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Oct 22, 1:48 PM
Unknown Object (File)
Oct 3 2024, 8:57 AM
Unknown Object (File)
Oct 1 2024, 2:10 PM
Unknown Object (File)
Sep 17 2024, 2:12 PM
Unknown Object (File)
Sep 3 2024, 12:20 PM
Unknown Object (File)
Aug 21 2024, 1:18 AM
Unknown Object (File)
Aug 9 2024, 3:33 PM
Unknown Object (File)
Aug 7 2024, 10:31 AM

Details

Summary
This allows us to support symbols optionally available based on
configuration, not just on compiler built-in #defines.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

@jrtc27 wondered if cpp accepts all of the same flags as cc. I imagine so but we could also limit this to ${CFLAGS:M-D*} perhaps.

Probably worth testing with a gcc toolchain to see if we need to filter. Including -D* might be a place to start, but some other options to impact defines in ways that might impact symbols (e.g., -march, -mabi, -mcpu) so it might be we want to have a deny list (certainly we could filter out -Wl*.)

it might be we want to have a deny list (certainly we could filter out -Wl*.)

Yeah, I could start with `:N-Wl* as there is no linking so no reason to pass linker flags.

Ping? @jhb has just encountered this issue downstream in CheriBSD. I'd suggest landing it as-is and we can whack problematic flags as we discover them?

Yeah, I used this patch directly in CheriBSD (just all of CFLAGS)

I'm fine with trying this as is and adding :N filters if it proves to be an issue.

This revision is now accepted and ready to land.Aug 21 2024, 12:28 AM