Commit Graph

2720 Commits

Author SHA1 Message Date
Jonathan Anderson
808b18e4d6 Extract suffix rules into bsd.suffixes[-posix].mk.
Refactor make suffix rules into separate files (one for POSIX and one not),
and rationalise the rules so that bsd.lib.mk can contain only those rules
that are library-specific (.c.po and .c.pico).

This can be accomplished by adding ${STATIC_CFLAGS} to the .c.o rule
unconditionally. STATIC_CFLAGS are only defined for use by sys.mk rules in
lib/libpam/Makefile.inc (see r227797), so it should be safe to include
them unconditionally in sys.mk's .c.o rule (tested by make universe and a
ports exp-run).

Reviewed by:	bdrewery, sjg
Approved by:	rwatson (mentor)
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D6805
2016-10-12 00:42:46 +00:00
Warner Losh
d49a5ddd04 Create libefivar library. This library aims to provide
the same API as the GPL'd version of this library. It implements the common
Linux API for programatically manipulating UEFI environment varibales using
the UEFI Runtime Services the kernel provides. It replaces the old efi
library since it is programmed to a different interface, but retails the
CHAR16 to UTF-8 and vice versa conversion routines. The new name is to match
Linux program's expectations.

Differential Revision: https://reviews.freebsd.org/D8128
Reviewed by: kib@, wblock@, Ganael Laplanche
2016-10-11 22:30:41 +00:00
Ed Maste
9ce3c6b09a Retire WITHOUT_ELFCOPY_AS_OBJCOPY option
In FreeBSD 11 ELF Tool Chain's elfcopy is installed as objcopy by
default, with the option to switch back to GNU objcopy by setting
WITHOUT_ELFCOPY_AS_OBJCOPY in make.conf.

We plan to remove the outdated in-tree binutils in FreeBSD 12, so
remove the temporary transition aid.

Reviewed by:	brooks, imp
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D7337
2016-10-03 17:49:26 +00:00
Warner Losh
3d79fdac2b SSP is broken on all mips. 2016-09-29 13:38:14 +00:00
Ed Maste
f987297fc9 Add a WITHOUT_DIALOG src.conf(5) knob
It also turns off dependencies (bsdinstall, bsdconfig, dpv, tzsetup).

Reviewed by:	dteske
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D7969
2016-09-27 18:08:38 +00:00
Ruslan Bukin
5bec6d5513 Mark SSP broken on MIPS.
Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
2016-09-27 09:44:30 +00:00
Marcel Moolenaar
6d93a08d0a Document the ".pico" extension for object files.
Suggested by: emaste@
2016-09-25 16:50:31 +00:00
Marcel Moolenaar
2b4da8aa20 When MAKEOBJDIRPREFIX points to a case-insensitive file system, the
build can break when different source files create the same target
files (case-insensitivity speaking).  This is the case for object
files compiled with -fpic and shared libraries. The former uses
an extension of ".So", and the latter an extension ".so".  Rename
shared object files from *.So to *.pico to match what NetBSD does.

See also r305855

MFC after:	1 month
Sponsored by:	Bracket Computing
Differential Revision:	https://reviews.freebsd.org/D7906
2016-09-24 15:11:27 +00:00
Ed Maste
93cdeb4aec Force LLVM_LIBUNWIND off if we don't have a C++11 compiler
Tested by:	bde
Differential Revision:	https://reviews.freebsd.org/D7746
2016-09-23 13:21:29 +00:00
Baptiste Daroussin
b08645428c Remove cruft that accidently crept in r305931 2016-09-18 15:06:28 +00:00
Baptiste Daroussin
0adf2bc849 Disable GNU rcs by default
All remaining tools using rcs has been switched to directly use diff3(1):
- etcupdate(8)
- freebsd-update(8)

Note that the ident(1) tool is been already replaced long ago with a BSD
licensed version, as such it remains installed.

GNU rcs is still available from ports:
- rcs: newer GPLv3 version
- rcs57: the latest version from base (GPLv2)
2016-09-18 15:01:11 +00:00
Simon J. Gerraty
462b35ac65 Avoid clobbering existing value of META_COOKIE_TOUCH 2016-09-13 22:17:25 +00:00
Bryan Drewery
61018287f7 Fix regression from r304644 which could cause .WAITs in SUBDIR to be ignored.
This was possible if a STANDALONE_SUBDIR_TARGET item came in
SUBDIR_TARGETS before 'all', which would then cause SUBDIR to
have all .WAIT's removed.

