From nobody Mon Jul 12 18:36:20 2021 X-Original-To: toolchain@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 195D01271FD7 for ; Mon, 12 Jul 2021 18:36:20 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GNssw04yPz3HqW for ; Mon, 12 Jul 2021 18:36:20 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CFC7F13C44 for ; Mon, 12 Jul 2021 18:36:19 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 16CIaJRm030665 for ; Mon, 12 Jul 2021 18:36:19 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 16CIaJSI030664 for toolchain@FreeBSD.org; Mon, 12 Jul 2021 18:36:19 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: toolchain@FreeBSD.org Subject: [Bug 257132] clang 12.0.1 fails to cross-compile kern_mbuf - amd64 host, i386 target Date: Mon, 12 Jul 2021 18:36:20 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: dim@FreeBSD.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: toolchain@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Maintenance List-Archive: https://lists.freebsd.org/archives/freebsd-toolchain List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-toolchain@freebsd.org X-BeenThere: freebsd-toolchain@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D257132 --- Comment #3 from Dimitry Andric --- It turns out that this is due some code generated in $OBJDIR/offset.inc, du= ring an amd64 to i386 cross-build: # 33 "/usr/src/sys/sys/kpilite.h" # 1 "./offset.inc" 1 #ifndef _OFFSET_INC_ #define _OFFSET_INC_ #if 0 /* disabled by -frewrite-includes */ #if !defined(GENOFFSET) && (!defined(KLD_MODULE) || defined(KLD_TIED)) #endif #endif /* disabled by -frewrite-includes */ #if 1 /* evaluated by -frewrite-includes */ # 4 "./offset.inc" struct thread_lite { u_char pad_td_priority[0x27e - 0]; u_char td_priority; u_char pad_td_critnest[0x30c - (0x27e + sizeof(u_char))]; u_int td_critnest; u_char pad_td_owepreempt[0xb8 - (0x30c + sizeof(u_int))]; u_char td_owepreempt; u_char pad_td_pinned[0xd8 - (0xb8 + sizeof(u_char))]; int td_pinned; }; #endif E.g. this defines tpad_td_owepreempt as a negative size: 27: error: array is too large (18446744073709551016 elements) u_char pad_td_owepreempt[0xb8 - (0x30c + sizeof(u_int))]; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ For some reason, generating this offset.inc file on a native i386 build res= ults in a very different struct: struct thread_lite { u_char pad_td_owepreempt[0xb8 - 0]; u_char td_owepreempt; u_char pad_td_pinned[0xd8 - (0xb8 + sizeof(u_char))]; int td_pinned; u_char pad_td_priority[0x27e - (0xd8 + sizeof(int))]; u_char td_priority; u_char pad_td_critnest[0x30c - (0x27e + sizeof(u_char))]; u_int td_critnest; }; --=20 You are receiving this mail because: You are the assignee for the bug.=