Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > muc.lists.freebsd.emulation > #13169 > unrolled thread

[Bug 298461] emulators/qemu-user-static-devel: does not build on FreeBSD 15 (undefined symbol __realpathat; keymap generation)

Started bybugzilla-noreply@freebsd.org
First post2026-09-13 22:34 +0000
Last post2026-09-14 04:24 +0000
Articles 6 — 1 participant

Back to article view | Back to muc.lists.freebsd.emulation


Contents

  [Bug 298461] emulators/qemu-user-static-devel: does not build on FreeBSD 15 (undefined symbol __realpathat; keymap generation) bugzilla-noreply@freebsd.org - 2026-09-13 22:34 +0000
    maintainer-feedback requested: [Bug 298461] emulators/qemu-user-static-devel: does not build on FreeBSD 15 (undefined symbol __realpathat; keymap generation) bugzilla-noreply@freebsd.org - 2026-09-13 22:34 +0000
    [Bug 298461] emulators/qemu-user-static-devel: does not build on FreeBSD 15 (undefined symbol __realpathat; keymap generation) bugzilla-noreply@freebsd.org - 2026-09-14 00:01 +0000
    [Bug 298461] emulators/qemu-user-static-devel: does not build on FreeBSD 15 (undefined symbol __realpathat; keymap generation) bugzilla-noreply@freebsd.org - 2026-09-14 02:23 +0000
    [Bug 298461] emulators/qemu-user-static-devel: does not build on FreeBSD 15 (undefined symbol __realpathat; keymap generation) bugzilla-noreply@freebsd.org - 2026-09-14 03:19 +0000
    [Bug 298461] emulators/qemu-user-static-devel: does not build on FreeBSD 15 (undefined symbol __realpathat; keymap generation) bugzilla-noreply@freebsd.org - 2026-09-14 04:24 +0000

#13169 — [Bug 298461] emulators/qemu-user-static-devel: does not build on FreeBSD 15 (undefined symbol __realpathat; keymap generation)

Frombugzilla-noreply@freebsd.org
Date2026-09-13 22:34 +0000
Subject[Bug 298461] emulators/qemu-user-static-devel: does not build on FreeBSD 15 (undefined symbol __realpathat; keymap generation)
Message-ID<bug-298461-4077@https.bugs.freebsd.org/bugzilla/>
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298461

            Bug ID: 298461
           Summary: emulators/qemu-user-static-devel: does not build on
                    FreeBSD 15 (undefined symbol __realpathat; keymap
                    generation)
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: emulation@FreeBSD.org
          Reporter: rick@sloservers.com
          Assignee: emulation@FreeBSD.org
             Flags: maintainer-feedback?(emulation@FreeBSD.org)

Created attachment 274708
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=274708&action=edit
Fix build on FreeBSD 15: __realpathat symbol + skip keymap generation;
PORTREVISION 4 -> 5

emulators/qemu-user-static-devel (qemu 6.2.50, PORTREVISION 4) does not build
on
FreeBSD 15.1-RELEASE amd64. Two independent causes; the attached patch fixes
both
and bumps PORTREVISION to 5.

1) Link failure: undefined symbol __realpathat

    ld: error: undefined symbol: __realpathat
    >>> referenced by os-stat.h:705 (bsd-user/freebsd/os-stat.h:705)
    >>>              
libqemu-arm-bsd-user.fa.p/bsd-user_freebsd_os-syscall.c.o:(do_freebsd_realpathat)
    >>> did you mean: ___realpathat
    >>> defined in: /usr/lib/libc.a(___realpathat.o)

All seven targets fail identically (qemu-arm, qemu-aarch64, qemu-i386,
qemu-x86_64, qemu-ppc, qemu-ppc64, qemu-riscv64). Compilation is clean; only
the link fails.

bsd-user/freebsd/os-stat.h declares and calls __realpathat (two leading
underscores). libc spells it with three:

    $ nm -D /lib/libc.so.7 | grep realpathat
    00000000001443c0 W ___realpathat@@FBSDprivate_1.0
    00000000001443c0 T __sys___realpathat@@FBSDprivate_1.0