Sponsored by:	Dell EMC Isilon
2016-09-09 18:49:45 +00:00
Simon J. Gerraty
c9012a5120 Missed part of patch 2016-09-09 02:02:13 +00:00
Simon J. Gerraty
0806d0ef5e Update to latest dirdeps.mk
Take advantage of new bmake feature to only consider Makefile.depend
as invalidating DIRDEPS_CACHE.

When bootstrapping allow more filtering via .MAKE.DEPENDFILE_BOOTSTRAP_SED

Move some comments back to where they make sense.

meta.sys.mk: add META_COOKIE_TOUCH and META_NOPHONY to better handle some
targets in meta mode vs non-meta mode.
Also use .MAKE.META.IGNORE_PATHS to ignore mtime of makefiles - which do
not matter in meta mode.
2016-09-09 01:21:35 +00:00
Kristof Provost
ec21434933 Renaming libifc to libifconfig in response to feedback on initial commit of
this library. Sticking to 'libifconfig' (and 'ifconfig_' as function prefix)
should reduce chances of namespace collisions, make it more clear what the
library does, and be more in line with existing libraries.

Submitted by: Marie Helene Kvello-Aune <marieheleneka@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D7742
Reviewed by:	cem, kp
2016-09-02 18:33:08 +00:00
Bryan Drewery
689a876e96 DIRDEPS_BUILD: Include crunched object meta files for gendirdeps.
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-09-01 23:52:20 +00:00
Bryan Drewery
5017231ad7 META_MODE/DIRDEPS_BUILD: Fix various issues with crunch builds.
- DIRDEPS_BUILD: Fix crunchgen builds losing their library dependencies
  on a nop-rebuild.
- META_MODE: Fix not rebuilding various crunch.mk targets if their .meta
  files warrant a rebuild.  They were lacking .meta files previously.
  This adds .NOMETA to the crunch objects being used since they are
  already built.  Bmake was forcing a rebuild on them since their
  .meta files were not in the expected place; there is no reason to
  rebuild them.

MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-09-01 23:21:08 +00:00
Bryan Drewery
9954e8e612 META_MODE: Don't expect .meta files for side-effect generated files.
This is similar to r301285.

MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2016-09-01 23:20:54 +00:00
Bryan Drewery
7c0c104bfc FAST_DEPEND/META_MODE: Fix several issues with SRCS containing '/'.
- For FAST_DEPEND, properly apply the -M flags when compiling by
  enduring that the condition also has the s,/,_,g filter applied to it
  first.
- For FAST_DEPEND, properly read from the filtered filename.
- For META_MODE, it needs to read from a full-pathed and s,/,_,g replaced
  filename based on bmake's meta_name() function which names the .meta
  file for SRCS with '/' in them.

This support has not been extended to the kernel build yet but may be in the
future.

MFC after:	2 weeks
Reported by:	dim
Sponsored by:	EMC / Isilon Storage Division
2016-09-01 17:36:52 +00:00
Bryan Drewery
9e2f435fc1 Add a 'make print-dir' that simply traverses all directories and prints them.
This is useful for finding connected directories.

MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2016-08-31 19:30:52 +00:00
Bryan Drewery
82d3888118 AUTO_OBJ: Support SRCS/DPSRCS that contain '/' and require a nested OBJDIR.
This is to be used by the new clang3.9 build and extends functionality
added to 'make obj' in r279980.

MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-08-30 22:48:05 +00:00
Bryan Drewery
190348ae45 Allow parallelizing clean/cleandepend/depend with all.
This now makes 'make -jX clean all install' safe.

MFC after:	3 days
Sponsored by:	EMC / Isilon Storage Division
2016-08-29 18:31:34 +00:00
Baptiste Daroussin
f05ca6f33b Remove warning on struct-overflow on gcc 5.3.0 as zic(8) dies on it 2016-08-27 01:28:00 +00:00
Bryan Drewery
3c39d0a0ab WITH_META_MODE: Don't let subdir traversals for 'make install' re-enable meta mode.
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-08-25 23:55:56 +00:00
Kristof Provost
d14b24ef84 Add libifc, a library implementing core functionality that exists in ifconfig(8) today.
libifc (pronounced lib-ifconfig) aims to be a light abstraction layer between
programs and the kernel APIs for managing the network configuration.
This should hopefully make programs easier to maintain, and reduce code
duplication.

Work will begin on making ifconfig(8) use this library in the near future.

