From 41bdd94470a460b653d63f78008fd888d59cd16f Mon Sep 17 00:00:00 2001 From: lotherk Date: Fri, 13 Nov 2026 23:40:06 +0000 Subject: [PATCH] motif: wmluiltok links the bootstrap prefix's libfl, not the target's wmluiltok is a host tool and links -lfl; -L${LOCALBASE}/lib becomes the buildlink directory in a cross build, so the linker took the TARGET's flex library and stopped on NetBSD's libc.so.12 against the host's libc ('errno@@GLIBC_PRIVATE ... TLS definition ... mismatches non-TLS definition', build/logs/ userland-2026-11-13z.log:3680ff). The path is only set for a cross build; a native build has flex in its own prefix. --- ext/src/mcde/pkgsrc-motif/Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ext/src/mcde/pkgsrc-motif/Makefile b/ext/src/mcde/pkgsrc-motif/Makefile index 81a761d49f..8645a07f6e 100644 --- a/ext/src/mcde/pkgsrc-motif/Makefile +++ b/ext/src/mcde/pkgsrc-motif/Makefile @@ -77,6 +77,15 @@ MAKE_FLAGS+= CC_FOR_BUILD=${NATIVE_CC:Q:U${CC:Q}} # ("invalid option -- '='", userland-2026-11-13x.log:396). CFLAGS_FOR_BUILD= -O2 -std=gnu17 MAKE_FLAGS+= CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD:Q} +# wmluiltok is a host tool that links -lfl. In a cross build -L${LOCALBASE}/lib +# is rewritten to the buildlink directory, so -lfl resolves to the TARGET's flex +# library; the host linker then stops on NetBSD's libc.so.12 ("errno@@GLIBC_PRIVATE +# ... TLS definition ... mismatches", build/logs/userland-2026-11-13z.log:3680ff). +# The bootstrap prefix has a host libfl.a; naming the file leaves no search path +# to pick the target's from. +.if ${USE_CROSS_COMPILE:U:tl} == "yes" +MAKE_FLAGS+= LEXLIB=${MAKRONIX_TOP:Q}/build/pkg/lib/libfl.a +.endif MAKE_FLAGS+= AR_FOR_BUILD=${NATIVE_AR:Q:U${AR:Q}} MAKE_FLAGS+= RANLIB_FOR_BUILD=${NATIVE_RANLIB:Q:U${RANLIB:Q}} MAKE_FLAGS+= CPPFLAGS_FOR_BUILD=${CPPFLAGS_FOR_BUILD:Q}