NetBSD Problem Report #61043

From www@netbsd.org  Sun Nov 22 17:39:33 2026
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits)
	 client-signature RSA-PSS (2048 bits))
	(Client CN "mail.netbsd.org", Issuer "YR1" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id A901C1A923B
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 22 Nov 2026 17:39:33 +0000 (UTC)
Message-Id: <20261122173932.5778A1A923D@mollari.NetBSD.org>
Date: Sun, 22 Nov 2026 17:39:32 +0000 (UTC)
From: lightingun@disroot.org
Reply-To: lightingun@disroot.org
To: gnats-bugs@NetBSD.org
Subject: Makefile.efiboot allows user-defined COPTS and CPUFLAGS 
X-Send-Pr-Version: www-1.0
X-From4GNATS: "lightingun@disroot.org via gnats" <gnats-admin@NetBSD.org>

>Number:         61043
>Category:       port-amd64
>Synopsis:       Makefile.efiboot allows user-defined COPTS and CPUFLAGS
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    port-amd64-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Nov 22 17:40:00 +0000 2026
>Last-Modified:  Sun Nov 22 19:35:00 +0000 2026
>Originator:     lg
>Release:        11.0
>Organization:
>Environment:
NetBSD netbsd-vm 11.0_STABLE NetBSD 11.0_STABLE (GENERIC) #0: Tue Nov  3 16:04:49 EST 2026  root@devuan-vm:/root/netbsd/obj/sys/arch/amd64/compile/GENERIC amd64
>Description:
Custom-built images produced by the install-image and live-image targets fail to boot on real hardware when booted via UEFI. During boot, the screen gets filled with memory ranges like 0x... - 0x... . BIOS boot works on both real hardware and in a virtual machine. Official release image boots via UEFI on the same hardware.
mk.conf:
BUILDSEED!= date +%s
COPTS+=-O2
CPUFLAGS+=-march=znver2 -mtune=znver2
MAKEVERBOSE=1
MKAMDGPUFIRMWARE=no
MKATF=no
MKCATPAGES=no
MKCOMPAT=no
MKCTF=no
MKDTB=no
MKDTC=no
MKDTRACE=no
MKGROFF=no
MKHESIOD=no
MKHTML=no
MKIEEEFP=no
MKINFO=no
MKIPFILTER=no
MKISCSI=no
MKKERBEROS=no
MKLDAP=no
MKLLVMRT=no
MKLVM=no
MKMDNS=no
MKNOUVEAUFIRMWARE=yes
MKPF=no
MKPIGZGZIP=yes
MKPOSTFIX=no
MKRADEONFIRMWARE=no
MKSKEY=no
MKUNBOUND=no
MKX11=no
MKXORG_SERVER=no
MKYP=no
MKZFS=no
USE_FORT=yes
USE_PIGZGZIP=yes
USE_SSP=yes
build commands:
./build.sh -U -j4 -m amd64 -a x86_64 -O ../obj -T ../tools -V MAKECONF=/etc/mk.conf tools &&
./build.sh -U -u -j4 -m amd64 -a x86_64 -O ../obj -T ../tools -V MAKECONF=/etc/mk.conf -V MAKEFLAGS="MKXORG_SERVER=no" release &&
./build.sh -U -u -j4 -m amd64 -a x86_64 -O ../obj -T ../tools -V MAKECONF=/etc/mk.conf -V MAKEFLAGS="MKXORG_SERVER=no" live-image
build env: netbsd 11.0 amd64
sources tree: netbsd 11.1 amd64
>How-To-Repeat:
1. download source tree
2. build it as described above
3. write an image to usb stick
4. boot via uefi on real hardware
>Fix:
overriding COPTS and CPUFLAGS in sys/arch/i386/stand/efiboot/Makefile.efiboot solved the problem for me: the image was successfully booted on real hardware.

>Audit-Trail:
From: "Jonathan A. Kollasch" <jakllsch@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/61043 CVS commit: src/sys/arch/i386/stand/efiboot/bootx64
Date: Sun, 22 Nov 2026 19:30:34 +0000

 Module Name:	src
 Committed By:	jakllsch
 Date:		Sun Nov 22 19:30:34 UTC 2026

 Modified Files:
 	src/sys/arch/i386/stand/efiboot/bootx64: Makefile

 Log Message:
 Ignore user specified CFLAGS or COPTS for building bootx64.efi

 Addresses PR 61043.


 To generate a diff of this commit:
 cvs rdiff -u -r1.6 -r1.7 src/sys/arch/i386/stand/efiboot/bootx64/Makefile

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.