Commit Graph

4206 Commits

Author SHA1 Message Date
Glen Barber
a123f26e92 MFH
Sponsored by:	The FreeBSD Foundation
2016-04-12 17:00:13 +00:00
Bryan Drewery
8a5f439677 META_MODE: Avoid changed build command every build.
Because the file is generated with -f using another Makefile, 2
different Makefiles are trying to handle the .meta file for the
target.  The obvious .NOMETA_CMP or .NOMETA on the ${MAKE} targets
don't work as they are very limited in scope in bmake.  Using
.PHONY fixes the problem and ensures that the ${MAKE} command
is always ran to check if it is outdated in the sub-make.

An example of the problem in gnu/lib/libgcc (with make -dM):
  /usr/obj/root/git/freebsd/gnu/lib/libgcc/tm.h.meta: 2: a build command has changed
  TARGET_CPU_DEFAULT=""  HEADERS="options.h i386/biarch64.h i386/i386.h i386/unix.h i386/att.h dbxelf.h elfos-undef.h elfos.h freebsd-native.h freebsd-spec.h freebsd.h i386/x86-64.h i386/freebsd.h i386/freebsd64.h defaults.h"  DEFINES=""  /bin/sh /root/git/freebsd/gnu/lib/libgcc/../../../contrib/gcc/mkconfig.sh tm.h
  vs
  (cd /root/git/freebsd/gnu/lib/libgcc; make -f /root/git/freebsd/gnu/lib/libgcc/../../usr.bin/cc/cc_tools/Makefile MFILE=/root/git/freebsd/gnu/lib/libgcc/../../usr.bin/cc/cc_tools/Makefile GCCDIR=/root/git/freebsd/gnu/lib/libgcc/../../../contrib/gcc tm.h)
  Skipping meta for tm.h: .NOMETA
  (cd /root/git/freebsd/gnu/lib/libgcc; make -f /root/git/freebsd/gnu/lib/libgcc/../../usr.bin/cc/cc_tools/Makefile MFILE=/root/git/freebsd/gnu/lib/libgcc/../../usr.bin/cc/cc_tools/Makefile GCCDIR=/root/git/freebsd/gnu/lib/libgcc/../../../contrib/gcc tm.h)
  `tm.h' is up to date.

Sponsored by:	EMC / Isilon Storage Division
2016-04-12 02:45:19 +00:00
Glen Barber
d60840138f MFH
Sponsored by:	The FreeBSD Foundation
2016-04-04 23:55:32 +00:00
Bryan Drewery
497e80911e Remove the old depend (mkdep) code and make FAST_DEPEND the one true way.
Reviewed by:	emaste, hselasky (partial), brooks (brief)
Discussed on:	arch@
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D5742
2016-03-30 23:50:23 +00:00
Glen Barber
7d536dc855 MFH
Sponsored by:	The FreeBSD Foundation
2016-03-10 21:16:01 +00:00
Bryan Drewery
15c433351f DIRDEPS_BUILD: Connect MK_TESTS.
Sponsored by:	EMC / Isilon Storage Division
2016-03-09 22:46:01 +00:00
Glen Barber
52259a98ad MFH
Sponsored by:	The FreeBSD Foundation
2016-03-02 16:14:46 +00:00
Mariusz Zaborski
c501d73c7e Convert casperd(8) daemon to the libcasper.
After calling the cap_init(3) function Casper will fork from it's original
process, using pdfork(2). Forking from a process has a lot of advantages:
1. We have the same cwd as the original process.
2. The same uid, gid and groups.
3. The same MAC labels.
4. The same descriptor table.
5. The same routing table.
6. The same umask.
7. The same cpuset(1).
From now services are also in form of libraries.
We also removed libcapsicum at all and converts existing program using Casper
to new architecture.

Discussed with:		pjd, jonathan, ed, drysdale@google.com, emaste
Partially reviewed by:	drysdale@google.com, bdrewery
Approved by:		pjd (mentor)
Differential Revision:	https://reviews.freebsd.org/D4277
2016-02-25 18:23:40 +00:00
Bryan Drewery
90a2d98448 OBJS and POBJS have not been used since r215127.
r215127 disabled building of libgcc.a.

MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-02-24 22:27:18 +00:00
Bryan Drewery
6607cb5de8 Don't hide AR command as bsd.lib.mk's r283925 changed as well.
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-02-24 21:19:44 +00:00
Bryan Drewery
bd18fd57db DIRDEPS_BUILD: Regenerate without local dependencies.
These are no longer needed after the recent 'beforebuild: depend' changes
and hooking DIRDEPS_BUILD into a subset of FAST_DEPEND which supports
skipping 'make depend'.

Sponsored by:	EMC / Isilon Storage Division
2016-02-24 17:20:11 +00:00
Glen Barber
72c3aa02dc MFH
Sponsored by:	The FreeBSD Foundation
2016-02-18 00:37:58 +00:00
Ed Maste
cdfecc9da0 Hardcode date in RCS paper for reproducibility
The 1995/06/01 date is taken from the $Id$ entry in rcs.ms from RCS 5.7,
the last version we imported, and is more meaningful than the OS build
date.

Reviewed by:	eadler
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D5299
2016-02-17 14:34:01 +00:00
Glen Barber
c389411c8a Remove libc, librtld_db, libthr packages, and further increase
the constraints on what needs to be installed in a specific to
maintain consistency during upgrades.

Create a new clibs package containing libraries that are needed
as a bare minimum for consistency.

With much help and input from:	kib
Sponsored by:	The FreeBSD Foundation
2016-02-05 21:01:08 +00:00
Glen Barber
1f4bcc459a More 'tests' packaging fixes.
Sponsored by:	The FreeBSD Foundation
2016-02-03 19:08:45 +00:00
Glen Barber
43faedc133 First pass to fix the 'tests' packages.
Sponsored by:	The FreeBSD Foundation
2016-02-02 22:26:49 +00:00
Glen Barber
c8296cbb96 MFH
Sponsored by:	The FreeBSD Foundation
2016-01-29 14:52:54 +00:00
Alexander Kabaev
a2e4e33f34 Make .debug file for libgcc_s.so.1 more useful.
The files compiled into libgcc_s.so.1 did not have -g on
compiler command line, making generated .debug quite
pointless.
2016-01-27 20:20:35 +00:00
Glen Barber
0e186c0aab MFH
Sponsored by:	The FreeBSD Foundation
2016-01-27 14:16:13 +00:00
Ruslan Bukin
faf51c558e Make libgcc compilable on RISC-V. 2016-01-26 14:45:21 +00:00
Glen Barber
f9421853ad MFH
Sponsored by:	The FreeBSD Foundation
2016-01-25 14:13:28 +00:00
Ed Maste
5abb4cd79f Use MAN= to specify that no man page is provided
NO_MAN is deprecated.

Reviewed by:	imp
2016-01-22 21:33:27 +00:00
Ed Maste
fff38c35ae Restore libunwind.cpp to LLVM libunwind build (reverts r294576)
The unw_* functions are not exported, but are used internally.
2016-01-22 19:03:39 +00:00
Ed Maste
596675a64d Drop HP libunwind (unw_*) functions from LLVM libunwind
They are not needed for exception handling.
2016-01-22 16:47:36 +00:00
Ed Maste
ba86521396 Remove old generated unwind.h when using LLVM libunwind
When not using LLVM libunwind, unwind.h is a generated header and a stale
copy may remain in the OBJDIR after enabling LLVM libunwind. Explicitly
remove it.

Reported by:	bz
Reviewed by:	bdrewery
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D5019
2016-01-22 02:28:17 +00:00
Glen Barber
59d43d11fe MFH
Sponsored by:	The FreeBSD Foundation
2016-01-20 09:50:54 +00:00
Ed Maste
0c9eb4d63a Remove local override for .cpp.o and .cpp.po rules
The local build rule used to set -fvisibility=hidden and -fPIC, in
addition to -fexceptions and -D defines that had no effect.

With -fvisibility=hidden and -fPIC in STATIC_CXXFLAGS the standard
bsd.lib.mk rules are suitable for libgcc_s's C++ source.

PR:		206381
Sponsored by:	The FreeBSD Foundation
2016-01-19 17:40:29 +00:00
Ed Maste
c4601d6dfb Remove local override for .cpp.So rule
The standard bsd.lib.mk rule is suitable for libgcc_s's C++ source.

The local rule had the following non-functional argument differences
or additions:

1. -DSHARED (rather than -DPIC from bsd.lib.mk)

   The C++ sources don't have an #ifdef for either one.

2. -fexceptions

   This is enabled by default for C++ so does not need to be set
   explicitly.

3. -D__GLIBC__=3

   Not used by LLVM libunwind.

4. -DElfW=__ElfN

   LLVM libunwind provides its own definition.

PR:		206381
Differential Revision:	The FreeBSD Foundation
2016-01-19 03:54:38 +00:00
Glen Barber
e60680024a MFH
Sponsored by:	The FreeBSD Foundation
2016-01-12 01:23:45 +00:00
Ed Maste
b80f3546a8 Support use of LLVM's libunwind for exception unwinding
It is built in libgcc_s.so and libgcc_eh.a to simplify transition.

It is enabled by default on arm64 (where we previously had no other
unwinder) and may be enabled for testing on other platforms by setting
WITH_LLVM_LIBUNWIND in src.conf(5).

Also add compiler-rt's __gcc_personality_v0 implementation for use with
the LLVM unwinder.

Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D4787
2016-01-09 00:42:07 +00:00
Glen Barber
0c9da521fa MFH
Sponsored by:	The FreeBSD Foundation
2016-01-07 17:23:43 +00:00
Ed Maste
dbecd1bfdf Switch GNU ld to be installed as ld.bfd and linked as ld
We intend to replace GNU ld with LLVM's lld, and on the path to there
we'll experiment with having lld installed or linked as /usr/bin/ld.
Thus, make ld.bfd the primary install target for GNU ld, to later
facilitate making the ld link optional.

Reviewed by:	davide, dim
Differential Revision:	https://reviews.freebsd.org/D4790
2016-01-07 00:15:02 +00:00
Glen Barber
b626f5a73a MFH r289384-r293170
Sponsored by:	The FreeBSD Foundation
2016-01-04 19:19:48 +00:00
Ed Maste
e7beaf9968 Install ld also as ld.bfd, for use with cc -fuse-ld=bfd
PR:		205409 [exp-run]
MFC after:	1 week
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
2015-12-23 14:31:26 +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
3c89d6b0e3 Don't override LIB*DIR variables from src.libnames.mk.
In some cases switch to the LIB*SRCDIR value.

These recently were defined in r291327 and r291619.

Sponsored by:	EMC / Isilon Storage Division
2015-12-01 22:20:04 +00:00
Bryan Drewery
b1f92fa229 META MODE: Update dependencies with 'the-lot' and add missing directories.
This is not properly respecting WITHOUT or ARCH dependencies in target/.
Doing so requires a massive effort to rework targets/ to do so.  A
better approach will be to either include the SUBDIR Makefiles directly
and map to DIRDEPS or just dynamically lookup the SUBDIR.  These lose
the benefit of having a userland/lib, userland/libexec, etc, though and
results in a massive package.  The current implementation of targets/ is
very unmaintainable.

Currently rescue/rescue and sys/modules are still not connected.

Sponsored by:	EMC / Isilon Storage Division
2015-12-01 05:23:19 +00:00
Bryan Drewery
cf990407e1 Update dependencies after r291406 added libelf to libkvm.
Unfortunately filemon/meta mode tracks all indirect dependencies here
since ld(1) is reading libelf when linking in libkvm.  Churn would be
reduced if this was able to be limited to direct dependencies.

Sponsored by:	EMC / Isilon Storage Division
2015-12-01 05:18:48 +00:00
John Baldwin
fe5f4c93fe Fix a double-semicolon typo in my libkvm changes.
Submitted by:	jmallett
2015-11-30 21:53:24 +00:00
John Baldwin
7f911abe54 Add support to libkvm for reading vmcores from other architectures.
- Add a kvaddr_type to represent kernel virtual addresses instead of
  unsigned long.
- Add a struct kvm_nlist which is a stripped down version of struct nlist
  that uses kvaddr_t for n_value.
- Add a kvm_native() routine that returns true if an open kvm descriptor
  is for a native kernel and memory image.
- Add a kvm_open2() function similar to kvm_openfiles().  It drops the
  unused 'swapfile' argument and adds a new function pointer argument for
  a symbol resolving function.  Native kernels still use _fdnlist() from
  libc to resolve symbols if a resolver function is not supplied, but cross
  kernels require a resolver.
- Add a kvm_nlist2() function similar to kvm_nlist() except that it uses
  struct kvm_nlist instead of struct nlist.
- Add a kvm_read2() function similar to kvm_read() except that it uses
  kvaddr_t instead of unsigned long for the kernel virtual address.
- Add a new kvm_arch switch of routines needed by a vmcore backend.
  Each backend is responsible for implementing kvm_read2() for a given
  vmcore format.
- Use libelf to read headers from ELF kernels and cores (except for
  powerpc cores).
- Add internal helper routines for the common page offset hash table used
  by the minidump backends.
- Port all of the existing kvm backends to implement a kvm_arch switch and
  to be cross-friendly by using private constants instead of ones that
  vary by platform (e.g. PAGE_SIZE).  Static assertions are present when
  a given backend is compiled natively to ensure the private constants
  match the real ones.
- Enable all of the existing vmcore backends on all platforms.  This means
  that libkvm on any platform should be able to perform KVA translation
  and read data from a vmcore of any platform.

Tested on:	amd64, i386, sparc64 (marius)
Differential Revision:	https://reviews.freebsd.org/D3341
2015-11-27 18:58:26 +00:00
Bryan Drewery
7fdd45b091 Use LIBEXECDIR for /usr/libexec.
MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2015-11-26 01:14:40 +00:00
Bryan Drewery
114350b9de Replace DPSRCS that work fine in SRCS.
This is so that 'make depend' is not a required build step in these
files.

DPSRCS is overall unneeded.  DPSRCS already contains SRCS, so anything
which can safely be in SRCS should be.  DPSRCS is mostly just a way to
generate files that should not be linked into the final PROG/LIB.  For
headers and grammars it is safe for them to be in SRCS since they will
be excluded during linking and installation.

The only remaining uses of DPSRCS are for generating .c or .o files that
must be built before 'make depend' can run 'mkdep' on the SRCS c files
list.  A semi-proper example is in tests/sys/kern/acct/Makefile where a
checked-in .c file has an #include on a generated .c file.  The
generated .c file should not be linked into the final PROG though since
it is #include'd.  The more proper way here is just to build/link it in
though without DPSRCS.  Another example is in sys/modules/linux/Makefile
where a shell script runs to parse a DPSRCS .o file that should not be
linked into the module.  Beyond those, the need for DPSRCS is largely
unneeded, redundant, and forces 'make depend' to be ran.  Generally,
these Makefiles should avoid the need for DPSRCS and define proper
dependencies for their files as well.

An example of an improper usage and why this matters is in usr.bin/netstat.
nl_defs.h was only in DPSRCS and so was not generated during 'make all',
but only during 'make depend'.  The files including it lacked proper
depenencies on it, which forced running 'make depend' to workaround that
bug.  The 'make depend' target should mostly be used for incremental build
help, not to produce a working build.  This specific example was broken in
the meta build until r287905 since it does not run 'make depend'.

The gnu/lib/libreadline/readline case is fine since bsd.lib.mk has 'OBJS:
SRCS:M*.h' when there is no .depend file.

Sponsored by:	EMC / Isilon Storage Division
MFC after:	1 week
2015-11-25 20:38:17 +00:00
Bryan Drewery
b791fbe630 META MODE: Don't create .meta files when symlinking sources into the obj directory.
Tracking these leads to situations where meta mode will consider the
file to be out of date if /bin/sh or /bin/ln are newer than the source
file.  There's no reason for meta mode to do this as make is already
handling the rebuild dependency fine.

Sponsored by:	EMC / Isilon Storage Division
2015-11-25 19:44:43 +00:00
Bryan Drewery
7b3ea376a2 META MODE: Prefer INSTALL=tools/install.sh to lessen the need for xinstall.host.
This both avoids some dependencies on xinstall.host and allows
bootstrapping on older releases to work due to lack of at least 'install -l'
support.

Sponsored by:	EMC / Isilon Storage Division
2015-11-25 19:10:28 +00:00
Bryan Drewery
8b2b71b415 Fix ld not respecting --sysroot.
ld(1) uses the /usr/libdata/ldscripts when linking. These scripts add in the
default search paths of /lib and /usr/lib via 'SEARCH_DIR("DIR")'. These
need to be prefixed by '=' so that the --sysroot flag is respected. This
is not a problem with buildworld since the TOOLS_PREFIX is baked into the
cross-ld. However it is a problem when trying to use ld(1) with --sysroot
anywhere else as it ends up still reading /lib and /usr/lib despite --sysroot.

The default --sysroot (TARGET_SYSTEM_ROOT) is '/' for /usr/bin/ld.

I found this while building with META MODE with uses only --sysroot with
/usr/bin/ld, and found that libraries that I had not built in its sysroot
directory were leaking in. This didn't happen with ports binutils either.  This
would also impact external compiler support.

Reviewed by:	bapt, brooks
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D4262
2015-11-24 00:49:29 +00:00
Craig Rodrigues
a74ada878b Include "system.h" for isdir() prototype.
Submitted by:          bofh
Differential Revision: https://reviews.freebsd.org/D2711
2015-11-04 05:38:08 +00:00
Zbigniew Bodek
bf1be54f54 Use PCB/LR from PCB rather from stack on armv7-gdb
The kernel dump does not store these values on the stack.
Use PCB structure to resolve PC and LR properly.

Submitted by:  Wojciech Macek <wma@semihalf.com>
Reviewed by:   jhb, kib
Obtained from: Semihalf
Sponsored by:  Juniper Networks Inc.
Differential Revision: https://reviews.freebsd.org/D4013
2015-10-30 12:37:40 +00:00
Bryan Drewery
072e7d7026 Remove disconnected xditview. 2015-10-21 01:34:51 +00:00
Bryan Drewery
0cc887023b Avoid warning race with creating 'ldscripts' directory during build.
In r204548 the 'rm -f ldscripts' was added likely due to reading the
conditional as 'else it is a file'.  That seems unlikely though and
the more likely case is just that the directory hasn't been created yet.

Because this races with ,ssother scripts, use 'mkdir -p' which is a minimal
modification vs upstream to avoid the warning of 'File exists' if another
script creates it first.  This could replace the 'test -d' as well but
then it's more unneeded change to the upstream script.

Sponsored by:	EMC / Isilon Storage Division
2015-10-16 05:54:41 +00:00
Bryan Drewery
aa92269e46 Add more SUBDIR_PARALLEL.
MFC after:	3 weeks
Sponsored by:	EMC / Isilon Storage Division
2015-10-15 22:55:08 +00:00