Bug 295926 - FreeBSD 15.1-RC2 i386 compile error
Summary: FreeBSD 15.1-RC2 i386 compile error
Status: In Progress
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 15.1-RELEASE
Hardware: i386 Any
: --- Affects Some People
Assignee: Konstantin Belousov
URL:
Keywords: patch
: 295975 (view as bug list)
Depends on:
Blocks:
 
Reported: 2026-06-08 01:08 UTC by ota
Modified: 2026-06-25 00:51 UTC (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ota 2026-06-08 01:08:44 UTC
FreeBSD 15.1-RC3's code started producing compile error.
I haven't seen this until recent and was able to install up to 15.1-RC2.

% make -j 1 buildkernel
/sys -ffile-prefix-map=/usr/obj/usr/src/i386.i386/sys/GENERIC=/usr/obj/usr/src/i386.i386/sys/GENERIC -ffile-prefix-map=/usr/obj/usr/src/i386.i386/tmp=/sysroot -fdebug-prefix-map=./machine=/usr/src/sys/i386/include -fdebug-prefix-map=./x86=/usr/src/sys/x86/include -mno-mmx -mno-sse -msoft-float -ffreestanding -fwrapv -fstack-protector  -gdwarf-4 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wswitch -Wno-error=tautological-compare -Wno-error=empty-body -Wno-error=parentheses-equality -Wno-error=unused-function -Wno-error=pointer-sign -Wno-error=shift-negative-value -Wno-address-of-packed-member -Wno-format-zero-length   -mno-aes -mno-avx  -std=gnu17 -Werror /usr/src/sys/x86/x86/ucode.c
/usr/src/sys/x86/x86/ucode.c:372:15: error: incompatible integer to pointer conversion passing 'uintptr_t' (aka 'unsigned int') to parameter of type 'void * _Nonnull' [-Wint-conversion]
  372 |         memcpy_early(free, match, len);
      |                      ^~~~
/usr/src/sys/sys/systm.h:290:36: note: passing argument to parameter 'to' here
  290 | void    *memcpy_early(void * _Nonnull to, const void * _Nonnull from, size_t len);
      |                                       ^
1 error generated.
*** [ucode.o] Error code 1

make[2]: stopped making "all" in /usr/obj/usr/src/i386.i386/sys/GENERIC
make[2]: 1 error

make[2]: stopped making "all" in /usr/obj/usr/src/i386.i386/sys/GENERIC
       24.03 real        11.95 user        11.98 sys

% uname -a
FreeBSD a315-53 15.1-RC2 FreeBSD 15.1-RC2 releng/15.1-n283554-1f29a037cbc8 GENERIC i386
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2026-06-10 20:05:57 UTC
*** Bug 295975 has been marked as a duplicate of this bug. ***
Comment 2 Martin Birgmeier 2026-06-13 08:27:04 UTC
Proposed patch:

iff --git a/sys/x86/x86/ucode.c b/sys/x86/x86/ucode.c
index 613a7b03489f..814805888fbd 100644
--- a/sys/x86/x86/ucode.c
+++ b/sys/x86/x86/ucode.c
@@ -369,7 +369,7 @@ map_ucode(const void *match, uintptr_t free, size_t len)
 
        for (va = free; va < free + len; va += PAGE_SIZE)
                pmap_kenter(va, (vm_paddr_t)va);
-       memcpy_early(free, match, len);
+       memcpy_early((void *) free, match, len);
        return ((const void *)free);
 #else
        (void)len;

-- Martin
Comment 3 ota 2026-06-20 01:18:22 UTC
 This fixed the compile error.
Comment 4 Mark Linimon freebsd_committer freebsd_triage 2026-06-20 03:03:52 UTC
^Triage: note the presence of an inline patch.
Comment 5 commit-hook freebsd_committer freebsd_triage 2026-06-22 00:52:02 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=f4cd99131c70e8be2a793d939b644e20bbbd3374

commit f4cd99131c70e8be2a793d939b644e20bbbd3374
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-06-22 00:48:11 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-06-22 00:51:28 +0000

    x86/ucode.c: supposedly fix i386 compilation

    Fixes:      16f21c5af350 ("amd64: there is no reason to copy ucode around in ucode_load_bsp()")
    PR:     295926
    Submitted by:   Martin Birgmeier <d8zNeCFG@aon.at>
    MFC after:      3 days

 sys/x86/x86/ucode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 6 John Baldwin freebsd_committer freebsd_triage 2026-06-22 13:16:12 UTC
Note that i386 kernels are not supported in 15.1 and we don't commit to ensuring they will compile in the future.  In 16.0 (and possibly later in the 15.x branch), support for i386 kernels will be removed completely as announced previously.
Comment 7 commit-hook freebsd_committer freebsd_triage 2026-06-25 00:51:24 UTC
A commit in branch stable/15 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=41e974ab3e7629476fd935551f348d6906fed833

commit 41e974ab3e7629476fd935551f348d6906fed833
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-06-22 00:48:11 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-06-25 00:50:23 +0000

    x86/ucode.c: supposedly fix i386 compilation

    PR:     295926

    (cherry picked from commit f4cd99131c70e8be2a793d939b644e20bbbd3374)

 sys/x86/x86/ucode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)