Commit Graph

2418 Commits

Author SHA1 Message Date
Dimitry Andric
381fba8537 Merge r293006 from clang380-import branch:
For determining the compiler version, quote the string to be echo'd,
otherwise the command might fail.  This is because clang -v now results
in the following:

FreeBSD clang version 3.8.0 (trunk 256633) (based on LLVM 3.8.0svn)

The second "3.8.8svn)" string tripped up the shell command.

MFC after:	3 days
2015-12-31 22:48:46 +00:00
Dimitry Andric
79f08b9adf For determining the compiler version, quote the string to be echo'd,
otherwise the command might fail.  This is because clang -v now results
in the following:

FreeBSD clang version 3.8.0 (trunk 256633) (based on LLVM 3.8.0svn)

The second "3.8.8svn)" string tripped up the shell command.
2015-12-31 21:01:06 +00:00
Dimitry Andric
34cdd77646 First part of updating llvm/clang build glue: getting llvm-tblgen,
clang-tblgen and clang itself built.
2015-12-31 14:39:45 +00:00
Colin Percival
f051a5b324 Make libxnet.so a symlink to libc.so. This makes -lxnet a no-op, as
POSIX requires for the c99 compiler.

(In fact, our c99(1) already ignores -lxnet; but our make(1) doesn't set
${CC} correctly, and our cc(1) treats xnet like any other library.)

Reviewed by:	kib
2015-12-25 11:29:18 +00:00
Colin Percival
6729297833 Document that make's .POSIX: handling is broken. In fact, it has been
broken ever since it was added in November 1996.
2015-12-25 10:08:42 +00:00
Enji Cooper
3bbee5556a Clean up Kyuafile.tmp, not Kyuafile.auto.tmp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D4406 (part of a larger diff)
Reviewed by: emaste, Evan Cramer <eccramer@gmail.com>
Sponsored by: EMC / Isilon Storage Division
2015-12-20 06:29:03 +00:00
Enji Cooper
46319c9839 Document LOCALBASE in the bsd.test.mk section
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D4406 (part of a larger diff)
Reviewed by: emaste, Evan Cramer <eccramer@gmail.com>
Sponsored by: EMC / Isilon Storage Division
2015-12-20 06:27:36 +00:00
Enji Cooper
26dfa13578 - Use LOCALBASE instead of KYUA_PREFIX for the --prefix to kyua(1)
- Use LOCALBASE instead of hardcoding /usr/local for perl

MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D4406 (part of a larger diff)
Reviewed by: emaste, Evan Cramer <eccramer@gmail.com>
Sponsored by: EMC / Isilon Storage Division
2015-12-20 06:26:15 +00:00
Enji Cooper
fd6f8c3710 Deal with another hardcoded reference to Kyuafile in the KYUAFILE == auto
case

Differential Revision: https://reviews.freebsd.org/D4406 (part of a larger diff)
Reviewed by: emaste, Evan Cramer <eccramer@gmail.com>
Sponsored by: EMC / Isilon Storage Division
2015-12-20 06:01:53 +00:00
Enji Cooper
cc696e80e7 Fix typo in r292500 by adding missing conditional statement
MFC after: 1 week
X-MFC with: r292500
Pointyhat to: ngie
Differential Revision: https://reviews.freebsd.org/D4406 (part of a larger diff)
Sponsored by: EMC / Isilon Storage Division
2015-12-20 05:41:12 +00:00
Enji Cooper
c4835f11d0 Simplify Kyuafile generation logic with KYUAFILE == auto and
related complexity with variables

MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D4406 (part of a larger diff)
Reviewed by: emaste, Evan Cramer <eccramer@gmail.com>
Sponsored by: EMC / Isilon Storage Division
2015-12-20 05:38:06 +00:00
Ed Maste
d0ba16f775 Enable LLDB by default on amd64 and arm64
LLDB is usable for userland core file and live debugging on amd64, and
for userland core file debugging on arm64. In general it works at least
as well on FreeBSD as our in-tree gdb version, so enable it by default
to allow for broader use and testing.

An LLDB tutorial is available at http://lldb.llvm.org/tutorial.html, and
a table mapping GDB commands to LLDB commands can be found at
http://lldb.llvm.org/lldb-gdb.html .

LLDB also has some level of support for FreeBSD on arm, mips, i386,
and powerpc, but is not yet ready to have them enabled by default.