This code is still evolving. The interface should not be considered stable until
it is announced as such.

Submitted By: Marie Helene Kvello-Aune <marieheleneka@gmail.com>
Reviewed By: kp
Differential Revision: https://reviews.freebsd.org/D7529
2016-08-25 19:40:25 +00:00
Bryan Drewery
c30c436a58 FAST_DEPEND: Fix 'make all install' not properly rebuilding based on .depend.* files.
An optimization is in place to skip reading the .depend.* files with
'make install'.  This was too strong and broke 'make all install' and
'make foo.o foo install'.  Now only skip reading the dependency files
if all make targets ran are install targets.

The problem comes about because headers are only added in as a guessed
dependency if .depend.* files do not yet exist.  If they do exist, even
if being skipped from being read, then the header dependencies are not
applied.  This applies to all #included files, and not just headers.

Reported by:	kib
MFC after:	1 day
Sponsored by:	EMC / Isilon Storage Division
2016-08-23 19:37:18 +00:00
Dimitry Andric
1075729090 In addition to creating subdirectories under .OBJDIR for SRCS with
relative paths, also create them for DPSRCS.  This is needed for builds
that generate files during the depend stage, which cannot be compiled by
themselves, since those have to be put in DPSRCS.
2016-08-23 19:31:43 +00:00
Bryan Drewery
c472a0f8c2 Re-enable WITH_SYSTEM_COMPILER with WITH_META_MODE.
This was disabled in r301468 due to -target/--sysroot sometimes being used in
the build and other times not being used.  Now that it is always used since
r304681, it is safe to combine the features.

MFC after:	3 days
Sponsored by:	EMC / Isilon Storage Division
2016-08-23 15:22:17 +00:00
Bryan Drewery
34ce63e5aa For 'make <directory>' hook into the all_subdir_<directory> targets.
This fixes parallel build issues when trying to depend on ${SUBDIR}.  An
example of this in share/i18n/csmapper/Makefile where mapper.dir depends
on ${SUBDIR} having been traversed and built already.  Before this
change running make in that directory would build the subdirectories
twice.  This led to obscure build races.  While reworking that build
may be possible, the framework should not so easily allow creating such
problems.

Now depending on <directory> will properly redirect to the
all_subdir_<directory> target rather than invoking the inline shell.

This also makes 'make -jX <directory>' now respect any
SUBDIR_DEPEND_<directory> statements when SUBDIR_PARALLEL is defined.
This is not entirely intended and may be changed later.

MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-08-22 22:51:07 +00:00
Bryan Drewery
d9bb42153a Always define the various <target>_subdir_<directory> targets, even if not used.
This is part of an effort to cleanup handling of some edge cases
involving 'make <directory>'.  It also provides the targets for
other uses.

MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-08-22 22:51:04 +00:00
Bryan Drewery
e54caebe4d Stop using _SUBDIR internally for non-SUBDIR_PARALLEL builds.
This is unifying more of the logic.  Rather than create targets such
as 'all: all_subdir_foo' when using SUBDIR_PARALLEL and using
'all: _SUBDIR' when not using SUBDIR_PARALLEL, always use the
expanded out <target>_subdir_<directory> pattern.  When not using
SUBDIR_PARALLEL, have each directory-target depend on the previously
defined targets as to respect the *order* of SUBDIR.

Using 'make -N' now prints all directory traversals individually rather
than using a loop, since a loop is no longer used to traverse.

This is part of an effort to cleanup handling of some edge cases
involving 'make <directory>' and making it simpler in the sense
that the pattern used to build is the same for all modes.

MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-08-22 22:51:01 +00:00
Ed Maste
8a9745b5e5 Forcibly disable MK_TESTS if building without C++
Several atf components require C++, and the test suite is not usable
if building WITHOUT_CXX.

Reviewed by:	bdrewery, jmmv
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D7597
2016-08-22 17:45:30 +00:00
Bryan Drewery
017ec33036 PROGS: Support INTERNALPROG.prog=yes to not install it.
MFC after:	3 days
Sponsored by:	EMC / Isilon Storage Division
2016-08-11 17:06:48 +00:00
Ruslan Bukin
01a62066c3 Revert r303911 "Remove extra -msoft-float flags settings."
This was not properly tested.
2016-08-11 13:42:31 +00:00
Ruslan Bukin
2d700cb557 Remove extra -msoft-float flags settings.
This helps to build firmware modules.

Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
2016-08-10 13:32:27 +00:00
Mark Johnston
4808a67805 libproc: Add proc_getmodel().
This is used by libdtrace to determine the data model of target processes.
This allows for the creation of pid provider probes in 32-bit processes on
amd64.

