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}