Reviewed by:	gnn
Relnotes:	Yes
2015-12-16 19:23:10 +00:00
Bryan Drewery
66f96a1362 DIRDEPS_BUILD: Support bootstrapping from PROGS.(DPADD|LIBADD).
Sponsored by:	EMC / Isilon Storage Division
2015-12-15 02:51:05 +00:00
Bryan Drewery
a09a83ca33 DIRDEPS_BUILD: Fix incorrectly adding in RELDIR for DIRDEPS in bootstrapping.
This is not wrong, but was unexpected.  Using <empty>:H results in '.' which
then using the rest of the conversion was added in RELDIR.  This was also
causing an empty _DP_DIRDEPS to resolve to SRCTOP for DIRDEPS.

Sponsored by:	EMC / Isilon Storage Division
2015-12-15 02:46:14 +00:00
Bryan Drewery
92cc283761 DIRDEPS_BUILD: Avoid duplicates in DIRDEPS for bootstrapping.
This logic is potentially included multiple times, so overwrite the temporary
variable rather than append to it.

Sponsored by:	EMC / Isilon Storage Division
2015-12-15 02:27:31 +00:00
Bryan Drewery
382cab60bd Add comment about OBJTOP not yet being defined outside of META MODE.
It is fine for the purpose of the check though.

Sponsored by:	EMC / Isilon Storage Division
2015-12-15 00:40:04 +00:00
Bryan Drewery
aaa345b8ae Follow-up r291739: Don't suggest LDADD on private libs to use LIBADD.
This is because LDADD+=-lFOO is not the same as LDADD+=-lprivateFOO which is
what the private libs in LIBADD are.

Sponsored by:	EMC / Isilon Storage Division
2015-12-15 00:16:34 +00:00
John Baldwin
d6fb489498 Start on a new library (libsysdecode) that provides routines for decoding
system call information such as system call arguments.  Initially this
will consist of pulling duplicated code out of truss and kdump though it
may prove useful for other utilities in the future.

This commit moves the shared utrace(2) record parser out of kdump into
the library and updates kdump and truss to use it.  One difference from
the previous version is that the library version treats unknown events
that start with the "RTLD" signature as unknown events.  This simplifies
the interface and allows the consumer to decide how to handle all
non-recognized events.  Instead, this function only generates a string
description for known malloc() and RTLD records.

Reviewed by:	bdrewery
Differential Revision:	https://reviews.freebsd.org/D4537
2015-12-15 00:05:07 +00:00
Bryan Drewery
89401452f3 Allow overriding FILESDIRs for snmp files.
Sponsored by:	EMC / Isilon Storage Division
2015-12-14 22:42:05 +00:00
Bryan Drewery
e610b45868 Let termcap be used in LIBADD.
Sponsored by:	EMC / Isilon Storage Division
2015-12-14 21:00:00 +00:00
Bryan Drewery
54f8ee8840 DIRDEPS_BUILD: Don't force C dependencies on kernel modules for bootstrapping.
These use ld(1), effectively -nostdlib, and don't need any of these
normal dependencies.

kmod builds also define PROG so just checking for KMOD here seems to be
the easiest to handle it.

Sponsored by:	EMC / Isilon Storage Division
2015-12-11 22:55:41 +00:00
Ruslan Bukin
1fdcc5e5c0 Start support for the RISC-V 64-bit architecture developed by UC Berkeley.
RISC-V is a new ISA designed to support computer research and education, and
is now become a standard open architecture for industry implementations.

This is a minimal set of changes required to run 'make kernel-toolchain'
using external (GNU) toolchain.

The FreeBSD/RISC-V project home: https://wiki.freebsd.org/riscv.

Reviewed by:	andrew, bdrewery, emaste, imp
Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
Differential Revision:	https://reviews.freebsd.org/D4445
2015-12-11 22:55:23 +00:00
Marcelo Araujo
682d840496 Fix minor typos introduced on r292084.
Approved by:	rodrigc (mentor)
Differential Revision:	https://reviews.freebsd.org/D4495
2015-12-11 07:24:25 +00:00
Warner Losh
fd48e7a5af Handle CPUTYPE=armv[4567]* better. gcc expects those to be either
-march=foo or -mcpu=generic-foo. Catch the armvX* case and pass
the right args for it.
2015-12-11 05:39:45 +00:00
Warner Losh
9ca5434380 Move the inclusion of bsd.cpu.mk from sys.mk to bsd.opts.mk. However,
for historical behavior that ports depends on, include it if we're
inside the ports tree.

