Commit Graph

1828 Commits

Author SHA1 Message Date
Baptiste Daroussin
beb7fbfc0d Define LIBSQLITE3 and LIBMANDOC 2014-11-22 21:03:05 +00:00
Baptiste Daroussin
dec0135828 Enforce -lpthread and -lc to always be the 2 last components of the link list
Differential Revision:	https://reviews.freebsd.org/D1118
Suggested by:		kib
2014-11-22 12:48:09 +00:00
Craig Rodrigues
7502a3d8f6 Make MLINKS text match text in bsd.man.mk added by wosch@ in 1996. 2014-11-21 17:55:38 +00:00
Warner Losh
590461a4b8 Acutally, replaces NO_INCS with WITHOUT_INCLUDES and make
WITHOUT_TOOLCHAIN imply it instead.

Sponsored by: Netflix
2014-11-18 17:06:44 +00:00
Andrew Turner
124cd6410c Add OBJDUMP to sys.mk. The EFI loader uses it however without this it can
be set but empty.

Obtained from:	ABT Systems
Sponsored by:	The FreeBSD Foundation
2014-11-14 14:45:36 +00:00
Mark Johnston
e977d70f45 Revert r274200. Implicitly setting DEBUG_FLAGS when WITH_CTF is true is
not the right way to do this.

Requested by:	kan
2014-11-08 18:16:39 +00:00
Mark Johnston
59a9e2ca26 Automatically build with debug symbols when building with WITH_CTF.
Otherwise there's nothing for ctfconvert to do, and it ends up emitting an
error for each object file. Also remove some redundant checks from
bsd.prog.mk and bsd.lib.mk.

Differential Revision:	https://reviews.freebsd.org/D1111
Reviewed by:		imp
2014-11-06 22:46:40 +00:00
Warner Losh
bd808d4133 Ignore errors from rm -rf to support high -j builds. This is, at best,
a kludge. However, it also effectively works around the issues for
high -j builds on systems that do not have the rm fixes.

A better fix would be to rmdir here, and fix the places where we're
sloppy and not list all the files we create in CLEANFILES, should
anybody have the time to chase them all to ground.
2014-11-06 17:19:41 +00:00
Devin Teske
041394f38a Add new libraries/utilities for data throughput visualization.
dpv(3): dialog progress view library
dpv(1): stream data from stdin or multiple paths with dialog progress view
figpar(3): configuration file parsing library

Reviews:	D714
Reviewed by:	jelischer, shurd
Discussed at:	MeetBSD California 2014 Vendor/Dev Summit
Discussed on:	-current
MFC after:	21 days
X-MFC-to:	stable/10 stable/9
2014-11-04 23:46:01 +00:00
Enji Cooper
068ebf3274 Import proper fix for misc/49356 (/usr/include/atf-c/config.h) after atf-c/config.h
was removed from the build

Pointyhat to: me (again, for not running make delete-old after running test builds)
2014-11-04 05:02:22 +00:00
Enji Cooper
db572ab644 As an optimization (in simple, well used cases) only call cat ${.ALLSRC} when
generating files from various sources instead of calling cat ${.ALLSRC} | sed

The perl case was skipped because it's not being used in the tree at this time
2014-11-04 01:57:31 +00:00
Enji Cooper
37e4638f2e Add Makefile snippet to ease porting NetBSD testcases to FreeBSD from
contrib/netbsd-tests

This Makefile snippet handles polluting testcases with -lnetbsd, specific
headers for ATF version differences, and does necessary rewriting for the
testcases to match the format discussed on the TestSuite wiki page
(t_<foo> -> <foo>_test)

One must define SRCTOP (inspired by projects/bmake), OBJTOP, and TESTSRC
(e.g. contrib/netbsd-tests/lib/libc/gen) to use the Makefile snippet

Test programs are specific either via NETBSD_ATF_TESTS_C or NETBSD_ATF_TESTS_SH

C++ analogs aren't currently implemented.

The imported testcases will be cleaned up to use this Makefile snippet pseudo
"API".
2014-11-04 00:19:10 +00:00
Julio Merino
30175d7650 Use the right depend file for each program.
bsd.progs.mk generates a separate depend file for every program being
built, but then it does not properly tell each submake to use those
individual files.  Properly propagate the depend file to use.

Discovered while preparing the update of atf to 0.21 and noticing that
the test programs were not being relinked to the new library.

This change is "make tinderbox" clean.
2014-10-30 22:07:29 +00:00
Enji Cooper
05f0ff5a30 Fix the logic inversion in the previous commit by ensuring that the matched
expression (:M) is empty, not the not matched (:N) is empty. The former case
means we have not found the TEST_SUBDIR value in SUBDIR

