libbsd issueshttps://gitlab.freedesktop.org/libbsd/libbsd/-/issues2024-03-14T01:10:14Zhttps://gitlab.freedesktop.org/libbsd/libbsd/-/issues/28autoconf-2.72 incompatibility with time_t detection2024-03-14T01:10:14ZSam Jamesautoconf-2.72 incompatibility with time_t detectionI got the following warning from configure on `main` at 3b8416acabdd6966f70803c756913398e76cb333 with autoconf-2.72:
```
./autogen && ./configure
[...]
checking for gcc option to enable large file support... none needed
checking size of ...I got the following warning from configure on `main` at 3b8416acabdd6966f70803c756913398e76cb333 with autoconf-2.72:
```
./autogen && ./configure
[...]
checking for gcc option to enable large file support... none needed
checking size of time_t... 8
checking size of time_t... 8
./configure: 5614: test: =: unexpected operator
[...]
```
The relevant snippet is:
```
if test $ac_cv_sys_file_offset_bits = 64 && \
test $libbsd_sys_time_bits = 32 && \
test $ac_cv_sizeof_time_t = 8
then :
```
Unfortunately, `ac_cv_sys_file_offset_bits` is an autoconf internal which changed!
See https://github.com/ImageMagick/ImageMagick/commit/e119d19f1bae4c75f381544a33759b15e2dca4b5 (quoted):
>2) For the 'other' case, we were using the value of `ac_cv_sys_file_offset_bits` for
>`-D_FILE_OFFSET_BITS` to pass down into the Perl module build, but autoconf-2.72
>drops the use of `ac_cv_sys_file_offset_bits` in `cf09f48841b66fe76f606dd6018bb3a93242a7c9`,
>so this ends up defining `-D_FILE_OFFSET_BITS=` which then breaks the build.https://gitlab.freedesktop.org/libbsd/libbsd/-/issues/27fails to configure with lld-172024-02-26T02:52:18ZJohn Helmert IIIfails to configure with lld-17Reproduction:
```
~/git/libbsd $ ./autogen
~/git/libbsd $ LDFLAGS="-fuse-ld=lld" ./configure
[snip]
~/git/libbsd $ make V=1 -j
[snip]
ld.lld: error: version script assignment of 'LIBBSD_0.10.0' to symbol 'vwarn' failed: symbol not define...Reproduction:
```
~/git/libbsd $ ./autogen
~/git/libbsd $ LDFLAGS="-fuse-ld=lld" ./configure
[snip]
~/git/libbsd $ make V=1 -j
[snip]
ld.lld: error: version script assignment of 'LIBBSD_0.10.0' to symbol 'vwarn' failed: symbol not defined
ld.lld: error: version script assignment of 'LIBBSD_0.10.0' to symbol 'vwarnx' failed: symbol not defined
ld.lld: error: version script assignment of 'LIBBSD_0.10.0' to symbol 'warn' failed: symbol not defined
ld.lld: error: version script assignment of 'LIBBSD_0.10.0' to symbol 'warnx' failed: symbol not defined
ld.lld: error: version script assignment of 'LIBBSD_0.10.0' to symbol 'verr' failed: symbol not defined
ld.lld: error: version script assignment of 'LIBBSD_0.10.0' to symbol 'verrx' failed: symbol not defined
ld.lld: error: version script assignment of 'LIBBSD_0.10.0' to symbol 'err' failed: symbol not defined
ld.lld: error: version script assignment of 'LIBBSD_0.10.0' to symbol 'errx' failed: symbol not defined
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:651: libbsd.la] Error 1
make[2]: Leaving directory '/home/jake/git/libbsd/src'
make[1]: *** [Makefile:421: all-recursive] Error 1
make[1]: Leaving directory '/home/jake/git/libbsd'
make: *** [Makefile:353: all] Error 2
~/git/libbsd $ git log -1
commit 97b0fe84b855eb8e7eeffaa2f5aacee543bf9fb2 (HEAD -> main, origin/main, origin/HEAD)
Author: Guillem Jover <guillem@hadrons.org>
Date: Mon Jan 8 23:57:45 2024 +0100
```https://gitlab.freedesktop.org/libbsd/libbsd/-/issues/26glibc-2.38 compatibility wrt. strlcat/strlcpy2024-01-07T17:04:22ZHolger Hoffstätteglibc-2.38 compatibility wrt. strlcat/strlcpyglibc-2.38 now has built-in strlcat/strlcpy and obviously this creates problems when libbsd is mixed into an application, esp. when strict linking requirements for LTO and -fno-semantic-interposition are enforced.
It would be great if li...glibc-2.38 now has built-in strlcat/strlcpy and obviously this creates problems when libbsd is mixed into an application, esp. when strict linking requirements for LTO and -fno-semantic-interposition are enforced.
It would be great if libbsd could detect when it is being built on glibc-2.38 and just not build its own versions of these functions.
I tried to take a look but the autoconf stuff is way too complicated for me. :(https://gitlab.freedesktop.org/libbsd/libbsd/-/issues/25Math Error in timespecsub()2024-01-07T16:17:56ZReggie McMurtreyMath Error in timespecsub()```c
#define timespecsub(tsp, usp, vsp) \
do { \
(vsp)->tv_sec = (tsp)->tv_sec - (usp)->tv_sec; \
(vsp)->tv_nsec = (tsp)->tv_nsec - (usp)->tv_nsec; \
if ((vsp)->tv_nsec < 0) { \
(vsp)->tv_sec--; \
(vsp)->tv...```c
#define timespecsub(tsp, usp, vsp) \
do { \
(vsp)->tv_sec = (tsp)->tv_sec - (usp)->tv_sec; \
(vsp)->tv_nsec = (tsp)->tv_nsec - (usp)->tv_nsec; \
if ((vsp)->tv_nsec < 0) { \
(vsp)->tv_sec--; \
(vsp)->tv_nsec += 1000000000L; \
} \
} while (0)
#endif
```
The line "**if ((vsp)->tv_nsec < 0) {**" should be "**if ((vsp)->tv_nsec < 0 && (vsp)->tv_sec != 0) {**"
consider a test case below:
tsp->tv_sec = 0;
tsp->tv_nsec = 1;
usp->tv_sec = 0;
usp->tv_nsec = 2;
I found this trying to calculate how long to nanosleep for.https://gitlab.freedesktop.org/libbsd/libbsd/-/issues/24[Faux merge request] build: Properly conditionalize progname.c2023-08-07T07:15:43ZEmilyhello@emily.moe[Faux merge request] build: Properly conditionalize progname.cThis wasn't achieving the original aim of skipping the build on macOS.
Unfortunately I don't have permissions to open a merge request, but you can pull from my branch on GitHub: https://github.com/emilazy/libbsd/tree/fix-progname-condit...This wasn't achieving the original aim of skipping the build on macOS.
Unfortunately I don't have permissions to open a merge request, but you can pull from my branch on GitHub: https://github.com/emilazy/libbsd/tree/fix-progname-conditionalhttps://gitlab.freedesktop.org/libbsd/libbsd/-/issues/23macos - test fail: 'closefrom' & adapting the test suite to MacPorts2024-01-08T01:02:40ZZweihornmacos - test fail: 'closefrom' & adapting the test suite to MacPortsref https://gitlab.freedesktop.org/libbsd/libbsd/-/issues/19#note_2018608
Please find:
- [patch005-test_Makefile.am.diff](/uploads/822e5f73af0cfa8ea32dbf17d2c77274/patch005-test_Makefile.am.diff) acc. to #21
- excerpt from my current bu...ref https://gitlab.freedesktop.org/libbsd/libbsd/-/issues/19#note_2018608
Please find:
- [patch005-test_Makefile.am.diff](/uploads/822e5f73af0cfa8ea32dbf17d2c77274/patch005-test_Makefile.am.diff) acc. to #21
- excerpt from my current build log below
- [test-suite_2023-07-29a.log](/uploads/46efbda357be4c53c53ee41652c5d09c/test-suite_2023-07-29a.log)
in the outcome of adapting my local 'libbsd' Portfile and my `sudo port -d -v test libbsd-devel` trials.
```
version:1
:debug:main Starting logging for libbsd-devel @0.11.7-dirty_0
:debug:sysinfo macOS 11.7.9 (darwin/20.6.0) arch i386
:debug:sysinfo MacPorts 2.8.1
:debug:sysinfo Xcode 13.0, CLT 13.2.0.0.1.1638488800
:debug:sysinfo SDK 11
:debug:sysinfo MACOSX_DEPLOYMENT_TARGET: 11.0
:debug:main epoch: in tree: 0 installed: 0
. . .
DEBUG: system: cd "/opt/local/var/macports/build/_usr_local_macports_ports_devel_libbsd/libbsd-devel/work/libbsd-73b25a8f871b3a20f6ff76679358540f95d7dbfd" && /usr/bin/make check
Making check in include
make[1]: Nothing to be done for `check'.
Making check in man
make[1]: Nothing to be done for `check'.
Making check in src
make[1]: Nothing to be done for `check'.
Making check in test
/Library/Developer/CommandLineTools/usr/bin/make bzero closefrom endian explicit_bzero humanize overlay proctitle-init pwcache setmode headers-overlay.sh headers-system.sh
CC bzero.o
CCLD bzero
CC closefrom.o
CCLD closefrom
CC endian.o
CCLD endian
CC explicit_bzero.o
CCLD explicit_bzero
CC humanize.o
CCLD humanize
CC overlay.o
CCLD overlay
CC proctitle_init-proctitle.o
CCLD proctitle-init
CC pwcache.o
CCLD pwcache
CC setmode.o
CCLD setmode
make[2]: Nothing to be done for `headers-overlay.sh'.
make[2]: Nothing to be done for `headers-system.sh'.
/Library/Developer/CommandLineTools/usr/bin/make check-TESTS
PASS: headers-overlay.sh
PASS: headers-system.sh
PASS: bzero
../build-aux/test-driver: line 112: 29119 Abort trap: 6 "$@" >> "$log_file" 2>&1
FAIL: closefrom
PASS: endian
PASS: explicit_bzero
PASS: humanize
PASS: overlay
PASS: proctitle-init
PASS: pwcache
PASS: setmode
============================================================================
Testsuite summary for libbsd 0.11.7-dirty_0
============================================================================
# TOTAL: 11
# PASS: 10
# SKIP: 0
# XFAIL: 0
# FAIL: 1
# XPASS: 0
# ERROR: 0
============================================================================
See test/test-suite.log
Please report to libbsd@lists.freedesktop.org
============================================================================
make[3]: *** [test-suite.log] Error 1
make[2]: *** [check-TESTS] Error 2
make[1]: *** [check-am] Error 2
make: *** [check-recursive] Error 1
Command failed: cd "/opt/local/var/macports/build/_usr_local_macports_ports_devel_libbsd/libbsd-devel/work/libbsd-73b25a8f871b3a20f6ff76679358540f95d7dbfd" && /usr/bin/make check
Exit code: 2
. . .
Error: Processing of port libbsd-devel failed
```
Hope this helps.
:sunflower:https://gitlab.freedesktop.org/libbsd/libbsd/-/issues/22Typo - recallocarray --> reallocarray2023-07-28T06:48:06ZZweihornTypo - recallocarray --> reallocarrayFound this apparent typo in the current code basis during my build as `CC recallocarray.lo` and see https://gitlab.freedesktop.org/libbsd/libbsd/-/issues/19#note_2018608
A `man libbsd` lists a "reallocarray(3bsd)" i.e. without a 'C' in ...Found this apparent typo in the current code basis during my build as `CC recallocarray.lo` and see https://gitlab.freedesktop.org/libbsd/libbsd/-/issues/19#note_2018608
A `man libbsd` lists a "reallocarray(3bsd)" i.e. without a 'C' in "re_C_allocarray" instead.
I might provide a patchfile in due time...
Hope this helps.
:sunflower:https://gitlab.freedesktop.org/libbsd/libbsd/-/issues/21macOS - Availability of BSD utilities to macOS 11 BigSur2024-02-26T02:53:30ZZweihornmacOS - Availability of BSD utilities to macOS 11 BigSurApparently, several utilities still listed in 'libbsd' seem to be available to macOS already.
The below list is based on a `man -w $util` output due to ref #19 & #20 and my earlier work.
1. Where "No manual entry for" is given, the res...Apparently, several utilities still listed in 'libbsd' seem to be available to macOS already.
The below list is based on a `man -w $util` output due to ref #19 & #20 and my earlier work.
1. Where "No manual entry for" is given, the resp. utility **needs to be ported** apparently.
2. If a _Manual Path_ is given, the resp. utility should become _exempted from the build process_ for macOS in 'libbsd' at your deliberation, I guess.
The below list was updated due to https://gitlab.freedesktop.org/libbsd/libbsd/-/issues/21#note_2021222
```
./MacOSX.sdk/usr/share/man/man3/bzero.3
No manual entry for closefrom
No manual entry for dehumanize_number
./MacOSX.sdk/usr/share/man/man3/err.3
No manual entry for expand_number
No manual entry for explicit_bzero
./MacOSX.sdk/usr/share/man/man3/fgetln.3
./MacOSX.sdk/usr/share/man/man3/fgetwln.3
No manual entry for flopen
./MacOSX.sdk/usr/share/man/man3/fmtcheck.3
./MacOSX.sdk/usr/share/man/man3/fparseln.3
./MacOSX.sdk/usr/share/man/man3/fpurge.3
No manual entry for freezero
./MacOSX.sdk/usr/share/man/man3/getbsize.3
./MacOSX.sdk/usr/share/man/man3/getpeereid.3
./MacOSX.sdk/usr/share/man/man3/heapsort.3
No manual entry for humanize_number
./MacOSX.sdk/usr/share/man/man3/inet_net_pton.3
./MacOSX.sdk/usr/share/man/man3/mergesort.3 [ref. merge.c]
No manual entry for pidfile
./MacOSX.sdk/usr/share/man/man3/{get,set}progname.3
./MacOSX.sdk/usr/share/man/man3/pwcache.3
./MacOSX.sdk/usr/share/man/man3/radixsort.3
./MacOSX.sdk/usr/share/man/man3/readpassphrase.3
No manual entry for reallocarray
./MacOSX.sdk/usr/share/man/man3/reallocf.3
No manual entry for recallocarray
./MacOSX.sdk/usr/share/man/man3/setmode.3
No manual entry for setproctitle
./MacOSX.sdk/usr/share/man/man3/stringlist.3
./MacOSX.sdk/usr/share/man/man3/strnstr.3
No manual entry for strtoi
./MacOSX.sdk/usr/share/man/man3/strtonum.3
No manual entry for strtou
No manual entry for timeconv
./MacOSX.sdk/usr/share/man/man3/unvis.3
./MacOSX.sdk/usr/share/man/man3/vis.3
./MacOSX.sdk/usr/share/man/man3/wcslcat.3
./MacOSX.sdk/usr/share/man/man3/wcslcpy.3
```
System environment:
```
:debug:sysinfo macOS 11.7.9 (darwin/20.6.0) arch i386
:debug:sysinfo MacPorts 2.8.1
:debug:sysinfo Xcode 13.0, CLT 13.2.0.0.1.1638488800
:debug:sysinfo SDK 11
```
Please feel free to approach me for further information, if you like.
Hope this helps.
:sunflower:https://gitlab.freedesktop.org/libbsd/libbsd/-/issues/20macOS - error: "Function getprogname() needs to be ported."2024-01-08T00:33:33ZZweihornmacOS - error: "Function getprogname() needs to be ported."ref #19
THX for the good work.
This PR is based on my local port definition efforts while aiming at establishing a [MacPorts](https://www.macports.org) new 'libbsd' port (WIP).
Please note that "getprogname" and "setprogname" are ava...ref #19
THX for the good work.
This PR is based on my local port definition efforts while aiming at establishing a [MacPorts](https://www.macports.org) new 'libbsd' port (WIP).
Please note that "getprogname" and "setprogname" are availabe by MacOSX.sdk to macOS 11 Big Sur already. IMO the utility "progname" should become exempted from the build process for macOS as was done with other utilities in 'libbsd' obviously.
ref 73b25a8f871b3a20f6ff76679358540f95d7dbfd
`sudo port -d -v build libbsd-devel`
The below is an excerpt from the "libbsd-devel/main.log"
```
:debug:main Starting logging for libbsd-devel @0.11.7-dirty_0
:debug:sysinfo macOS 11.7.9 (darwin/20.6.0) arch i386
:debug:sysinfo MacPorts 2.8.1
:debug:sysinfo Xcode 13.0, CLT 13.2.0.0.1.1638488800
:debug:sysinfo SDK 11
:debug:sysinfo MACOSX_DEPLOYMENT_TARGET: 11.0
:debug:main epoch: in tree: 0 installed: 0
. . .
:info:build Making all in src
:info:build make[2]: Entering directory `/opt/local/var/macports/build/_usr_local_macports_ports_devel_libbsd/libbsd-devel/work/libbsd-73b25a8f871b3a20f6ff76679358540f95d7dbfd/src'
:info:build CC dehumanize_number.lo
:info:build CC closefrom.lo
:info:build CC err.lo
:info:build CC expand_number.lo
:info:build CC explicit_bzero.lo
:info:build CC fgetln.lo
:info:build CC fgetwln.lo
:info:build CC flopen.lo
:info:build CC fmtcheck.lo
:info:build CC fparseln.lo
:info:build CC freezero.lo
:info:build CC getbsize.lo
:info:build CC getpeereid.lo
:info:build CC heapsort.lo
:info:build CC humanize_number.lo
:info:build CC inet_net_pton.lo
:info:build CC merge.lo
:info:build CC pidfile.lo
:info:build CC progname.lo
:info:build progname.c:141:2: error: "Function getprogname() needs to be ported."
:info:build #error "Function getprogname() needs to be ported."
:info:build ^
:info:build 1 error generated.
:info:build make[2]: *** [progname.lo] Error 1
:info:build make[2]: *** Waiting for unfinished jobs....
:info:build CC pwcache.lo
:info:build make[2]: Leaving directory `/opt/local/var/macports/build/_usr_local_macports_ports_devel_libbsd/libbsd-devel/work/libbsd-73b25a8f871b3a20f6ff76679358540f95d7dbfd/src'
:info:build make[1]: *** [all-recursive] Error 1
:info:build make[1]: Leaving directory `/opt/local/var/macports/build/_usr_local_macports_ports_devel_libbsd/libbsd-devel/work/libbsd-73b25a8f871b3a20f6ff76679358540f95d7dbfd'
:info:build make: *** [all] Error 2
:info:build make: Leaving directory `/opt/local/var/macports/build/_usr_local_macports_ports_devel_libbsd/libbsd-devel/work/libbsd-73b25a8f871b3a20f6ff76679358540f95d7dbfd'
:info:build Command failed: cd "/opt/local/var/macports/build/_usr_local_macports_ports_devel_libbsd/libbsd-devel/work/libbsd-73b25a8f871b3a20f6ff76679358540f95d7dbfd" && /usr/bin/make -j4 -w all
:info:build Exit code: 2
:error:build Failed to build libbsd-devel: command execution failed
. . .
:error:build See /opt/local/var/macports/logs/_usr_local_macports_ports_devel_libbsd/libbsd-devel/main.log for details.
```
However, further scans found several utility commands included in the above are available to macOS already. I will provide some more information in another PR in due time.
Hope this helps.
:sunflower:https://gitlab.freedesktop.org/libbsd/libbsd/-/issues/19macOS - build: Undefined symbols for architecture x86_642024-02-26T02:55:42ZZweihornmacOS - build: Undefined symbols for architecture x86_64Greetings. I highly appreciate your efforts and this project.
As a Mac OS X / macOS user I have a special interest in "explicit_bzero" while aiming to establis a [MacPorts](https://www.macports.org) new 'libbsd' port. Thus I gave it a ...Greetings. I highly appreciate your efforts and this project.
As a Mac OS X / macOS user I have a special interest in "explicit_bzero" while aiming to establis a [MacPorts](https://www.macports.org) new 'libbsd' port. Thus I gave it a try to build on my machine.
- Branch code ref 73b25a8f871b3a20f6ff76679358540f95d7dbfd
- My patch ref https://gitlab.freedesktop.org/libbsd/libbsd/-/issues/20#note_2016907
Please find some results based on my local port definition (WIP) i.e. local 'libbsd' Portfile below.
`sudo port -d -v build libbsd-devel`
The below is an excerpt from the "libbsd-devel/main.log" after the trial:
```
version:1
:debug:main Starting logging for libbsd-devel @0.11.7-dirty_0
:debug:sysinfo macOS 11.7.9 (darwin/20.6.0) arch i386
:debug:sysinfo MacPorts 2.8.1
:debug:sysinfo Xcode 13.0, CLT 13.2.0.0.1.1638488800
:debug:sysinfo SDK 11
:debug:sysinfo MACOSX_DEPLOYMENT_TARGET: 11.0
:debug:main epoch: in tree: 0 installed: 0
. . .
:info:build Making all in src
:info:build make[2]: Entering directory `/opt/local/var/macports/build/_usr_local_macports_ports_devel_libbsd/libbsd-devel/work/libbsd-73b25a8f871b3a20f6ff76679358540f95d7dbfd/src'
:info:build CC closefrom.lo
:info:build CC dehumanize_number.lo
:info:build CC err.lo
:info:build CC expand_number.lo
:info:build CC explicit_bzero.lo
:info:build CC fgetln.lo
:info:build CC fgetwln.lo
:info:build CC flopen.lo
:info:build CC fmtcheck.lo
:info:build CC fparseln.lo
:info:build CC freezero.lo
:info:build CC getbsize.lo
:info:build CC getpeereid.lo
:info:build CC heapsort.lo
:info:build CC humanize_number.lo
:info:build CC inet_net_pton.lo
:info:build CC merge.lo
:info:build CC pidfile.lo
:info:build CC pwcache.lo
:info:build CC radixsort.lo
:info:build CC readpassphrase.lo
:info:build CC reallocarray.lo
:info:build CC reallocf.lo
:info:build CC recallocarray.lo
:info:build CC setmode.lo
:info:build CC setproctitle.lo
:info:build CC stringlist.lo
:info:build CC strnstr.lo
:info:build CC strtoi.lo
:info:build CC strtonum.lo
:info:build CC strtou.lo
:info:build CC timeconv.lo
:info:build CC unvis.lo
:info:build CC vis.lo
:info:build GEN libbsd.sym
:info:build CCLD libbsd.la
:info:build Undefined symbols for architecture x86_64:
:info:build "___fdnlist", referenced from:
:info:build -exported_symbol[s_list] command line option
:info:build "_bsd_getopt", referenced from:
:info:build -exported_symbol[s_list] command line option
:info:build "_nlist", referenced from:
:info:build -exported_symbol[s_list] command line option
:info:build ld: symbol(s) not found for architecture x86_64
:info:build clang: error: linker command failed with exit code 1 (use -v to see invocation)
:info:build make[2]: *** [libbsd.la] Error 1
:info:build make[2]: Leaving directory `/opt/local/var/macports/build/_usr_local_macports_ports_devel_libbsd/libbsd-devel/work/libbsd-73b25a8f871b3a20f6ff76679358540f95d7dbfd/src'
:info:build make[1]: *** [all-recursive] Error 1
:info:build make[1]: Leaving directory `/opt/local/var/macports/build/_usr_local_macports_ports_devel_libbsd/libbsd-devel/work/libbsd-73b25a8f871b3a20f6ff76679358540f95d7dbfd'
:info:build make: *** [all] Error 2
:info:build make: Leaving directory `/opt/local/var/macports/build/_usr_local_macports_ports_devel_libbsd/libbsd-devel/work/libbsd-73b25a8f871b3a20f6ff76679358540f95d7dbfd'
:info:build Command failed: cd "/opt/local/var/macports/build/_usr_local_macports_ports_devel_libbsd/libbsd-devel/work/libbsd-73b25a8f871b3a20f6ff76679358540f95d7dbfd" && /usr/bin/make -j4 -w all
:info:build Exit code: 2
:error:build Failed to build libbsd-devel: command execution failed
. . .
:error:build See /opt/local/var/macports/logs/_usr_local_macports_ports_devel_libbsd/libbsd-devel/main.log for details.
```
However, my brief scan found several utility commands included in the above available to macOS already. Please ref #21 for my results.
Hope this helps.
:sunflower:https://gitlab.freedesktop.org/libbsd/libbsd/-/issues/18warnings about missing symbols when building with the mold linker and lto2023-07-03T19:34:09ZKostadinwarnings about missing symbols when building with the mold linker and ltoHey, libbsd seems to have some issues during linking when using the mold linker and -flto. I am using mold built from git at commit `b04aba89d3a1931470983212925443e7aefca1e1` and libbsd at commit `73b25a8f871b3a20f6ff76679358540f95d7dbfd...Hey, libbsd seems to have some issues during linking when using the mold linker and -flto. I am using mold built from git at commit `b04aba89d3a1931470983212925443e7aefca1e1` and libbsd at commit `73b25a8f871b3a20f6ff76679358540f95d7dbfd`. I've turned mold's warnings into errors with `-Wl,--fatal-warnings`, so I can catch them more easily. Below is the last few lines of the build log, I am also attaching the complete log.
GCC version used is gcc (Gentoo 13.1.1_p20230527 p3) 13.1.1 20230527
Steps to reproduce:
1. install libbsd's build dependencies and mold
2. clone libbsd's repo and cd into it
3. run `export CFLAGS="-O2 -pipe -flto=auto"` and `export LDFLAGS="-fuse-ld="mold -Wl,--fatal-warnings"`
4. run `./autogen` and `./configure --prefix=/usr`
5. build libbsd with `make V=1`
```
libtool: link: gcc -shared -fPIC -DPIC .libs/closefrom.o .libs/dehumanize_number.o .libs/err.o .libs/expand_number.o .libs/explicit_bzero.o .libs/fgetln.o .libs/fgetwln.o .libs/flopen.o .libs/fmtcheck.o .libs/fparseln.o .libs/freezero.o .libs/getbsize.o .libs/getpeereid.o .libs/heapsort.o .libs/humanize_number.o .libs/inet_net_pton.o .libs/merge.o .libs/pidfile.o .libs/progname.o .libs/pwcache.o .libs/radixsort.o .libs/readpassphrase.o .libs/reallocarray.o .libs/reallocf.o .libs/recallocarray.o .libs/setmode.o .libs/setproctitle.o .libs/stringlist.o .libs/strnstr.o .libs/strtoi.o .libs/strtonum.o .libs/strtou.o .libs/timeconv.o .libs/unvis.o .libs/vis.o .libs/bsd_getopt.o .libs/arc4random.o .libs/arc4random_uniform.o .libs/md5.o .libs/nlist.o .libs/strlcat.o .libs/strlcpy.o .libs/wcslcat.o .libs/wcslcpy.o .libs/strmode.o .libs/fpurge.o .libs/funopen.o -lmd -O2 -flto=auto -Wl,--version-script=./libbsd.map -fuse-ld=mold -Wl,--fatal-warnings -Wl,-soname -Wl,libbsd.so.0 -o .libs/libbsd.so.0.11.7
mold: error: ./libbsd.map: cannot assign version `LIBBSD_0.2` to symbol `strnvis`: symbol not found
mold: error: ./libbsd.map: cannot assign version `LIBBSD_0.2` to symbol `strnunvis`: symbol not found
mold: error: ./libbsd.map: cannot assign version `LIBBSD_0.5` to symbol `setproctitle`: symbol not found
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:645: libbsd.la] Error 1
make[2]: Leaving directory '/home/kostadin/libbsd/src'
make[1]: *** [Makefile:420: all-recursive] Error 1
make[1]: Leaving directory '/home/kostadin/libbsd'
make: *** [Makefile:352: all] Error 2
```
[libbsd-gitlab.log](/uploads/dbd4dd5f6bde5e47b6099d66a53dfa0a/libbsd-gitlab.log)https://gitlab.freedesktop.org/libbsd/libbsd/-/issues/16New release for lld-16 and musl-1.2.4 fixes?2024-01-08T02:53:04ZSam JamesNew release for lld-16 and musl-1.2.4 fixes?Hi,
Would it be possible to have a new release for the lld-16 (symbol versioning/linker script bits), musl-1.2.4 (LFS stuff), and modern C (configure.ac implicit func. decls) fixes?
Some of the fixes are a bit awkward to backport becau...Hi,
Would it be possible to have a new release for the lld-16 (symbol versioning/linker script bits), musl-1.2.4 (LFS stuff), and modern C (configure.ac implicit func. decls) fixes?
Some of the fixes are a bit awkward to backport because they rely on other commits.
Many thanks!https://gitlab.freedesktop.org/libbsd/libbsd/-/issues/15Error using `bsd/stdlib.h` on musl when building minizip-ng2024-01-08T01:13:35ZSam JamesError using `bsd/stdlib.h` on musl when building minizip-ngHi,
I'm not sure if this is a minizip-ng or a libbsd issue, but I figured I'd file it here because if it is a minizip-ng issue, you might be able to give a hint as to how headers are possibly being misused.
When building minizip-ng wit...Hi,
I'm not sure if this is a minizip-ng or a libbsd issue, but I figured I'd file it here because if it is a minizip-ng issue, you might be able to give a hint as to how headers are possibly being misused.
When building minizip-ng with OpenSSL support off (`-DMZ_OPENSSL=OFF`) on a musl system, I get the following:
```
FAILED: CMakeFiles/minizip-ng.dir/mz_strm.c.o
/usr/bin/x86_64-gentoo-linux-musl-gcc -DHAVE_ARC4RANDOM_BUF -DHAVE_BZIP2 -DHAVE_GETRANDOM -DHAVE_ICONV -DHAVE_INTTYPES_H -DHAVE_LIBBSD -DHAVE_LZMA -DHAVE_PKCRYPT -DHAVE_STDINT_H -DHAVE_ZLIB -DLZMA_API_STATIC -DMZ_EXPORTS -DMZ_ZIP_NO_CRYPTO -D_POSIX_C_SOURCE=200112L -I/usr/include/bsd -I/var/tmp/portage/sys-libs/minizip-ng-3.0.8/work/minizip-ng-3.0.8 -pipe -march=native -fno-diagnostics-color -O2 -fPIC -fno-diagnostics-color -std=gnu99 -MD -MT CMakeFiles/minizip-ng.dir/mz_strm.c.o -MF CMakeFiles/minizip-ng.dir/mz_strm.c.o.d -o CMakeFiles/minizip-ng.dir/mz_strm.c.o -c /var/tmp/portage/sys-libs/minizip-ng-3.0.8/work/minizip-ng-3.0.8/mz_strm.c
In file included from /usr/include/bsd/stdlib.h:32,
from /usr/include/bsd/stdlib.h:32,
[.. snipped many of the exact same line .. ]
from /var/tmp/portage/sys-libs/minizip-ng-3.0.8/work/minizip-ng-3.0.8/mz.h:164,
from /var/tmp/portage/sys-libs/minizip-ng-3.0.8/work/minizip-ng-3.0.8/mz_strm.c:11:
/usr/include/bsd/stdlib.h:32:20: error: #include nested depth 200 exceeds maximum of 200 (use -fmax-include-depth=DEPTH to increase the maximum)
32 | #include <stdlib.h>
| ^
/usr/include/bsd/stdlib.h:39:25: error: #include nested depth 200 exceeds maximum of 200 (use -fmax-include-depth=DEPTH to increase the maximum)
39 | #include <bsd/libutil.h>
| ^
/usr/include/bsd/stdlib.h:48:27: error: #include nested depth 200 exceeds maximum of 200 (use -fmax-include-depth=DEPTH to increase the maximum)
48 | #include <bsd/sys/cdefs.h>
| ^
/usr/include/bsd/stdlib.h:50:22: error: #include nested depth 200 exceeds maximum of 200 (use -fmax-include-depth=DEPTH to increase the maximum)
50 | #include <sys/stat.h>
| ^
/usr/include/bsd/stdlib.h:51:20: error: #include nested depth 200 exceeds maximum of 200 (use -fmax-include-depth=DEPTH to increase the maximum)
51 | #include <stdint.h>
| ^
/usr/include/bsd/stdlib.h:55:20: error: missing binary operator before token "("
55 | !__GLIBC_PREREQ(2, 36) || \
| ^
/usr/include/bsd/stdlib.h:53:14: error: expected ';' before 'void'
53 | __BEGIN_DECLS
| ^
| ;
......
61 | void arc4random_stir(void);
| ~~~~
/usr/include/bsd/stdlib.h:64:40: error: unknown type name 'int64_t'
64 | int dehumanize_number(const char *str, int64_t *size);
| ^~~~~~~
/usr/include/bsd/stdlib.h:1:1: note: 'int64_t' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?
+++ |+#include <stdint.h>
1 | /*
/usr/include/bsd/stdlib.h:69:22: error: unknown type name 'size_t'
69 | int heapsort(void *, size_t, size_t, int (*)(const void *, const void *));
| ^~~~~~
/usr/include/bsd/stdlib.h:1:1: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
+++ |+#include <stddef.h>
1 | /*
```
Initially reported downstream in Gentoo at https://bugs.gentoo.org/889266. Full log (bzip2'd) at https://bugs.gentoo.org/attachment.cgi?id=846360.
Any ideas what's going on? Thanks!https://gitlab.freedesktop.org/libbsd/libbsd/-/issues/14Test explicit_bzero from 0.11.7 segfaults only on amd64 on RHEL/CentOS 7/82023-04-17T02:19:44ZRobert ScheckTest explicit_bzero from 0.11.7 segfaults only on amd64 on RHEL/CentOS 7/8The following test failure only occurs on amd64 architecture on RHEL/CentOS 7 and 8 (works fine on CentOS/RHEL/Rocky Linux 9, Fedora 35-37, Fedora Rawhide on ix86, amd64, ppc64le, s390x, aarch64), starting with the 0.11.7 release. The 0....The following test failure only occurs on amd64 architecture on RHEL/CentOS 7 and 8 (works fine on CentOS/RHEL/Rocky Linux 9, Fedora 35-37, Fedora Rawhide on ix86, amd64, ppc64le, s390x, aarch64), starting with the 0.11.7 release. The 0.11.6 release passed the tests a couple of months ago.
```
/usr/bin/make check-TESTS
make[2]: Entering directory `/builddir/build/BUILD/libbsd-0.11.7/test'
make[3]: Entering directory `/builddir/build/BUILD/libbsd-0.11.7/test'
PASS: closefrom
PASS: bzero
PASS: endian
PASS: overlay
PASS: humanize
PASS: funopen
PASS: fgetln
PASS: fparseln
PASS: fpurge
PASS: md5
PASS: nlist
../build-aux/test-driver: line 95: 1498515 Segmentation fault (core dumped) "$@" > $log_file 2>&1
FAIL: explicit_bzero
PASS: proctitle-init
PASS: progname
PASS: pwcache
PASS: setmode
PASS: strl
PASS: strmode
PASS: strtonum
PASS: strnstr
PASS: vis
PASS: vis-openbsd
PASS: proctitle
PASS: headers-system.sh
PASS: headers-overlay.sh
make[4]: Entering directory `/builddir/build/BUILD/libbsd-0.11.7/test'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/builddir/build/BUILD/libbsd-0.11.7/test'
============================================================================
Testsuite summary for libbsd 0.11.7
============================================================================
# TOTAL: 25
# PASS: 24
# SKIP: 0
# XFAIL: 0
# FAIL: 1
# XPASS: 0
# ERROR: 0
```https://gitlab.freedesktop.org/libbsd/libbsd/-/issues/13License of man/setproctitle.3bsd2022-09-26T01:01:36ZRobert ScheckLicense of man/setproctitle.3bsdAs of writing, the license of [man/setproctitle.3bsd](https://cgit.freedesktop.org/libbsd/tree/man/setproctitle.3bsd) seems to be kind of problematic for Red Hat Legal. Note, I am a volunteer Fedora Project contributor, not a Red Hat emp...As of writing, the license of [man/setproctitle.3bsd](https://cgit.freedesktop.org/libbsd/tree/man/setproctitle.3bsd) seems to be kind of problematic for Red Hat Legal. Note, I am a volunteer Fedora Project contributor, not a Red Hat employee (nor a lawyer).
My goal is to have the latest release of libbsd in Fedora and EPEL, for which I packaged libmd recently. While preparing the libbsd package update technically, I [stumbled over licenses in libbsd](https://gitlab.com/fedora/legal/fedora-license-data/-/issues/71) not (yet) being allowed for Fedora, since Fedora decided to switch to SPDX as license identifier in the package metadata.
The case of `man/setproctitle.3bsd` lead to:
- https://gitlab.com/fedora/legal/fedora-license-data/-/issues/73
- https://github.com/spdx/license-list-XML/issues/1629
Given I don't like downstream-only solutions (like shipping a custom tarball for each libbsd release), I would like to get this issue sorted out on upstream side. Personally, I am not sure what a good upstream solution could be other than relicensing (which might get too tricky) or switching to another setproctitle(3) man page, e.g. from OpenBSD.
In general, I would like to see some link between you as upstream and Red Hat Legal (covering legal activities of the Fedora Project) in order to get this properly sorted out on upstream side - thank you.https://gitlab.freedesktop.org/libbsd/libbsd/-/issues/12arc4random: Make rekey interval less predictable [upstream]2022-08-03T09:43:15ZLoganaden Velvindronarc4random: Make rekey interval less predictable [upstream]This is from arc4random.c OpenBSD upstream where the rekey interval is made to less predictable.
[arc4random.patch](/uploads/cca5ee573d0d700b1984925c3b120392/arc4random.patch)This is from arc4random.c OpenBSD upstream where the rekey interval is made to less predictable.
[arc4random.patch](/uploads/cca5ee573d0d700b1984925c3b120392/arc4random.patch)https://gitlab.freedesktop.org/libbsd/libbsd/-/issues/9proctitle regression in 0.11.42022-01-25T06:55:06ZDrew DeVaultproctitle regression in 0.11.4On Alpine Linux edge (with musl libc, possibly relevant) and Linux 5.15.16-0-lts, the 0.11.4 upgrade introduced a test failure for proctitle:
```
==============================================
libbsd 0.11.4-dirty: test/test-suite.log...On Alpine Linux edge (with musl libc, possibly relevant) and Linux 5.15.16-0-lts, the 0.11.4 upgrade introduced a test failure for proctitle:
```
==============================================
libbsd 0.11.4-dirty: test/test-suite.log
==============================================
# TOTAL: 22
# PASS: 21
# SKIP: 0
# XFAIL: 0
# FAIL: 1
# XPASS: 0
# ERROR: 0
.. contents:: :depth: 2
FAIL: proctitle
===============
lt-proctitle: setproctitle not initialized, please either call setproctitle_init() or link against libbsd-ctor.
Assertion failed: strcmp(argv[0], newtitle_base) == 0 (proctitle.c: main: 46)
Aborted
FAIL proctitle (exit status: 134)
```https://gitlab.freedesktop.org/libbsd/libbsd/-/issues/8How do I compile libbsd?2022-01-24T19:38:53ZRalph KubeHow do I compile libbsd?Title says it. I'd like to compile and install this library on my system. How do I do that?Title says it. I'd like to compile and install this library on my system. How do I do that?https://gitlab.freedesktop.org/libbsd/libbsd/-/issues/7Remove advertising clause from Niels Provos2023-03-29T00:50:08ZDylan AïssiRemove advertising clause from Niels ProvosHello,
Citing the [website](https://libbsd.freedesktop.org/):
> Most of the licenses are either ... and BSD-4-clause (but only for few of the man pages, and **this is considered a bug**).
Thanks for the clarification about this license...Hello,
Citing the [website](https://libbsd.freedesktop.org/):
> Most of the licenses are either ... and BSD-4-clause (but only for few of the man pages, and **this is considered a bug**).
Thanks for the clarification about this license issue. Would it be possible to remove the advertising clause from Niels Provos in the relevant manpages (_arc4random.3bsd_ and _tree.3bsd_)? Niels gave his explicit permission to drop clause 3, the "advertising" clause, from his code. See:
- https://github.com/pyca/bcrypt/pull/170
- https://github.com/pyca/bcrypt/files/3081054/Blowfish-cypher-license-change.pdf
Thanks!
Best,
Dylanhttps://gitlab.freedesktop.org/libbsd/libbsd/-/issues/6sys/cdefs.h uses __uintptr_t yet it's not defined2021-02-09T10:50:18ZMariusz Woloszynsys/cdefs.h uses __uintptr_t yet it's not definedlibbsd's `sys/cdefs.h` uses `__uintptr_t` yet it's not defined anywhere triggering `error: ‘__uintptr_t’ undeclared` during compilation.
On FreeBSD `__uintptr_t` is declared in x86/_types.hlibbsd's `sys/cdefs.h` uses `__uintptr_t` yet it's not defined anywhere triggering `error: ‘__uintptr_t’ undeclared` during compilation.
On FreeBSD `__uintptr_t` is declared in x86/_types.h