Bug 252760 - WITHOUT_LIBTHR and WITHOUT_LIBPTHREAD build options fail on lib/libgcc_s and lib/libthr
Summary: WITHOUT_LIBTHR and WITHOUT_LIBPTHREAD build options fail on lib/libgcc_s and ...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Kyle Evans
URL: https://reviews.freebsd.org/D28263
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-17 00:43 UTC by Michael Dexter
Modified: 2021-01-29 01:23 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Dexter 2021-01-17 00:43:14 UTC
If WITHOUT_LIBTHR=YES and(/or?) WITHOUT_LIBPTHREAD=YES are set in /etc/src.conf on 13.0-ALPHA1 amd64, the following errors are generated:

--- _libinstall ---
install -U  -s -o root -g wheel -m 444   -S  libc.so.7 /usr/obj/usr/src/amd64.amd64/tmp/lib/
install -U  -S -C -o root -g wheel -m 444   libc.ld  /usr/obj/usr/src/amd64.amd64/tmp/usr/lib/libc.so
install -U -l s -o root -g wheel -m 444 -S  libc.so  /usr/obj/usr/src/amd64.amd64/tmp/usr/lib/libxnet.so
install -U  -o root -g wheel -m 444   libc_pic.a /usr/obj/usr/src/amd64.amd64/tmp/usr/lib/
--- lib/libgcc_s__L ---
===> lib/libgcc_s (obj,all,install)
--- _libinstall ---
install -U  -s -o root -g wheel -m 444   -S  libgcc_s.so.1 /usr/obj/usr/src/amd64.amd64/tmp/lib/
install -U -l rs -o root -g wheel -m 755 -S   /usr/obj/usr/src/amd64.amd64/tmp/lib/libgcc_s.so.1 /usr/obj/usr/src/amd64.amd64/tmp/usr/lib/libgcc_s.so
--- lib/libbz2__L ---
--- lib/libcrypt__L ---
--- lib/libelf__L ---
--- lib/libexpat__L ---
--- lib/libfigpar__L ---
--- lib/libjail__L ---
--- lib/libkiconv__L ---
make[3]: make[3]: don't know how to make lib/libthr__L. Stop

Occurrences of them:

root@freebsd:/usr/src # grep -R MK_LIBTHR *
Makefile.inc1:.if ${MK_LIBTHR} != "no"
cddl/lib/Makefile:.if ${MK_LIBTHR} != "no"
cddl/usr.sbin/Makefile:.if ${MK_LIBTHR} != "no"
cddl/usr.bin/Makefile:.if ${MK_LIBTHR} != "no"
lib/Makefile:SUBDIR.${MK_LIBTHR}+=	libthr
lib/Makefile.original:SUBDIR.${MK_LIBTHR}+=	libthr
sbin/ggate/Makefile:.if ${MK_LIBTHR} != "no"
share/man/man3/Makefile:.if ${MK_LIBTHR} != "no"
share/mk/src.opts.mk:MK_LIBTHR:=	no
tools/build/mk/OptionalObsoleteFiles.inc:.if ${MK_LIBTHR} == no
usr.sbin/ngctl/Makefile:.if ${MK_LIBTHR} != "no"
usr.sbin/Makefile:.if ${MK_LIBTHR} != "no" || ${MK_LIBPTHREAD} != "no"

root@freebsd:/usr/src # grep -R MK_LIBPTHREAD *
share/mk/src.opts.mk:.if ${MK_LIBPTHREAD} == "no"
usr.sbin/Makefile:.if ${MK_LIBTHR} != "no" || ${MK_LIBPTHREAD} != "no"

I have experimented with a number of conditional exclusions in lib/Makefile but was not successful in resolving the issue.
Comment 1 Kyle Evans freebsd_committer 2021-01-21 02:44:23 UTC
I'll pre-emptively take this as I've staged them for removal and put out a call to solicit feedback: https://lists.freebsd.org/pipermail/freebsd-arch/2021-January/020260.html
Comment 2 Michael Dexter 2021-01-21 03:11:35 UTC
At the risk that this has not been said, thank you Kyle.
Comment 3 Michael Dexter 2021-01-21 03:17:23 UTC
Closed in light of https://reviews.freebsd.org/D28263

