mirror of
https://git.freebsd.org/src.git
synced 2026-01-16 23:02:24 +00:00
bsd.prog.mk: Skip warnings if compiler.mk was not included
Some checks are pending
Cross-build Kernel / amd64 ubuntu-22.04 (clang-15) (push) Waiting to run
Cross-build Kernel / aarch64 ubuntu-22.04 (clang-15) (push) Waiting to run
Cross-build Kernel / amd64 ubuntu-24.04 (clang-18) (push) Waiting to run
Cross-build Kernel / aarch64 ubuntu-24.04 (clang-18) (push) Waiting to run
Cross-build Kernel / amd64 macos-latest (clang-18) (push) Waiting to run
Cross-build Kernel / aarch64 macos-latest (clang-18) (push) Waiting to run
Some checks are pending
Cross-build Kernel / amd64 ubuntu-22.04 (clang-15) (push) Waiting to run
Cross-build Kernel / aarch64 ubuntu-22.04 (clang-15) (push) Waiting to run
Cross-build Kernel / amd64 ubuntu-24.04 (clang-18) (push) Waiting to run
Cross-build Kernel / aarch64 ubuntu-24.04 (clang-18) (push) Waiting to run
Cross-build Kernel / amd64 macos-latest (clang-18) (push) Waiting to run
Cross-build Kernel / aarch64 macos-latest (clang-18) (push) Waiting to run
We emit a warning if src.conf options WITH_RETPOLINE or INIT_ALL are
in use, and the compiler or linker does not support the feature.
For targets like `cleandir` we skip including bsd.compiler.mk, which
leaves COMPILER_FEATURES unset and spurious warnings were emitted in
early buildworld stages, if these options are in use.
Commit 0837b2ebd5 ("pkg: Die if make -V BRANCH fails") added -W to
usr.sbin/pkg's make flags, causing it to exit on warnings. As a result
buildworld failed when these src.conf options were in use.
Clean this up by omitting the warning if the magic
_NO_INCLUDE_COMPILERMK flag is set, which indicates that
COMPILER_FEATURES is not set.
Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53501
This commit is contained in:
parent
c6e02892bb
commit
e4f2a35095
1 changed files with 4 additions and 0 deletions
|
|
@ -49,9 +49,11 @@ CXXFLAGS+= -mretpoline
|
|||
LDFLAGS+= -Wl,-zretpolineplt
|
||||
.endif
|
||||
.else
|
||||
.if !defined(_NO_INCLUDE_COMPILERMK)
|
||||
.warning Retpoline requested but not supported by compiler or linker
|
||||
.endif
|
||||
.endif
|
||||
.endif
|
||||
# LLD sensibly defaults to -znoexecstack, so do the same for BFD
|
||||
LDFLAGS.bfd+= -Wl,-znoexecstack
|
||||
.if ${MK_BRANCH_PROTECTION} != "no"
|
||||
|
|
@ -71,9 +73,11 @@ CFLAGS+= -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clan
|
|||
CXXFLAGS+= -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang
|
||||
.endif
|
||||
.else
|
||||
.if !defined(_NO_INCLUDE_COMPILERMK)
|
||||
.warning INIT_ALL (${OPT_INIT_ALL}) requested but not supported by compiler
|
||||
.endif
|
||||
.endif
|
||||
.endif
|
||||
|
||||
# Zero used registers on return (mitigate some ROP)
|
||||
.if ${MK_ZEROREGS} != "no"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue