userland cross: the target's X is reachable to the compiler, and libXft's missing prototype is brought in

fonts/Xft2 stopped at three X problems in a row (build/logs/userland-2026-11-13t.log,
build/logs/xft2-single*.log):

- x11-links builds a shadow tree from ${X11BASE}/<file> and /usr/<file>, both this
  host's paths in a cross build: it linked Debian's xorgproto headers and never
  Xrender.h.  For that one package X11BASE is now the sysroot's /usr/X11R7.
- mk/x11.buildlink3.mk:31 passes --x-includes=/usr/X11R7/include, and neither
  --sysroot nor the cwrappers make that resolve here (tested: plain gcc with
  --sysroot still fails; the wrapper rewrites the path into a shadow tree of the
  host's X).  GCC's sysroot-relative form works and the wrapper passes it
  through untouched (tested in a work directory): CPPFLAGS+= -I=${X11BASE}/include,
  LDFLAGS+= -L=${X11BASE}/lib.
- libXft 2.1.7 calls FT_GlyphSlot_Embolden with no declaration in scope and GCC
  14 errors on that; configure proves the symbol is in the library, the prototype
  is in <freetype/ftsynth.h>, so that header is included for the package.

fonts/Xft2 now builds and installs (build/logs/xft2-single4-2026-11-13.log
exit=0).  tools/userland.sh's comment records that a CFLAGS change in the
fragment needs a clean work directory.
This commit is contained in:
lotherk committed 2026-11-13 22:43:42 +00:00
1 parent 29c63733ea
commit 4facdf5c9b
2 files changed
+43 -1

No files matched your search

+38 -1
View File
@@ -130,6 +130,43 @@ NATIVE_CC= /usr/bin/gcc
# what the wrapper asks for; the recipe is pkgsrc's, which this tree does not
# patch, so the setting is here. PKGPATH is defined when this file is read
# (measured with a temporary mk.conf: show-var VARNAME=USE_LANGUAGES -> c++).
# c stays in the list: USE_LANGUAGES is empty in that recipe, so this is the
# only place the language list is set, and without c pkgsrc wraps cc too -- the
# C preprocessor probe then fails the same way (userland-2026-11-13s.log:88).
.if ${PKGPATH} == "fonts/Xft2"
USE_LANGUAGES+= c++
USE_LANGUAGES+= c c++
# libXft 2.1.7 calls FT_GlyphSlot_Embolden (xftglyphs.c:177) without a
# declaration in scope: freetype dropped FT_SYNTHESIS_H from ft2build.h, and
# configure finds the symbol in the library instead of the header
# (config.log:1033 ac_cv_func_FT_GlyphSlot_Embolden=yes). GCC 14 makes an
# implicit declaration an error, so the build stops (build/logs/
# xft2-single2-2026-11-13.log:316). The declaration is in
# <freetype/ftsynth.h>; bringing it in is the missing include, not a muted
# diagnostic (measured: the file compiles with -include freetype/ftsynth.h).
CFLAGS+= -include freetype/ftsynth.h
.endif
# pkgtools/x11-links builds the shadow tree the X packages see: it tests
# ${X11BASE}/<file> and /usr/<file> and links what it finds. In a cross build
# both are this host's paths, so it took Debian's xorgproto headers and never
# produced Xrender.h -- fonts/Xft2 then stopped with "Xrender.h not found"
# although the file is in the sysroot (measured 2026-11-13: the farm in
# build/obj/destdir.amd64/usr/pkg/share/x11-links/include had 52 links, all to
# /usr/include, build/logs/userland-2026-11-13t.log:155). Pointed at the
# sysroot it finds the target's X, as it would on a NetBSD host, where
# /usr/X11R7 *is* the native X.
.if ${PKGPATH} == "pkgtools/x11-links"
X11BASE= ${CROSS_DESTDIR}/usr/X11R7
.endif
# X is the target's base (X11_TYPE=native, X11BASE=/usr/X11R7), and
# mk/x11.buildlink3.mk:31 hands that path to every GNU configure:
# --x-includes=/usr/X11R7/include --x-libraries=/usr/X11R7/lib. This host has no
# /usr/X11R7, and neither --sysroot nor the cwrappers make such an absolute -I
# resolve: the wrapper even rewrites it to the work directory's .x11-buildlink,
# which holds links to the host's X (see pkgtools/x11-links above). The "=" form
# is GCC's sysroot-relative path (-I=/usr/X11R7/include is <sysroot>/usr/X11R7/
# include), and the wrapper passes it through untouched (measured 2026-11-13 in
# a work directory: ./cwrapper/bin/cc -c -I=/usr/X11R7/include compiles).
CPPFLAGS+= -I=${X11BASE}/include
LDFLAGS+= -L=${X11BASE}/lib
+5
View File
@@ -43,6 +43,11 @@ die()
# pkgsrc's mk.conf holds the copy of tools/pkgsrc-cross.mk.conf that the
# bootstrap made; the live file is included after it (plain assignments, so
# twice is the same), and a change in the fragment needs no re-bootstrap.
#
# A change of CFLAGS/CPPFLAGS/LDFLAGS there does need a fresh work directory:
# configure records them in the package's Makefile, so a running work dir keeps
# the old flags (measured 2026-11-13: -include freetype/ftsynth.h took effect
# only after `bmake clean' in fonts/Xft2).
ensure_mkconf()
{
mk=$TOP/build/pkg/etc/mk.conf