src/Makefile.am


Log

Author Commit Date CI Message
Guillem Jover 19e06407 2024-02-11T19:35:05 build: Generate the map file from the configured ABI Some linkers require the map file definitions to contain only symbols that are present on the linked object, either in the map file or in the sym file we generate from the map file. This is preparatory work to be able to conditionally include symbols in the man and sym files depending on the ABI definitions.
Guillem Jover cf61ebb8 2023-04-22T20:47:20 build: Do not build the progname module if it is not needed This was made conditional, but the code part was accidentally left untouched due to having ported it locally to use __progname, which caused build failures on the stock repo. Fixes: commit 046621d7967e7a0f08ae988bcf7e4cd1b6cf204c
Guillem Jover 73b25a8f 2023-04-23T02:04:47 build: Sort entries alphabetically
Guillem Jover 5434ba16 2023-04-23T02:05:04 build: Conditionalize wcslcpy() and wcslcat() functions on macOS These functions are provided by the system libc.
Guillem Jover dc1bd1a2 2023-04-23T02:00:10 build: Conditionalize only id-from-name functions not the entire pwcache On macOS the name-from-id functions are present, but not the id-from-name ones, so we want to provide those instead of suppressing the entire file.
Guillem Jover 6385ccc9 2023-04-18T03:58:24 build: Conditionalize bsd_getopt() on macOS The system library provides a getopt() with BSD semantics.
Guillem Jover 21d12b02 2023-04-04T23:59:05 build: On macOS do not build functions provided by the system We have never built before on macOS, so we can exclude all the functions that are currently provided in the system. Closes: #1 Closes: !3
Guillem Jover bc65806c 2023-04-06T23:05:27 build: Select whether to include funopen() in the build system This makes sure we include it when expected, alongside the man pages, and the test cases, and do not accidentally break the ABI if the system starts providing such interface.
Guillem Jover 8622767a 2023-04-11T00:24:13 build: Use an export symbols file if there is no version script support We generate the symbol list from the version script to avoid repeating ourselves and potentially getting the lists out-of-sync.
Guillem Jover 8f610364 2023-04-11T03:03:54 build: Add -no-undefined libtool flag We have no need for undefined symbols, so we can let the shared library build even on systems without support for undefined symbols.
Guillem Jover ae7942ba 2023-04-11T03:02:30 build: Do not override the default DEPENDENCIES for libbsd Extend it instead via EXTRA_*_DEPENDENCIES, to make sure that we preserve the builtin library dependencies generated from LIBADD.
Guillem Jover 00b538ff 2022-11-23T23:28:34 build: Terminate lists in variables with «# EOL» This means we can add a trailing «\» to every element, so that they can be removed without requiring modification of other lines, and can be easily sorted. Replace the old usage of $(nil) which could possibly end up with junk added if such variable is ever defined, in the environment.
Guilherme Janczak e5ed5fdd 2021-12-31T08:25:08 Remove arc4random() OpenBSD support The arc4random() support for OpenBSD does not build. The intention was to include any portability code so that the library could be easily ported to such systems, but it makes little sense to build it on OpenBSD where most of the functionality will be already present, or the software would have been ported anyway. [guillem@hadrons.org: Reword commit message to add rationale. ] Closes: !15 Signed-off-by: Guillem Jover <guillem@hadrons.org>
Sam James f11ab672 2022-01-23T15:36:55 build: Respect $(OBJDUMP) We already search for it in `./configure` so let's respect the result of that search. This helps with cross-compilation and any other cases where one might want to choose a different toolchain. Closes: !16 Bug: https://bugs.gentoo.org/831863 Signed-off-by: Sam James <sam@gentoo.org> Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guillem Jover e7cf8c57 2021-11-28T22:44:08 Switch md5 compatibility logic back to direct linking When using the recent dlsym() based wrapper, we are not requiring any symbol from libmd, as we resolve those dynamically at run-time. We were ending up linking against libmd because in another part of the code we require (depending on the architecture) the SHA512 functions for the getentropy() local implementation. But that function might be provided by the system libc on some systems, which means we end up not linking against libmd at all. To solve this we go back to the previous simpler solution of linking directly, which had the main drawback of then making programs fail to link when not specifying -lmd (on platforms that need it). And then switch the .so link point from a symlink to a linker script, so that we can inject the -lmd library as-needed. This is similar to what glibc is doing. Fixes: commit 31f034e3862debda8615a449b1c11c4d6920dcc7
Guillem Jover 25d35625 2021-11-28T22:40:58 build: Split libmd dependency due to MD5 functions from SHA requirements To be able to rework the md5 deprecation logic, we need to detangle when we depend on libmd due to requiring MD5 functions, which might be otherwise provided by libc, or when we require SHA functions for the internal getentropy() implementation.
Guillem Jover 731b0a77 2021-08-17T02:59:59 build: Detect sed at configure time Check whether sed is available and use the implementation matching the requirements via the SED variable.
Guillem Jover a4e0db2b 2021-02-09T06:04:38 build: Use a single variable to track libraries to link against Using various variables means we have to keep these in sync in various places. Just use a single variable that we can use anywhere where this is needed.
Guillem Jover 847e682f 2021-02-07T00:09:30 Use libmd hashing function implementations instead of embedding our own This splits the implementation responsibilities, and reduces embedded code copies, which was one of the driving points with this project to start with, so it's nice to give a good example.
Guillem Jover 37a9b56c 2021-02-06T23:43:12 Import pwcache module from OpenBSD
Faidon Liambotis 01f0d1ea 2020-12-31T12:46:03 Add recallocarray() and freezero() from OpenBSD Add recallocarray(), introduced in OpenBSD 6.1, and freezero(), introduced in OpenBSD 6.2. The former is imported as-is from OpenBSD, while the latter is the non-malloc-internal branch of the same code (and also the OpenSSH portable variant). Both of these originated in OpenBSD, but have also been implemented by IllumOS, cf. https://www.illumos.org/issues/8546 Documentation for these functions is in malloc(3) upstream, the relevant parts of which were previously imported in reallocarray(3bsd). Update reallocarray(3bsd) with the changes that were introduced since, and add the relevant bits for recallocarray() and freezero(), plus aliases. [guillem@hadrons.org: Update copyright in COPYING. ] Closes: !10 Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guillem Jover 3d6b6ead 2019-11-16T00:04:18 build: Detect support for --version-script in ld
Aaron Dierking f99b8ea5 2018-06-14T11:38:33 build: Disable CRT warnings on Windows These warnings are not helpful for libbsd. [guillem@hadrons.org: - Rename WINDOWS conditional to OS_WINDOWS. - Add a nil terminator to the AM_CPPFLAGS. ] Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guillem Jover b0ebb0d4 2019-08-06T23:16:42 build: Use __register_atfork() only if really available This is a glibc-specific symbol that has no public declaration. But is being used by the OpenBSD and this implementation as a hack to avoid having to link against the pthread library. This interface is at least included in LSB 5.0 [L], and using pthread_atfork() is otherwise problematic anyway [P]. [L] <https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/baselib---register-atfork.html> [P] <http://austingroupbugs.net/view.php?id=851> One problem is that we were using it whenever __GLIBC__ is defined, which is supposed to be defined only on an actual glibc, but uClibc defines that macro, but it does not provide the symbol on its noMMU variant. We add a new configure check that will try to link a program that uses that symbol to make sure it is present. Closes: !2 Reported-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Guillem Jover a1730c10 2018-05-15T00:55:02 Add Windows support for getentropy() and arc4random() Import from OpenBSD.
Guillem Jover e13b1a33 2018-05-21T00:20:49 Import strtoi() and strtou() functions from NetBSD
Guillem Jover 3d88c999 2018-05-15T00:41:26 Update arc4random() headers from OpenBSD Split Linux support into its own header separate from the generic Unix to fix a Linux-specific issue with clone(). Reset rsp to NULL on failure.
Guillem Jover b7ce33cf 2016-02-12T22:56:09 build: Support clock_gettime() provided in librt In older glibc versions (< 2.17) clock_gettime() is in librt. Add a check for this to avoid build breakage for programs/libraries that use libbsd on such systems. Based-on-patch-by: Gustavo Zacarias <gustavo@zacarias.com.ar> Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guillem Jover 7a756875 2015-12-14T03:03:57 Add support for GNU/Hurd to getentropy() Reuse the getentropy code for Linux on the Hurd, which has fallbacks for when the better interfaces are not present. And remove all the code that is not supported currently on the Hurd. Ideally the Hurd should get an equivalent interfaces that does not suffer from the same problems as /dev/urandom.
Guillem Jover 75729394 2015-12-02T03:08:17 Unify most arc4random Unix hooks into a single file The Unix hook should work for most Unix-like systems, move glibc specific code there and a FreeBSd specific comment, and remove the rest. Also change the code to always fallback to use the generic Unix code. This should cover GNU/Hurd and GNU/kFreeBSD among others.
Guillem Jover 874a0e51 2015-09-23T19:39:47 Update arc4random module from OpenBSD and LibreSSL Rework arc4random_stir() and arc4random_addrandom() code over the new internal API, and documentation in the man page. Adapt the code to the local build system. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=85827
Guillem Jover 9a9a8b2d 2015-09-23T19:39:47 Add private getentropy module from OpenBSD and LibreSSL Adapt the code to the local build system.
Guillem Jover 5f9265f8 2015-09-23T20:13:33 Add private SHA512 module from FreeBSD
Guillem Jover 0871daf7 2015-11-30T04:12:02 build: Move hash/helper.c into new libbsd_la_included_sources Use this variable in EXTRA_DIST and libbsd_la_DEPENDENCIES.
Guillem Jover 45443583 2015-09-23T19:37:37 Add explicit_bzero() function from OpenBSD
Guillem Jover 41ff37bb 2015-09-22T16:21:12 build: Add support for linker warnings
Guillem Jover e8d3d041 2014-07-20T01:48:20 build: Remove hard requirement for GNU .init_array section support In case the support is not available, just stop building the libbsd-ctor.a library, which is a nice to have thing, but should not have been a hard requirement from the start. This should allow to build libbsd on non-glibc based systems using another libc.
Benjamin Baier faa005cb 2014-06-27T02:05:11 Add reallocarray() function from OpenBSD Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guillem Jover 36aca8c0 2014-06-26T21:43:55 Add stringlist module from NetBSD
Guillem Jover e8f93003 2014-06-26T21:32:11 Add getbsize() function Import code from DragonFlyBSD and man page from FreeBSD.
Guillem Jover 8d16c3df 2013-10-11T05:43:42 Add timeconv module from FreeBSD Inline license information from FreeBSD root dir COPYRIGHT file.
Guillem Jover f41fdcf1 2013-10-21T05:07:56 Add funopen() function This is a wrapper over the glibc fopencookie() function. We diverge from the FreeBSD, OpenBSD and DragonFlyBSD declarations, because seekfn() there wrongly uses fpos_t, assuming it's an integral type, and any code using that on a system where fpos_t is a struct (such as GNU-based systems or NetBSD) will fail to build. In which case, as the code has to be modified anyway, we might just as well use the correct declaration.
Guillem Jover c5b95902 2013-07-11T12:25:54 Move setproctitle() automatic initialization to its own library The automatic initialization cannot be part of the main shared library, because there is no thread-safe way to change the environ global variable. This is not a problem if the initializaion happens just at program load time, but becomes one if the shared library is directly or indirectly dlopen()ed during the execution of the program, which could have either kept references to the old environ or could change it in some other thread. This has been observed for example on systems using Samba NSS modules. To avoid any other possible fallout, the constructor is split into a new static library that needs to be linked explicitly into programs using setproctitle(). As an additional safety measure the pkg-config linker flags will mark the program as not allowing to be dlopen()ed so that we avoid the problem described above. Reported-by: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com> Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=66679
Guillem Jover 3077d2ff 2013-07-12T22:15:58 build: Move version ABI from Makefile to configure.ac It's easier to find there, and the value can be reused in case we have to provide another shared library.
Guillem Jover 1bf0a555 2013-06-08T17:43:42 Release libbsd 0.5.2
Guillem Jover 46633647 2013-05-27T06:52:05 Release libbsd 0.5.1
Guillem Jover 95878823 2013-05-21T04:34:34 Release libbsd 0.5.0
Guillem Jover 509841b5 2013-05-25T15:44:57 build: Use AM_V_at for mkdir
Guillem Jover a97ce513 2012-11-23T21:19:45 Add new fgetwln() function Man page taken from FreeBSD.
Strake ee0489eb 2012-08-07T08:44:30 Add new fparseln() function Taken from NetBSD. [guillem@hadrons.org: - Import from NetBSD instead of FreeBSD to get a 3-clause BSD license, instead of a 4-clause one. - Define compatibility macros. - Change library from libc to libbsd and header in man page. - Add copyright information to COPYING. - Add symbol to map file. ] Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guillem Jover 1be0bdb2 2012-11-25T21:13:38 Add new strnstr() function Taken from FreeBSD.
Guillem Jover ff0d700d 2012-11-23T17:16:43 Add new wcslcat() and wcslcpy() functions Taken from FreeBSD.
Guillem Jover 918a4dba 2012-06-27T09:15:15 Release libbsd 0.4.2
Guillem Jover 14524b54 2012-06-03T07:39:42 build: Set default compiler variables from configure This centralizes the setting so there's no duplication anymore, makes sure the user supplied variables are never overridden, and are only set when using gcc. Reported-by: Samuli Suominen <ssuominen@gentoo.org>
Guillem Jover c21d788f 2012-06-01T08:20:37 Release libbsd 0.4.1
Guillem Jover fdcae577 2012-06-01T08:17:42 build: Set runtimelibdir to libdir This makes sure the install-exec-hook under src works as expected even when no runtimelibdir was specified, otherwise the symlinks end up pointing to non-existing targets. Reported-by: Ryan Mullen <rmmullen@gmail.com>
Guillem Jover e9e4a60d 2012-06-01T08:15:00 build: Use MKDIR_P variable instead of literal «mkdir -p»
Guillem Jover 309c82a0 2012-05-29T04:38:07 Release libbsd 0.4.0
Guillem Jover cd67cb14 2012-05-29T07:17:46 Use implicit <md5.h> from overlay instead explicit <bsd/md5.h> This was assuming an installed <bsd/md5.h> on the system, due to the build system not including -Iinclude/ anymore. Regression introduced in commit 901ed630fc64fca828e031bc8fa6780db9f05db1.
Robert Millan 64348583 2011-12-31T04:30:48 Add new expand_number() function Taken from FreeBSD. [guillem@hadrons.org: - Include <stdint.h> in <bsd/libutil.h>. ] Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guillem Jover 943939d0 2011-12-31T08:39:44 Add new closefrom() function Code taken from sudo, man page from FreeBSD.
Guillem Jover 980f04f7 2012-01-03T08:58:52 build: Do not define already defined _GNU_SOURCE The macro is defined by configure on config.h which is now implicitly included by all source files.
Guillem Jover 88004b30 2011-12-31T07:31:47 build: Set -Wno-unused-parameter to default CFLAGS
Guillem Jover 8d2f12d7 2012-01-03T08:45:05 build: Include <config.h> through -include for all source files
Guillem Jover dcaa93d9 2010-12-17T11:13:04 build: Switch to autotools