Commit graph

22 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
Mark Johnston 7bb441c866 libdwarf: Add some constants from DWARF 5
This is not exhaustive - DWARF 5 has some new enumeration types not
implemented here - but I think I caught all the ones that are extended
in DWARF 5, plus the new compilation unit type (DW_UT_*), needed when
parsing .debug_info headers.

These were useful when extending libdwarf/ctfconvert/readelf to handle
DWARF generated by gcc 12, which is version 5 by default.

Reviewed by:	emaste
MFC after:	3 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D38273
2023-02-07 15:10:24 -05:00
Mark Johnston 3aa0bc89c6 libdwarf: Add a weak uncompress() symbol
This works around brokenness in buildworld's bootstrapping logic: it
uses the source tree's metadata to collect dependency info (such as,
"libdwarf depends on libz") but links against static host libraries.
If these two are out of sync, as is the case if one builds a commit
prior to the introduction of the libz dependency, then the build fails
when trying to statically link nm(1).

Mitigate the problem by defining a weak uncompress() symbol which simply
returns an error.  This ensures that the build won't fail when
statically linking libdwarf without zlib.  The downside is that any
tools using libdwarf without zlib will now hit a runtime error if they
attempt to decode compressed sections, but at least they'll fail
deterministically, and compressed debug info is only enabled by default
in main.

In particular, this fixes building of branches lacking commit
dbf05458e3, such as releng branches, stable/12 and 13 and old
revisions of main.  Previously the nm(1) build would fail with:

ld: error: undefined symbol: uncompress
>>> referenced by libdwarf_elf_init.c:233
>>> (/usr/src/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c:233)
>>>               libdwarf_elf_init.o:(_dwarf_elf_init) in archive
>>> /usr/lib/libdwarf.a

Reported by:	dim, ler, krion
Reviewed by:	imp, emaste
Fixes:		dbf05458e3 ("libdwarf: Support consumption of compressed ELF sections")
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33419
2021-12-13 18:47:15 -05:00
Mark Johnston dbf05458e3 libdwarf: Support consumption of compressed ELF sections
Automatically decompress zlib-compressed debug sections when loading
them.  This lets ctfcovert work on userland code after commit
c910570e75 ("Use compressed debug in standalone userland debug files
by default").

Reported by:	avg
Reviewed by:	avg, emaste
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33139
2021-12-06 10:37:49 -05:00
Enji Cooper dc2cbb8328 Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
This simplifies pathing in make/displayed output

MFC after:    3 weeks
Sponsored by: Dell EMC Isilon
2017-01-20 04:54:21 +00:00
Ed Maste 2821bdccaa elftoolchain: Use ${SRCTOP} for the top of the FreeBSD tree
It's provided by sys.mk so there's no need to derive it from ${.CURDIR}.

Suggested by:	ngie
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D5998
2016-04-21 12:58:29 +00:00
Ed Maste c0e5e7f3d2 Replace ${CURDIR}/../.. with ${CURDIR:H:H} in elftoolchain
This produces a nicer path in debug info and build logs.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2016-04-18 13:13:59 +00:00
Glen Barber a70cba9582 First pass through library packaging.
Sponsored by:	The FreeBSD Foundation
2016-02-04 21:16:35 +00:00
Bryan Drewery 4aa63711a7 META MODE: Fix 'make bootstrap-tools'.
The main problem was bitrot after elftoolchain being swapped in for the
GNU toolchain.

This also reworks how the list of 'host allowed' libraries is determined
to only allow INTERNALLIBs, which is needed for libelftc to come in.

For usr.bin/readelf use the same hack, as libelf and libdward, to bring in
the needed sys/ headers for host builds.  This has not yet been a problem due
to readelf not being built as a host tool in buildworld.  This is possible
in the meta build though when building the toolchain.

Sponsored by:	EMC / Isilon Storage Division
2015-11-25 19:44:51 +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
Ed Maste b4e9f2392c Update elftoolchain to upstream rev 3130
This includes a number of libdwarf improvements (particularly DWARF4
related) and updates to elftoolchain tools such as strip(1). It also
includes a large number of miscellaneous fixes (memory leaks, sign and
cast warnings, integer overflow and underflow, etc.).

This is a merge of r276167,276170-276172 from the
projects/elftoolchain-update-r3130 branch.

Sponsored by:	The FreeBSD Foundation
2014-12-29 19:16:40 +00:00
Baptiste Daroussin 6b129086dc Convert libraries to use LIBADD
While here reduce a bit overlinking
2014-11-25 11:07:26 +00:00
Kai Wang be11621376 Bump SHLIB_MAJOR for libdwarf as ABI/API has changed. 2014-01-21 21:11:07 +00:00
Kai Wang 6eabfa9670 Reapply revisions r237528, r237531 and r238741 which make libelf
properly include sys/ headers from the source tree instead of the
host.

These patches are also applied to libdwarf since libdwarf requires
the same sys/ headers as libelf.
2014-01-21 20:42:15 +00:00
Kai Wang a1abeb052e Remove INCSDIR variable which is only used in elftoolchain's own build
framework.
2014-01-21 20:23:39 +00:00
Kai Wang fbb4c451b3 Remove the old libdwarf and bring in the new libdwarf in contrib/. 2014-01-16 21:52:09 +00:00
Konstantin Belousov 7596eb4872 Bump shared libraries version numbers in preparation for 9.0.
This time, only libraries which ABI has been changed compared to
stable/8, are bumped.

ABI analysis done by:	Gleb Kurtsou
Approved by:	re (kensmith)
2011-08-28 09:26:48 +00:00
David E. O'Brien 9b2a96cc04 Add the ability to search for all the inlined instances of a given function.
Reviewed by:	jb
Obtained from:	Juniper Networks
2011-05-07 01:05:31 +00:00
Ruslan Ermilov 13c89dbfa7 Removed redundant -I. from CFLAGS and "yes" from WITHOUT_MAN. 2010-02-25 22:16:30 +00:00
Ed Schouten daaf575910 Build lib/ with WARNS=6 by default.
Similar to libexec/, do the same with lib/. Make WARNS=6 the norm and
lower it when needed.

I'm setting WARNS?=0 for secure/. It seems secure/ includes the
Makefile.inc provided by lib/. I'm not going to touch that directory.
Most of the code there is contributed anyway.
2010-01-02 09:58:07 +00:00
Ken Smith 3ca3047aee Bump the version of all non-symbol-versioned shared libraries in
preparation for 8.0-RELEASE.  Add the previous version of those
libraries to ObsoleteFiles.inc and bump __FreeBSD_Version.

Reviewed by:    kib
Approved by:    re (rwatson)
2009-07-19 17:25:24 +00:00
John Birrell 6433849359 Add a BSD licensed DWARF library for use by the DTrace clients.
The API for this library is deliberately different to the GPL'd
libdwarf to avoid licensing problems.
2008-05-22 02:14:23 +00:00