Reported by: rodrigc
X-MFC with: r273803
Pointyhat to: me (did not use a clean install root)
Sponsored by: EMC / Isilon Storage Division
2014-10-29 04:32:46 +00:00
Enji Cooper
9aa9738938 Filter out TESTS_SUBDIRS already added to SUBDIR instead of blindly
appending the TESTS_SUBDIRS variable to SUBDIR

Duplicate directory entries can cause unexpected side effects, like
installing the same files multiple times. This can be easily
reproduced via the following testcase prior to this commit:

  SUBDIR= dir
  TESTS_SUBDIRS+= dir

  .include <bsd.test.mk>

Sponsored by: EMC / Isilon Storage Division
2014-10-28 23:01:09 +00:00
Enji Cooper
eb1fef6574 Fix linking static test binaries with atf.test.mk
Check for -static in LDFLAGS or LDFLAGS.<test>, then pass in the appropriate
dependency (LIBATF or LDATF)

This unbreaks the build with some of the NetBSD tests that need to be compiled
statically

Reviewed by: imp, jmmv
Phabric: D991
Sponsored by: EMC / Isilon Storage Division
2014-10-22 18:11:10 +00:00
John-Mark Gurney
14cac2a6f1 fix spelling of DEFAULT in comments... 2014-10-22 06:53:55 +00:00
Warner Losh
b55e8e6e0d My previous commit exposed an issue as it fixed a different
issue. lib/atf isn't a prereq_lib, since it isn't required for other
libraries to build. Remove it. The old kludge of always building it
had effectively been retired. Since we don't want to build the
libraries with the tests when we're bootstrapping, invent
MK_TESTS_SUPPORT which normally defaults to the current MK_TESTS
value, except when explicitly defined. Make lib/atf depend on it being
yes. When building the libraries set MK_TESTS to no, and
MK_TESTS_SUPPORT to the current value of MK_TESTS so that later stages
of the build work correctly. This should fix (and does for me)
people's issues with parallel builds racing between lib/atf and
libexec/atf. Since lib/atf is built during the libraries phase, the
race disappears.
2014-10-22 03:39:11 +00:00
Baptiste Daroussin
e82241aa78 Revert r273426 r273409
A solution that work with both new and old binutils should be investigated
2014-10-21 21:17:44 +00:00
Baptiste Daroussin
412013d7a8 older binutils does not know about --no-fatal-warnings 2014-10-21 21:09:54 +00:00
Warner Losh
289ee3b601 For the kernel, we have USB_GADGET_EXAMPLES as defaults to yes. For
userland defaults to no. This caused issues for the automated option
documenation script. Turns out, this isn't used in userland at all, so
just remove it from here.
2014-10-21 20:29:53 +00:00
Baptiste Daroussin
9904471bf3 Do not make ld(1) warnings fatal anymore, binutils behaviour has changed over the
time and gnu.warnings.symbol are now being fatal preventing building world.

in the futur we want to investigate only making the gnu.warning.symbol non fatal

Reviewed by:	imp
2014-10-21 20:11:05 +00:00
Baptiste Daroussin
ff2cf3685b Always use libc++ as the default c++ stack when building with an external gcc 4.8+
While here disable building gcc from base when using gcc 4.8+

Reviewed by:	imp
2014-10-21 20:00:49 +00:00
Baptiste Daroussin
d8d1a9ad6c When using an external toolchain note that gcc 4.8+ supports C++11
Submitted by:	imp
2014-10-21 19:58:23 +00:00
Baptiste Daroussin
8447c44fe7 The dependencies are computed with CC even if sources are C++, when building
when building with an external gcc, we want to be able to pass the path to
the libc++ headers so dependencies are correctly computed for C++ source files.
Add a DEPFLAGS for that purpose

Reviewed by:	imp
2014-10-21 19:56:45 +00:00
Mark Johnston
e9083b2dc5 Fix a few small bugs in the DTrace USDT rules:
* anchor search strings appropriately,
* use .ALLSRC to pass the full path to the D script to dtrace(1),
* don't insert the auto-generated header into SRCS - it doesn't
  accomplish anything, and we end up having to remove it from OBJS anyway.

