NetBSD Problem Report #60519
From www@netbsd.org Thu Jul 30 17:35:55 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) server-digest SHA256
client-signature RSA-PSS (2048 bits) client-digest SHA256)
(Client CN "mail.netbsd.org", Issuer "YR2" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id A0F351A923B
for <gnats-bugs@gnats.NetBSD.org>; Thu, 30 Jul 2026 17:35:55 +0000 (UTC)
Message-Id: <20260730173554.5CC411A923C@mollari.NetBSD.org>
Date: Thu, 30 Jul 2026 17:35:54 +0000 (UTC)
From: netbsd-gnats@supposedly.org
Reply-To: netbsd-gnats@supposedly.org
To: gnats-bugs@NetBSD.org
Subject: netbsd-11 fails to build with -march=native for modern processors (x86)
X-Send-Pr-Version: www-1.0
X-From4GNATS: "netbsd-gnats@supposedly.org via gnats" <gnats-admin@NetBSD.org>
>Number: 60519
>Category: port-amd64
>Synopsis: netbsd-11 fails to build with -march=native for modern processors (x86)
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: port-amd64-maintainer
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Jul 30 17:40:00 +0000 2026
>Originator: William Green
>Release: netbsd-11
>Organization:
>Environment:
NetBSD aaa.supposedly.org 11.0_RC7 NetBSD 11.0_RC7 (GENERIC) #0: Thu Jul 23 17:23:58 PPT 2026 aaa@aaa.supposedly.org:/home/aaa/src/netbsd11/obj/sys/arch/amd64/compile/GENERIC amd64
>Description:
`/build.sh build` with -march=native (see more on cpu-type below) fails while building OpenSSH in crypto/external/bsd/openssh/dist/kexmlkem768x25519.c. Building on Linux with -m amd64 -V "CPUFLAGS= -march=skylake" (etc.) also fails.
Trying to manually compile this file with the same options used by build.sh gives this error:
In file included from /home/aaa/src/netbsd11/src/crypto/external/bsd/openssh/dist/kexmlkem768x25519.c:46: /home/aaa/src/netbsd11/src/crypto/external/bsd/openssh/dist/libcrux_mlkem768_sha3.h: In function 'libcrux_ml_kem_ind_cpa_unpacked_default_8b_1b': /home/aaa/src/netbsd11/src/crypto/external/bsd/openssh/dist/libcrux_mlkem768_sha3.h:8112:11: error: array subscript '<unnamed-unsigned:256>[0]' is partly outside array bounds of 'uint8_t[2]' {aka 'unsigned char[2]'} [-Werror=array-bounds] 8112 | uint8_t uu____1[32U] = {0U};
| ^~~~~~~
cc1: all warnings being treated as errors
Trying various values for -march showed this occurs on GCC cpu-types that enable AVX (i.e. this error is generated with -march=sandybridge but not -march=nehalem and ditto for bdver1/barcelona).
Compiling with the base system gcc on 11.0_RC7 (i.e. 12.5.0) instead of the build.sh-built tooldir gcc gives the same error. However gcc15 from pkgsrc compiles without error/warning.
>How-To-Repeat:
Build netbsd-11 sources with CPUFLAGS= -march=sandybridge (or any cpu-type that enables AVX).
>Fix:
Unknown
(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.