Commit Graph

18 Commits

Author SHA1 Message Date
Warner Losh
d0b2dbfa0e Remove $FreeBSD$: one-line sh pattern
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
2023-08-16 11:55:03 -06:00
Kyle Evans
fe815331bb build: provide a default WARNS for all in-tree builds
The current default is provided in various Makefile.inc in some top-level
directories and covers a good portion of the tree, but doesn't cover parts
of the build a little deeper (e.g. libcasper).

Provide a default in src.sys.mk and set WARNS to it in bsd.sys.mk if that
variable is defined. This lets us relatively cleanly provide a default WARNS
no matter where you're building in the src tree without breaking things
outside of the tree.

Crunchgen has been updated as a bootstrap tool to work on this change
because it needs r365605 at a minimum to succeed. The cleanup necessary to
successfully walk over this change on WITHOUT_CLEAN builds has been added.

There is a supplemental project to this to list all of the warnings that are
encountered when the environment has WARNS=6 NO_WERROR=yes:
https://warns.kevans.dev -- this project will hopefully eventually go away
in favor of CI doing a much better job than it.

Reviewed by:	emaste, brooks, ngie (all earlier version)
Reviewed by:	emaste, arichardson (depend-cleanup.sh change)
Differential Revision:	https://reviews.freebsd.org/D26455
2020-09-18 17:17:46 +00:00
Kyle Evans
879ce458f4 userland build: replace -fno-common with ${CFCOMMONFLAG}
This change allows any downstream or otherwise consumer to easily override
the new -fno-common default on a temporary basis without having to hack into
src.sys.mk, and also makes it a bit easier to search for these specific
cases where -fno-common must be overridden with -fcommon or else the build
will fail.

The gdb build, the only program requiring -fcommon on head/, is switched
over as an example usage. It will need it on all branches, so this does not
harm future mergability.

MFC after:	3 days
2020-04-10 14:01:07 +00:00
Kyle Evans
8eb1a0ce56 Add -fno-common to all userland/kernel src builds
-fno-common will become the default in GCC10/LLVM11. Plenty of work has been
put in to make sure our world builds are no -fno-common clean, so let's slap
the build with this until it becomes the compiler default to ensure we don't
regress.

At this time, we will not be enforcing -fno-common on ports builds. I
suspect most ports will be or quickly become -fno-common clean as they're
naturally built against compilers that default to it, so this will hopefully
become a non-issue in due time. The exception to this, which is actually the
status quo, is that kmods built from ports will continue to build with
-fno-common.

As of the time of writing, I intend to also make stable/12 -fno-common
clean. What's been done will be MFC'd to stable/11 if it's easily applicable
and/or not much work to massage it into being functional, but I anticipate
adding -fcommon to stable/11 builds to maintain its ability to be built with
newer compilers for the rest of its lifetime instead of putting in a third
branch's worth of effort.
2020-04-07 17:04:24 +00:00
Bryan Drewery
615a1e70b0 Enable AUTO_OBJ by default if the OBJDIR is writable, only for in-tree builds.
This can be disabled by putting WITHOUT_AUTO_OBJ=yes in /etc/src-env.conf, not
/etc/src.conf, or passing it in the environment.

The purpose of this rather than simply flipping the default of AUTO_OBJ to yes
is to avoid hassling users with auto.obj.mk failures if the wanted OBJDIR is
not writable. It will fallback to writing to the source directory like it does
today if MAKEOBJDIRPREFIX is not writable.

The act of enabling MK_AUTO_OBJ disables all 'make obj' treewalks since
previous work has made those not run if MK_AUTO_OBJ==yes in Makefile.inc1.

Relnotes:	yes
Reviewed by:	sjg
Discussed at:	https://lists.freebsd.org/pipermail/freebsd-arch/2016-May/017805.html
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D12841
2017-11-02 18:09:07 +00:00
Bryan Drewery
f19c33eed4 Fix error when SRCCONF is empty.
Sponsored by:	EMC / Isilon Storage Division
2016-04-22 20:31:29 +00:00
Bryan Drewery
945ceaafbc Only include src.conf if _WITHOUT_SRCCONF not defined.
This does not really fix anything currently since _WITHOUT_SRCCONF must be
defined in the environment or local.sys.*.mk, but is proper and needed for
downstream fixes.  I am working towards reworking src.conf inclusion still.

Sponsored by:	EMC / Isilon Storage Division
2015-12-01 20:56:16 +00:00
Bryan Drewery
7356a03090 Trim space 2015-09-17 21:51:48 +00:00
Bryan Drewery
cc92227428 Add a check to ensure that the env-only mkopts are not set via src.conf.
Sponsored by:	EMC / Isilon Storage Division
2015-09-17 21:49:29 +00:00
Simon J. Gerraty
daf514d0bb Move include of make.conf back to its old position.
This means moving include of local.sys.mk and src.sys.mk too.
Introduce new includes to take the early slot, for the purpose
of being able to influence toolchains and the like.

Differential Revision:	D2860
Reviewed by:	imp
2015-06-19 14:56:24 +00:00
Simon J. Gerraty
ccfb965433 Add META_MODE support.
Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision:       D2796
Reviewed by: brooks imp
2015-06-13 19:20:56 +00:00
Simon J. Gerraty
883e6bfbb1 Define SRCTOP in src.sys.mk
Because src.sys.mk should only ever be found in the src tree
we can use its position (.PARSEDIR) to set SRCTOP.

Reviewed by:	bapt, imp
2015-05-30 15:08:52 +00:00
Simon J. Gerraty
ae3019ca08 Define SRCTOP in src.sys.mk
Use SRCTOP to replace .../ in MAKSYSPATH (avoid extra :tA)
Use SRCTOP rather than ROOTSRCDIR in src.libnames.mk
Merge from head
2015-05-26 21:41:26 +00:00
Simon J. Gerraty
2ad4692912 If sys.mk were found via the magic path .../share/mk
replace it with the absolute path of .PARSEDIR, so that sub-makes
launched from objdirs (eg kernel) can still find the correct mk files.

Reviewed by:	obrien
2015-02-24 19:03:31 +00:00
Simon J. Gerraty
ee7b0571c2 Merge head from 7/28 2014-08-19 06:50:54 +00:00
Simon J. Gerraty
faa8fa9077 We do not ever want _srcconf_included_ as MAIN target. 2014-07-28 23:36:21 +00:00
Warner Losh
1f4e0ed969 The time is not yet ripe to break the lack of dependencies between
src/sys and the rest of the tree for builds.
o eliminate including bsd.mkopts.mk for the moment in kern.opts.mk
o No need to include src.opts.mk at all anymore. The reasons for it
  are now coverted in sys.mk and src.sys.mk.
2014-05-17 20:31:34 +00:00
Warner Losh
6b14aaa4d4 Read in SRCCONF early and consistently, if src.sys.mk exists, which is
should for all normal builds. Read /etc/make.conf earlier than before,
but consistently before SRCCONF and local.sys.mk.
2014-05-17 01:47:06 +00:00