Reviewed by:		rpaulo
Differential Revision:	https://reviews.freebsd.org/D978
MFC after:		3 weeks
Sponsored by:		EMC / Isilon Storage Division
2014-10-21 04:30:00 +00:00
Mark Johnston
cfcdd438f4 Don't define rules based on PROGS if PROGS is empty.
Reviewed by:	sjg, ngie
MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2014-10-16 21:13:46 +00:00
Warner Losh
f8080a9986 HYPERV isn't available on all architectures, but just on by default
for i386/amd64. Rather, it only works on i386/amd64 and should only be
built there. Rather than change the default based on which
architecutre, do things more directly by only building it on
i386/amd64 and having it always on. This is how we handle other
options that are relevant only for a few architectures.
2014-10-16 00:33:06 +00:00
Xin LI
f972197651 Promote libevent to lib/ level and fold ftp-proxy into its parent Makefile.
This allows us to use libevent for other application in the future.

For now libevent is still INTERNALLIB and no shared library is installed.

MFC after:	1 month
2014-10-13 22:15:26 +00:00
Enji Cooper
c57b274d49 Add LDFLAGS to PROG_VARS so it can be overridden on a per-PROG basis
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2014-10-10 22:18:09 +00:00
Baptiste Daroussin
78abccfc94 Make sure SIZE is defined early 2014-10-10 06:09:47 +00:00
Will Andrews
6cc777bf8b Revise r272363 by collapsing the tests into a for loop.
This has the side effect of ensuring that realpath is also run for the
nominal case of PORTSDIR=/usr/ports (assuming .CURDIR is a ports directory
that relies on /usr/ports but is not rooted in it).  This ensures that any
generated PORTSDIR used is always the actual location.

Submitted by:	jkim (different implementation)
2014-10-01 20:52:08 +00:00
Andrew Turner
66c5f84baf Clean up detection of big-endian ARM. In all cases we follow the pattern
arm*eb*. Check we are building for arm and if MACHINE_ARCH follows this
pattern.
2014-10-01 16:00:21 +00:00
Will Andrews
ff48e37159 Always resolve PORTSDIR to absolute paths using realpath(1).
Reported by:	madpilot
Reviewed by:	bapt
X-MFC-With:	272282
2014-10-01 15:02:37 +00:00
Andrew Turner
6d4766c1b8 Remove MK_ARM_EABI, the armeb issues have been fixed. The code to support
the oabi is still in the tree, but it is expected this will be removed
as developers work on surrounding code.

With this commit the ARM EABI is the only supported supported ABI by
FreeBSD on ARMa 32-bit processors.

X-MFC after:	never
Relnotes:	yes
Differential Revision: https://reviews.freebsd.org/D876
2014-10-01 08:26:51 +00:00
Mark Johnston
721dae3a52 Correct the way that libelf is linked when USDT is used. 2014-10-01 04:28:39 +00:00
Will Andrews
a0dec793d0 Search for the nearest PORTSDIR where Mk/bsd.ports.mk exists, from .CURDIR.
This will only take effect if PORTSDIR is not set, as previously supported.

Use .if exists(), for four specific possibilities relative to .CURDIR:
., .., ../.., and ../../..  The fourth possibility is primarily in case
ports ever grows a third level.  If none of these paths exist, fall back to
the old default of /usr/ports.

This removes the need to set PORTSDIR explicitly (or via wrapper script) if
one is running out of a ports tree that is not in /usr/ports, but in a
home directory.

Reviewed by:	bapt, bdrewery (older version)
CR:		D799
MFC after:	1 week
Sponsored by:	Spectra Logic
2014-09-29 15:05:23 +00:00
Enji Cooper
68e69f7343 Improve bsd.progs.mk compatibility with bsd.prog.mk
1. Do not install FILES/SCRIPTS multiple times if PROGS is specified; this is
   already handled via bsd.prog.mk when it's called recursively (PR: 191055,
   191955).
2. Some variables, like BINDIR and PROGNAME, default to a value if unset
   whereas others get appended to, like CFLAGS. Add support for the former case
   (PR: 191056)
3. Make "checkdpadd" and "clean" available targets for recursive execution.

Reviewed by: marcel, sjg
Phabric: D822
PR: 191055, 191056, 191955
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2014-09-24 04:45:35 +00:00
Xin LI
e72055b7fe Import HyperV Key-Value Pair (KVP) driver and daemon code by Microsoft,
many thanks for their continued support of FreeBSD.

While I'm there, also implement a new build knob, WITHOUT_HYPERV to
disable building and installing of the HyperV utilities when necessary.

The HyperV utilities are only built for i386 and amd64 targets.

This is a stable/10 candidate for inclusion with 10.1-RELEASE.

Submitted by:	Wei Hu <weh microsoft com>
MFC after:	1 week
2014-09-13 02:15:31 +00:00
Enji Cooper
41ae64f374 Remove many false positives with make checkdpadd
- Reduce DPADD and LDADD in checkdpadd to -l<foo>
- Skip over -Wl,[es]*-group because -Wl,--end-group and
  -Wl,--start-group might be required to properly link objects (see
  usr.bin/clang/lldb as an example)