Thank you Kyle and Ed!
Comment 4 commit-hook freebsd_committer 2021-01-22 18:35:19 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=123ae3045dd21badb93ce52445e18e364b3ac807

commit 123ae3045dd21badb93ce52445e18e364b3ac807
Author:     Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2021-01-20 14:01:25 +0000
Commit:     Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2021-01-22 18:33:27 +0000

    build: remove LIBPTHREAD/LIBTHR build options

    WITHOUT_LIBTHR has been broken for a little over five years now, since the
    xz 5.2.0 update introduced a hard liblzma dependency on libthr, and building
    a useful system without threading support is becoming increasingly more
    difficult.

    Additionally, in the five plus years that it's been broken more reverse
    dependencies have cropped up in libzstd, libsqlite3, and libcrypto (among
    others) that make it more and more difficult to reconcile the effort needed
    to fix these options.

    Remove the broken options.

    PR:             252760
    Reviewed by:    brooks, emaste, kib
    Differential Revision:  https://reviews.freebsd.org/D28263

 Makefile.inc1                                 | 6 +-----
 cddl/lib/Makefile                             | 2 --
 cddl/usr.bin/Makefile                         | 2 --
 cddl/usr.sbin/Makefile                        | 2 --
 lib/Makefile                                  | 4 ++--
 sbin/ggate/Makefile                           | 9 ++-------
 share/man/man3/Makefile                       | 2 --
 share/mk/src.opts.mk                          | 6 ------
 tools/build/mk/OptionalObsoleteFiles.inc      | 7 -------
 tools/build/options/WITHOUT_LIBPTHREAD (gone) | 5 -----
 tools/build/options/WITHOUT_LIBTHR (gone)     | 5 -----
 usr.sbin/Makefile                             | 2 --
 usr.sbin/ngctl/Makefile                       | 2 --
 13 files changed, 5 insertions(+), 49 deletions(-)
Comment 5 commit-hook freebsd_committer 2021-01-29 01:23:29 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=ed05bfceb8191c2d50742203512bb0378d831aba

commit ed05bfceb8191c2d50742203512bb0378d831aba
Author:     Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2021-01-20 14:01:25 +0000
Commit:     Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2021-01-29 01:21:46 +0000

    build: remove LIBPTHREAD/LIBTHR build options

    WITHOUT_LIBTHR has been broken for a little over five years now, since the
    xz 5.2.0 update introduced a hard liblzma dependency on libthr, and building
    a useful system without threading support is becoming increasingly more
    difficult.

    Additionally, in the five plus years that it's been broken more reverse
    dependencies have cropped up in libzstd, libsqlite3, and libcrypto (among
    others) that make it more and more difficult to reconcile the effort needed
    to fix these options.

    Remove the broken options.

    PR:             252760

    (cherry picked from commit 123ae3045dd21badb93ce52445e18e364b3ac807)
    (cherry picked from commit 251a6ddfbdcd72e0de922e8320d2f0cc6806a423)

 Makefile.inc1                                 |  6 +-----
 cddl/lib/Makefile                             |  2 --
 cddl/usr.bin/Makefile                         |  2 --
 cddl/usr.sbin/Makefile                        |  2 --
 lib/Makefile                                  |  4 ++--
 sbin/ggate/Makefile                           |  9 ++-------
 share/man/man3/Makefile                       |  2 --
 share/man/man5/src.conf.5                     | 18 +-----------------
 share/mk/src.opts.mk                          |  6 ------
 tools/build/mk/OptionalObsoleteFiles.inc      |  7 -------
 tools/build/options/WITHOUT_LIBPTHREAD (gone) |  5 -----
 tools/build/options/WITHOUT_LIBTHR (gone)     |  5 -----
 usr.sbin/Makefile                             |  2 --
 usr.sbin/ngctl/Makefile                       |  2 --
 14 files changed, 6 insertions(+), 66 deletions(-)