Differential Review: https://reviews.freebsd.org/D4383
Ports Exp run: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=205021
2015-12-11 05:39:44 +00:00
Bryan Drewery
de1f9ee234 Convert contrib/ofed libraries to LIBADD.
Sponsored by:	EMC / Isilon Storage Division
2015-12-10 00:07:11 +00:00
Bryan Drewery
5e99f8430d Sort the LIB list.
Sponsored by:	EMC / Isilon Storage Division
2015-12-10 00:07:05 +00:00
Bryan Drewery
b7df39cc12 CCACHE_BUILD: Only export CCACHE_PATH= if it was already set with a value.
Older ccache don't work with an empty CCACHE_PATH value.  They will error with:
  ccache: FATAL: Could not find compiler "cc" in PATH
  make: "/mnt/bdrewery/git/onefs/src/share/mk/bsd.compiler.mk" line 134: Unable to determine compiler type for /usr/local/bin/ccache cc.  Consider setting COMPILER_TYPE.

Sponsored by:	EMC / Isilon Storage Division
2015-12-08 20:20:40 +00:00
Ed Maste
1cee64a8c7 Add comment explaining aarch64's BROKEN_OPTIONS
In-tree bintuils and GCC do not support aarch64 or other recent
architectures.
2015-12-08 19:19:26 +00:00
Bryan Drewery
fb9def88bd META MODE: Define a STAGE_TARGET_OBJTOP and export it alone with
STAGE_OBJTOP and STAGE_HOST_OBJTOP.

These will always be overridden in sub-makes when building in-tree, but
are exported for the benefit of hooking in external builds, such as
ports.

Sponsored by:	EMC / Isilon Storage Division
2015-12-08 17:56:40 +00:00
Bryan Drewery
9229b1797a Fix some makeman issues.
- Don't bother looking up REVISION/BRANCH/etc from release/, or the
  CPUTYPE check, as these are not used for makeman and wastes time.  The also
  invokes auto.obj.mk after I reverted auto.obj.mk ignoring -V in r291312.
- Don't modify CC or PATH when WITH_CCACHE_BUILD or WITH_META_MODE is enabled
  as it leads to bsd.compiler.mk errors.

Sponsored by:	EMC / Isilon Storage Division
2015-12-08 17:09:17 +00:00
Ed Maste
015dfda6c6 Build and install userland .debug files by default
Debug data files are now built by default with 'make buildworld' and
installed with 'make installworld'. This facilitates debugging but
requires more disk space both during the build and for the installed
world. Debug files may be disabled by setting WITHOUT_DEBUG_FILES=yes
in src.conf(5).

Reviewed by:	bdrewery, eadler, vangyzen
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D4018
2015-12-07 19:15:52 +00:00
Bryan Drewery
10f696a52d FAST_DEPEND: Only pass -MF if we care about the object being compiled.
This will save time generating dependency files that we didn't expect
due to cases where SRCS!=OBJS or for building custom targetted objects
in Makefiles that do not end up in the DEPENDOBJS list.

This uses a bmake trick to modify CFLAGS based on ${.TARGET}.  A
.PARSEDIR check is done for the sake of MFC safety.

MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2015-12-07 16:08:22 +00:00
Bryan Drewery
b9964333e0 FAST_DEPEND: Move handling code below yacc/lex/dtrace code that modified SRCS.
This fixes some of those newly added SRCS not having their depend files
included.

MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2015-12-07 16:08:19 +00:00
Bryan Drewery
69afbf0275 FAST_DEPEND: Only try to use dependencies from C/C++ SRCS as mkdep did.
Rather than try to guess at all of the OBJS variables just use SRCS
using the same patterns that mkdep does.  This also fixes a mistake
where dependencies were being generated with FAST_DEPEND when they were
not for mkdep.  This happens when OBJS!=SRCS as is the case in
gnu/lib/csu where SRCS has 1 file and OBJS has several other files that
does not even contain the 1 SRCS file.  Generally in these cases the
OBJS have custom dependencies defined in their Makefile.  If we generate
dependencies for those and then load a .depend file, then .IMPSRC may
contain duplicate sources and lead to errors such as:
  cc: error: cannot specify -o when generating multiple output files

MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2015-12-07 16:08:16 +00:00
Enji Cooper
765086c5da Remove unused atf.test.mk variables
- ATF_BUILD_CC
- ATF_BUILD_CPP
- ATF_BUILD_CXX
- ATF_SHELL
- ATF_PREFIX

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2015-12-06 07:30:18 +00:00
Enji Cooper
7254383959 Remove redundant default TESTSDIR that is already defined in bsd.test.mk
after r289158

MFC after: 1 week
X-MFC with: r289158
Sponsored by: EMC / Isilon Storage Division
2015-12-06 07:00:23 +00:00
Bryan Drewery
2231cd21d8 Fix 'install*' and many other missing targets with DIRDEPS_BUILD.
My changes in r291635 broke 'make install*' for DIRDEPS_BUILD but also
revealed that some other targets were not guaranteed to be created if
there was a SUBDIR defined.  One example is 'installfiles' was never
defined if SUBDIR was not empty.

Sponsored by:	EMC / Isilon Storage Division
2015-12-04 07:54:19 +00:00
Bryan Drewery
0368d219ac The .if redirection on .WAIT is no longer needed with bmake.
Sponsored by:	EMC / Isilon Storage Division
2015-12-04 07:54:16 +00:00
Bryan Drewery
85874b565c Fix 'afterinstall' order not being respected after my changes in r291635.
The problem was that 'afterinstall' was not coming after SUBDIRs were
installed which was the expectation at least in sys/modules for kldxref.

Reported by:	np
Pointyhat to:	bdrewery
Sponsored by:	EMC / Isilon Storage Division
2015-12-04 07:54:13 +00:00
Bryan Drewery
b4f9ba38ee Rearrange some common logic. 2015-12-04 07:54:04 +00:00
Bryan Drewery
7b861220df Add assertion for when LIBADD should be used rather than LDADD/DPADD.
Sponsored by:	EMC / Isilon Storage Division
2015-12-04 03:17:59 +00:00
Bryan Drewery
eacae6dc66 Fix LDADD/DPADD that should be LIBADD.
Sponsored by:	EMC / Isilon Storage Division
2015-12-04 03:17:47 +00:00
Bryan Drewery
2fd6394d34 Rework unknown LIBADD assertion to be more clear and to not suggest adding
DPADD/LDADD_<foo> variables that are a special case.

Sponsored by:	EMC / Isilon Storage Division
2015-12-04 03:17:24 +00:00
Bryan Drewery
3530922240 Support all of the CDDL/ZFS libraries for LIBADD.
Sponsored by:	EMC / Isilon Storage Division
2015-12-04 03:17:21 +00:00
Bryan Drewery
7aab86d59d For INTERNALLIB always add in the corresponding _DP_ and use LIBADD in
the real build file.

This lessens the need to define DPADD_<lib> and LDADD_<lib> to just very
special cases.

Sponsored by:	EMC / Isilon Storage Division
2015-12-04 03:17:17 +00:00
Bryan Drewery
568f2ee158 Don't create a Makefile.depend in share/mk.
This would cause it to be included everywhere in the build since it is
the MAKESYSPATH.  This leads to including dirdeps.mk more times than
desired.

Sponsored by:	EMC / Isilon Storage Division
2015-12-04 03:17:10 +00:00
Bryan Drewery
249f51a492 DIRDEPS_BUILD: Install new Makefile.depend files atomically.
Sponsored by:	EMC / Isilon Storage Division
2015-12-04 03:17:07 +00:00
Bryan Drewery
bd1944cacc DIRDEPS_BUILD: For the bootstrapped LIBADD from DPADD, resolve paths to RELDIR.
This allows the LIBDEPS/DPADD for the clang build to not have
../../../lib/clang/* in DIRDEPS.

Sponsored by:	EMC / Isilon Storage Division
2015-12-04 03:17:04 +00:00
Bryan Drewery
d6b837de97 Revert r288966 as it is redundant and not right.
bsd.prog.mk and bsd.lib.mk already make OBJS depend on headers when there is
not .OBJDIR/.depend file, which is still true for the initial meta mode builds.
If there was something to benefit the meta mode build here then it should be
extended to the non-meta mode build as well.

Some of the problems here were just DPSRCS being hooked up wrongly, fixed in
r291330.

The logic itself is flawed as 'buildfiles' is in a different part of the
dependency tree than the objects and headers are, so the objects will still be
built independent from 'buildfiles'.  'buildfiles' is not ordered in the build
before objects.

Sponsored by:	EMC / Isilon Storage Division
2015-12-03 22:39:42 +00:00