This caveat has been present for a while with some components of
the build. However, these false positives were made more more apparent
after r269648.

Phabric: D635
Reviewed by: jmmv (an earlier version)
PR: 192730
MFC after: 2 weeks
2014-09-10 07:55:51 +00:00
Mark Johnston
5439a71566 Define _DTRACE_VERSION in sdt.h rather than setting it manually. This is
similar to what illumos does, and makes it easier to enable USDT probes
in third-party software that doesn't make use of the system makefiles.
2014-09-02 23:43:06 +00:00
Ed Maste
6e52173261 Allow standalone debug for non-default ${PROG} targets
This allows WITH_DEBUG_FILES to produce standalone debug for the ELF
runtime linker.

We previously disabled standalone debug files for bsd.prog.mk consumers
that included a non-default ${PROG} target, but this is not required.

Consumers that do not support standalone debug are still handled by
disabling it for statically linked binaries, and for those that specify
a non-default binary format.

Sponsored by:	DARPA, AFRL
2014-09-02 19:05:34 +00:00
Ed Schouten
13b7412dad Add -Wthread-safety to WARNS=6.
While there, add a NO_WTHREAD_SAFETY flag that can be used to disable
this specific warning flag. Disable it for auditdistd. We can easily
patch up auditdistd to have the right annotations to build, but as
auditdistd is intended to be portable across other operating systems,
it's not worth the effort.

Approved by:	brueffer@
2014-09-01 20:18:09 +00:00
Enji Cooper
2dba8ab00d Introduce missing definition for LIBTERMCAPW
Some Makefiles expect this value to exist

Approved by: rpaulo (mentor)
MFC after: 5 days
Phabric: D675 (as part of a larger diff)
PR: 192762
2014-08-26 09:12:41 +00:00
Enji Cooper
3303bfc042 Fix "make checkdpadd" for lib/libc when MK_SSP != no
Add LIBSSP_NONSHARED to bsd.libnames.mk and append LIBSSP_NONSHARED to DPADD in
lib/libc when MK_SSP != no

Approved by: rpaulo (mentor)
MFC after: 3 days
Phabric: D675 (as part of a larger diff)
PR: 192728
2014-08-25 06:10:03 +00:00
Bryan Drewery
5608fd23c2 Revert r267233 for now. PIE support needs to be reworked.
1. 50+% of NO_PIE use is fixed by adding -fPIC to INTERNALLIB and other
   build-only utility libraries.
2. Another 40% is fixed by generating _pic.a variants of various libraries.
3. Some of the NO_PIE use is a bit absurd as it is disabling PIE (and ASLR)
   where it never would work anyhow, such as csu or loader. This suggests
   there may be better ways of adding support to the tree. Many of these
   cases can be fixed such that -fPIE will work but there is really no
   reason to have it in those cases.
4. Some of the uses are working around hacks done to some Makefiles that are
   really building libraries but have been using bsd.prog.mk because the code
   is cleaner. Had they been using bsd.lib.mk then NO_PIE would not have
   been needed.

We likely do want to enable PIE by default (opt-out) for non-tree consumers
(such as ports). For in-tree though we probably want to only enable PIE
(opt-in) for common attack targets such as remote service daemons and setuid
utilities. This is also a great performance compromise since ASLR is expected
to reduce performance. As such it does not make sense to enable it in all
utilities such as ls(1) that have little benefit to having it enabled.

Reported by:	kib
2014-08-19 15:04:32 +00:00
Adrian Chadd
51bfac0253 Make the libbsdstat useful again. 2014-08-13 19:43:22 +00:00
Rui Paulo
9c851217b6 Make sure the DTrace header files are built before depend and before
the build starts.

This adds a new variable DHDRS that contains a list of all DTrace
header files.  Then, we use the beforedepend hook to make sure the
heaeder files are built.

Introduce a beforebuild dependency (from projects/bmake) based on
feedback from Simon J. Gerraty.  This lets us generate the header
files without running make depend.

Reviewed by:	sjg, imp
MFC after:	3 days
2014-08-13 01:27:51 +00:00
Rui Paulo
17b227229c Revert r269839.
This doesn't work like I expected and the if clause is never matched.
It turns out that the problem with the older make is unrelated.

MFC after:	3 days
2014-08-11 22:43:44 +00:00
Rui Paulo
8a152f97e7 Add .d files to the reverse matching pattern in bsd.dep.mk to account
for source file dependencies.

This follows the .y and .l behaviour.

MFC after:	3 days
2014-08-11 21:42:06 +00:00