The kernel syscall is __realpathat; the libc wrapper prepends an underscore,
giving ___realpathat.

Note the change must stay scoped to os-stat.h: elsewhere the same string occurs
inside the macro TARGET_FREEBSD_NR___realpathat (os-syscall.c, syscall_nr.h,
strace.list), and a tree-wide substitution would break syscall dispatch.

One question for the maintainer: the block is already guarded by
__FreeBSD_version >= 1300080. If some version in that range genuinely exported
the two-underscore spelling, this wants a narrower version guard rather than a
rename. Only 15.1 was available to test on.

2) Build failure: pc-bios keymaps regenerated against current xkeyboard-config

Triggered whenever any qemu package is already installed:

    /usr/local/bin/qemu-keymap -f pc-bios/keymaps/ar -l ar
    xkbcommon: ERROR: [XKB-338] Couldn't find file "symbols/ar" in include
paths
    ninja: build stopped: subcommand failed.

meson locates qemu-keymap on PATH and picks up the binary from an unrelated
installed qemu (here qemu-11.0.2), using a version-11 tool to generate data for
a 6.2.50 build. The layout it requests no longer exists either:
xkeyboard-config
2.48 renamed the Arabic layout from "ar" to "ara".

This port configures --disable-system --disable-tools, so the keymaps are never
used. Upstream already handles the tool being absent by copying the
pre-generated keymaps from the source tree; the patch takes that path
unconditionally.

Reproduced with xkeyboard-config-2.48 and qemu-11.0.2 installed.

Validation

Clean room on 15.1-RELEASE-p2 amd64, stock invocation, no environment
overrides,
qemu-keymap left installed:

    cd /usr/ports/emulators/qemu-user-static-devel
    make clean
    make build

Result: 962/962 targets, all seven qemu-*-bsd-user binaries linked. The port
then installs, and qemu-arm-static reports "qemu-arm version 6.2.50" and
executes armv7 binaries correctly under binmiscctl. Each patch was also
verified
to apply with patch -p0 against a pristine extract.

Why this port matters: it is the only static user-mode emulator available for
cross-building packages with poudriere. emulators/qemu-user-static is pinned at
QEMU 3.1.0 (2018), and emulators/qemu-devel's STATIC_LINK option covers system
emulation rather than the user-mode binaries binmiscctl needs.

-- 
You are receiving this mail because:
You are the assignee for the bug.

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de

[toc] | [next] | [standalone]


#13170 — maintainer-feedback requested: [Bug 298461] emulators/qemu-user-static-devel: does not build on FreeBSD 15 (undefined symbol __realpathat; keymap generation)

Frombugzilla-noreply@freebsd.org
Date2026-09-13 22:34 +0000
Subjectmaintainer-feedback requested: [Bug 298461] emulators/qemu-user-static-devel: does not build on FreeBSD 15 (undefined symbol __realpathat; keymap generation)
Message-ID<bug-298461-4077-XXbArhGFih@https.bugs.freebsd.org/bugzilla/>
In reply to#13169
Bugzilla Automation <bugzilla@FreeBSD.org> has asked freebsd-emulation (Nobody)
<emulation@FreeBSD.org> for maintainer-feedback:
Bug 298461: emulators/qemu-user-static-devel: does not build on FreeBSD 15
(undefined symbol __realpathat; keymap generation)
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298461



--- Description ---
emulators/qemu-user-static-devel (qemu 6.2.50, PORTREVISION 4) does not build
on
FreeBSD 15.1-RELEASE amd64. Two independent causes; the attached patch fixes
both
and bumps PORTREVISION to 5.

1) Link failure: undefined symbol __realpathat

    ld: error: undefined symbol: __realpathat
    >>> referenced by os-stat.h:705 (bsd-user/freebsd/os-stat.h:705)
    >>> 	     
libqemu-arm-bsd-user.fa.p/bsd-user_freebsd_os-syscall.c.o:(do_freebsd_realpatha
t)
    >>> did you mean: ___realpathat
    >>> defined in: /usr/lib/libc.a(___realpathat.o)