MFC after:	1 month
2016-07-30 03:09:23 +00:00
Mark Johnston
a7e13d50fe librtld_db: Use the auxv to figure out where to look up loader symbols.
Previously, librtld_db just hardcoded /libexec/ld-elf.so, which isn't
correct for processes that aren't using the native ABI. With this change,
librtld_db can be used to inspect non-native processes; in particular,
dtrace -c now works for 32-bit executables on amd64.

MFC after:	1 month
2016-07-30 03:05:23 +00:00
Ruslan Bukin
9346408d90 Normalise the CWARNFLAGS inter-word spacing: remove all leading
and trailing space, and convert multiple consecutive spaces to
single space.

This helps to keep build output looking good.
2016-07-28 17:18:02 +00:00
Ed Maste
06b418173f Enable LLVM libunwind by default on amd64 and i386
It is a maintained and updated runtime exception stack unwinder that
should be a drop-in replacement.

It can be disabled by setting WITHOUT_LLVM_LIBUNWIND in src.conf.

PR:		206039 [exp-run]
Sponsored by:	The FreeBSD Foundation
2016-07-27 16:01:44 +00:00
Ed Maste
fd406aa3de Remove ${OBJDUMP} as it is not used by the base system
It was added to sys.mk relatively recently (r274503) for EFI builds
but is no longer used by the base system. The in-tree binutils are
outdated, will not be updated, and will be removed in the future.
Remove it from the toolchain build now to slightly simplify the build
and make sure we don't grow an accidental dependency.

Note that this affects only the toolchain build, and does not affect
/usr/bin/objdump in the built world.

Reviewed by:	bdrewery
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D6460
2016-07-27 14:58:15 +00:00
Ruslan Bukin
8500b15f9f Fix style. 2016-07-24 18:04:12 +00:00
Ruslan Bukin
9ddd36c20a Set the soft-float flag for assembly code as well.
This fixes compilation with GCC 6.1.

Sponsored by:	DARPA, AFRL
2016-07-22 15:22:49 +00:00
Ruslan Bukin
b6f0282782 Add warn flags for GCC 6.1 compiler.
Sponsored by:	DARPA, AFRL
2016-07-22 15:00:38 +00:00
Bryan Drewery
b987685fe0 Revert r302670 and r302671 for now.
MACHINE_CPUARCH smells like MACHINE except for arm64/aarch64 which
has it backwards.
2016-07-13 01:35:53 +00:00
Bryan Drewery
8a6bdc134d Create one list of replacements for MACHINE_CPUARCH as MACHINE_CPUARCH_SUB.
This also adds missing s/aarch64/arm64 to the sys.mk version and also
adds back armv6hf for universe since it was added to the sys.mk version
in r300438.

MFC after:	3 days
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D7159
2016-07-12 18:57:25 +00:00
Bryan Drewery
d95fa04249 Don't warn about needing filemon for makeman.
r287879 wasn't quite enough here since Makefile.inc1 is running
'make -C release -V VERSION' and hitting the warning.

Reported by:	lattera
Sponsored by:	EMC / Isilon Storage Division
Approved by:	re (blanket, META_MODE)
2016-06-29 16:45:01 +00:00
Bryan Drewery
bf16c2e9c9 WITH_SYSTEM_COMPILER: Enable by default
This improves buildworld, toolchain, kernel-toolchain, and universe targets.
See r300354 or src.conf(5) for more details.

Approved by:	re (gjb)
Relnotes:	yes (r300354)
Sponsored by:	EMC / Isilon Storage Division
2016-06-24 19:55:59 +00:00
Ed Maste
b60371f8a6 bsd.prog.mk: add "/usr/lib" to list of base system directories
kgzldr.o is installed into /usr/lib but using bsd.prog.mk. Add
/usr/lib to the base system directory list so that debug files are
installed into /usr/lib/debug/usr/lib, not /usr/lib/.debug .

Approved by:	re (gjb)
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2016-06-24 18:45:16 +00:00
Bryan Drewery
b38eb9eac8 Add AFLAGS.IMPSRC and document A[C]FLAGS
Approved by:	re (gjb)
Sponsored by:	EMC / Isilon Storage Division
2016-06-22 20:31:49 +00:00