Re: Threaded version of TOOL_XZ ?

Paul Goyette <[email protected]>
Newsgroups gmane.os.netbsd.devel.toolchain,gmane.os.netbsd.current
Message-ID <[email protected]>
Thanks - the extra lib was what I missed earlier!

I'd like this to be optional, ie USE_XZ_THREADS={yes, no}

As for passsing -T0 that could be done in the setting of XZ_OPT
in distrib/sets/Makefile, also done conditionally based on
USE_XZ_THREADS

On Tue, 19 Apr 2022, Tobias Nygren wrote:

> On Tue, 19 Apr 2022 10:18:20 -0700 (PDT)
> Paul Goyette <[email protected]> wrote:
>
>> Using TOOL_XZ instead of TOOL_GZ satisfies requirement #1, and use of
>> (unsupported) TOOL_PIGZ satisfies #2, but neither option can meet
>> both.  TOOL_XZ is explicitly built without thread support, and simply
>> modifying its Makefile to enable_threads=yes doesn't build.
>
> This patch does more or less what you want. But doing it this way means
> NetBSD can no longer be cross-compiled from a host without pthreads.
> Not sure if we care about this anymore or if we need to hide this
> behind a toggle. You also need to hook "-T 0" into xz args for sets.
>
> # set cpu on fire
> /work/tools/bin/nbxz -T 0 -9c < /dev/zero > /dev/null
>
> Index: external/public-domain/xz/bin/xz/Makefile
> ===================================================================
> RCS file: /cvsroot/src/external/public-domain/xz/bin/xz/Makefile,v
> retrieving revision 1.6
> diff -p -u -r1.6 Makefile
> --- external/public-domain/xz/bin/xz/Makefile	12 Apr 2021 02:54:08 -0000	1.6
> +++ external/public-domain/xz/bin/xz/Makefile	19 Apr 2022 18:03:58 -0000
> @@ -44,7 +44,7 @@ FILESNAME_${XZSRCDIR}/po/${lang}.gmo=	xz
> .if defined(HOSTPROG)
> HOST_CPPFLAGS+=	${CPPFLAGS:N-Wp,-iremap,*}
> XZLIBDIR!=	cd ${NETBSDSRCDIR}/tools/xz-lib && ${PRINTOBJDIR}
> -LDADD+=	-L${XZLIBDIR} -llzma
> +LDADD+=	-L${XZLIBDIR} -llzma -lpthread
> DPADD+=	${XZLIBDIR}/liblzma.a
> .else
> DPADD+=	${LIBLZMA} ${LIBINTL} ${LIBPTHREAD}
> Index: external/public-domain/xz/lib/Makefile
> ===================================================================
> RCS file: /cvsroot/src/external/public-domain/xz/lib/Makefile,v
> retrieving revision 1.10
> diff -p -u -r1.10 Makefile
> --- external/public-domain/xz/lib/Makefile	25 Sep 2018 05:42:08 -0000	1.10
> +++ external/public-domain/xz/lib/Makefile	19 Apr 2022 18:03:58 -0000
> @@ -57,9 +57,7 @@ SRCS+=	common.c block_util.c easy_preset
> 	index_decoder.c index_hash.c stream_buffer_decoder.c \
> 	stream_decoder.c stream_flags_decoder.c vli_decoder.c
>
> -.if !defined(HOSTLIB)
> SRCS+=	 stream_encoder_mt.c
> -.endif
>
> .PATH:	${XZSRCDIR}/src/liblzma/delta
> SRCS+=	delta_common.c delta_encoder.c delta_decoder.c
> Index: tools/xz-include/Makefile
> ===================================================================
> RCS file: /cvsroot/src/tools/xz-include/Makefile,v
> retrieving revision 1.4
> diff -p -u -r1.4 Makefile
> --- tools/xz-include/Makefile	18 Sep 2021 01:47:11 -0000	1.4
> +++ tools/xz-include/Makefile	19 Apr 2022 18:03:59 -0000
> @@ -8,7 +8,7 @@
> #
> .include "Makefile.inc"
>
> -CONFIGURE_ARGS+=	--enable-threads=no --disable-nls
> +CONFIGURE_ARGS+=	--enable-threads=posix --disable-nls
> .if ${MAKEVERBOSE} == 0
> CONFIGURE_ARGS+=	--silent
> .endif
>
> !DSPAM:625efa5669779096642723!
>
>

+--------------------+--------------------------+----------------------+
| Paul Goyette       | PGP Key fingerprint:     | E-mail addresses:    |
| (Retired)          | FA29 0E3B 35AF E8AE 6651 | [email protected]    |
| Software Developer | 0786 F758 55DE 53BA 7731 | [email protected]  |
| & Network Engineer |                          | [email protected] |
+--------------------+--------------------------+----------------------+
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.