All seven targets fail identically (qemu-arm, qemu-aarch64, qemu-i386,
qemu-x86_64, qemu-ppc, qemu-ppc64, qemu-riscv64). Compilation is clean; only
the link fails.

bsd-user/freebsd/os-stat.h declares and calls __realpathat (two leading
underscores). libc spells it with three:

    $ nm -D /lib/libc.so.7 | grep realpathat
    00000000001443c0 W ___realpathat@@FBSDprivate_1.0
    00000000001443c0 T __sys___realpathat@@FBSDprivate_1.0

The kernel syscall is __realpathat; the libc wrapper prepends an underscore,
giving ___realpathat.

Note the change must stay scoped to os-stat.h: elsewhere the same string occurs
inside the macro TARGET_FREEBSD_NR___realpathat (os-syscall.c, syscall_nr.h,
strace.list), and a tree-wide substitution would break syscall dispatch.

One question for the maintainer: the block is already guarded by
__FreeBSD_version >= 1300080. If some version in that range genuinely exported
the two-underscore spelling, this wants a narrower version guard rather than a
rename. Only 15.1 was available to test on.

2) Build failure: pc-bios keymaps regenerated against current xkeyboard-config

Triggered whenever any qemu package is already installed:

    /usr/local/bin/qemu-keymap -f pc-bios/keymaps/ar -l ar
    xkbcommon: ERROR: [XKB-338] Couldn't find file "symbols/ar" in include
paths
    ninja: build stopped: subcommand failed.

meson locates qemu-keymap on PATH and picks up the binary from an unrelated
installed qemu (here qemu-11.0.2), using a version-11 tool to generate data for
a 6.2.50 build. The layout it requests no longer exists either:
xkeyboard-config
2.48 renamed the Arabic layout from "ar" to "ara".

This port configures --disable-system --disable-tools, so the keymaps are never
used. Upstream already handles the tool being absent by copying the
pre-generated keymaps from the source tree; the patch takes that path
unconditionally.

Reproduced with xkeyboard-config-2.48 and qemu-11.0.2 installed.

Validation

Clean room on 15.1-RELEASE-p2 amd64, stock invocation, no environment
overrides,
qemu-keymap left installed:

    cd /usr/ports/emulators/qemu-user-static-devel
    make clean
    make build

Result: 962/962 targets, all seven qemu-*-bsd-user binaries linked. The port
then installs, and qemu-arm-static reports "qemu-arm version 6.2.50" and
executes armv7 binaries correctly under binmiscctl. Each patch was also
verified
to apply with patch -p0 against a pristine extract.

Why this port matters: it is the only static user-mode emulator available for
cross-building packages with poudriere. emulators/qemu-user-static is pinned at
QEMU 3.1.0 (2018), and emulators/qemu-devel's STATIC_LINK option covers system
emulation rather than the user-mode binaries binmiscctl needs.


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de

[toc] | [prev] | [next] | [standalone]


#13171

Frombugzilla-noreply@freebsd.org
Date2026-09-14 00:01 +0000
Message-ID<bug-298461-4077-TctlBVWccH@https.bugs.freebsd.org/bugzilla/>
In reply to#13169
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298461

--- Comment #1 from Rick Richard <rick@sloservers.com> ---
Follow-up after checking upstream: this port is pinned to qemu-bsd-user commit
64ff0f053df, dated 2022-02-04, on the "blitz" branch. That branch is still
actively maintained - HEAD is e725658f (2026-05-24) and now carries VERSION
11.0.50, five major QEMU releases ahead of the 6.2.50 this port ships.

Two of the three things in my patch are already fixed upstream, one of them
better than my version:

1) __realpathat. blitz HEAD no longer references the libc symbol at all. In
bsd-user/freebsd/os-stat.h it now does:

    ret = get_errno(syscall(SYS___realpathat, arg1, p, b, arg4, arg5));

That sidesteps the two-underscore vs three-underscore question entirely and is
clearly preferable to the rename in my patch. My hunk fixes a snapshot upstream
has already moved past.

2) A separate runtime defect in the same snapshot, also fixed upstream. In
bsd-user/freebsd/os-thread.c, freebsd_umtx_nwake_private() indexed its batch
array with the outer loop variable:

    uaddrs[i % BATCH_SIZE] = (uintptr_t)g2h_untagged(tp[j]);

BATCH_SIZE is 128, so for any broadcast of fewer than 128 waiters every address
lands in uaddrs[0] and the kernel is handed one real address plus uninitialised
stack as wake targets. pthread_cond_broadcast() to N waiters wakes exactly one.
Any 32-bit guest using a thread pool hangs: "zstd -T8" under emulation writes
its complete output and never exits, and poudriere cross builds stall in
"pkg create" and "pkg repo" because Mk/bsd.port.mk passes
-T${MAKE_JOBS_NUMBER}.

blitz HEAD already reads uaddrs[j % BATCH_SIZE]. Changing i to j in the pinned
version took a poudriere armv7 bulk run from crashed after 2h25m to done in
1m43s with full build parallelism.

3) The keymap problem IS still present upstream at blitz HEAD:

    native_qemu_keymap = find_program('qemu-keymap', required: false, disabler:
true)

so that hunk stays relevant regardless of version.

Given the above, updating the port to a current blitz commit is a better fix
than my first two hunks and would pick up four years of bsd-user work besides.
I am attempting that now and will follow up here with a version-bump patch if
it builds cleanly; treat the attached diff as a stopgap for the pinned version
in the meantime.

For completeness: mainline QEMU is not affected - bsd-user/freebsd in qemu.git
has no os-thread.c and no umtx implementation, so there is nothing to report
upstream of the fork.

-- 
You are receiving this mail because:
You are the assignee for the bug.

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de

[toc] | [prev] | [next] | [standalone]


#13172

Frombugzilla-noreply@freebsd.org
Date2026-09-14 02:23 +0000
Message-ID<bug-298461-4077-9sxchhgh5q@https.bugs.freebsd.org/bugzilla/>
In reply to#13169
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298461

Warner Losh <imp@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|New                         |Closed
                 CC|                            |imp@FreeBSD.org
         Resolution|---                         |DUPLICATE

--- Comment #2 from Warner Losh <imp@FreeBSD.org> ---
There's a much more extensive patch to bring things up to date for the -devel
port.

Though both it and the latest blitz suffer from hanging problems.

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=286875

*** This bug has been marked as a duplicate of bug 286875 ***

-- 
You are receiving this mail because:
You are the assignee for the bug.

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de

[toc] | [prev] | [next] | [standalone]


#13174

Frombugzilla-noreply@freebsd.org
Date2026-09-14 03:19 +0000
Message-ID<bug-298461-4077-MsUtmDwhJr@https.bugs.freebsd.org/bugzilla/>
In reply to#13169
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298461

--- Comment #3 from Rick Richard <rick@sloservers.com> ---
Dang, I wound up doing a bunch of overlapping work on this that was coming in a
follow-up, but thanks for pointing to the other thread.  I will follow-up there
with additional fixes and verifications.  Expect a PR against blitz later
tonight.

-- 
You are receiving this mail because:
You are the assignee for the bug.

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de

[toc] | [prev] | [next] | [standalone]


#13175

Frombugzilla-noreply@freebsd.org
Date2026-09-14 04:24 +0000
Message-ID<bug-298461-4077-F1bbHaolYe@https.bugs.freebsd.org/bugzilla/>
In reply to#13169
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298461

--- Comment #4 from Warner Losh <imp@FreeBSD.org> ---
(In reply to Rick Richard from comment #3)
Excellent. I have it building on my 14 and 15 containers as of early August
since I'm trying to get a lot of it upstreamed since it's too much working
maintaining N different versions. I'd love the help.

-- 
You are receiving this mail because:
You are the assignee for the bug.

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de

[toc] | [prev] | [standalone]


Back to top | Article view | muc.lists.freebsd.emulation


csiph-web