From nobody Sun Nov 2 03:03:57 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1743183442; cv=none; d=zohomail.com; s=zohoarc; b=fCI9wbuvb3otqh2V1SWwL6hs9WlyiBfWEyfR7Vw45+YD7y0ob0tNtRsWKnYL7fMHsrcv5zF9c2/6F7idaFbkyGJbvCLT3jR1bC+F9dq4g46SaXdiIQl68l4VGGsL5Aoiqk1VfHK3M+tbEjp3yxqrNyYlUQ9puva9+70MiFspVjc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1743183442; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Eb510Sz4jwK6HudhekiqhzPdrg8Izlk7/h2Nnn+atMM=; b=kf4SFVhdM+CkkDHexev4mA+QcMn3gjI1mpqs0PeVb6eUOEo6WpK9aNRNXzh/4ihdZ/1SO462rExhbop0j17P2e8Pjn2ICAYKeuTeeOL2fClyy6Ggvp5lwHAJjpmKAmtl0YzKwpU9MbkODjY2Md1tZBFls5U9cFrkDnZHGuvOL/s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1743183442121718.3876043264601; Fri, 28 Mar 2025 10:37:22 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.931041.1333529 (Exim 4.92) (envelope-from ) id 1tyDdK-00049g-MI; Fri, 28 Mar 2025 17:36:42 +0000 Received: by outflank-mailman (output) from mailman id 931041.1333529; Fri, 28 Mar 2025 17:36:42 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tyDdK-00049W-JY; Fri, 28 Mar 2025 17:36:42 +0000 Received: by outflank-mailman (input) for mailman id 931041; Fri, 28 Mar 2025 17:36:42 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tyDdK-0003ug-4y for xen-devel@lists.xenproject.org; Fri, 28 Mar 2025 17:36:42 +0000 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [2a00:1450:4864:20::32c]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 351f0710-0bfb-11f0-9ffa-bf95429c2676; Fri, 28 Mar 2025 18:36:40 +0100 (CET) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-43ce70f9afbso25094825e9.0 for ; Fri, 28 Mar 2025 10:36:40 -0700 (PDT) Received: from localhost.localdomain (host-92-26-98-202.as13285.net. [92.26.98.202]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43d82efdff2sm77485715e9.17.2025.03.28.10.36.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Mar 2025 10:36:39 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 351f0710-0bfb-11f0-9ffa-bf95429c2676 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1743183400; x=1743788200; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Eb510Sz4jwK6HudhekiqhzPdrg8Izlk7/h2Nnn+atMM=; b=KC8i2+hc80+auIYgfXNfHgXtpYA1ZWdtp+hUjqByHNK7RPNZhSUPgRmwxtE+XMgYuC rMr/VkO3q07rdemKQ5xCUAsAlCFaVGMTJONyc/srf7gz9i68iHSFA2x1MC0/u1BBsGe2 3uqua2MkZqQ48tfeEOQKk77Rp1TGZd45Q1ySk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743183400; x=1743788200; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Eb510Sz4jwK6HudhekiqhzPdrg8Izlk7/h2Nnn+atMM=; b=n3hwPRJBpbmJ3aeTQizN9d9KBJE5C1x9qLuXeflQ0UJVCyHRi4dEnBlM1jhXqkiXkq +2CCDJ6r9UOaIzDZaU9YVR00ylpr3MIU1bZATp0wBIHqFyZ0wH/AwbxZAHCNfawDi5hE O6XRyW0ZEDd7iM9q7bO3zA0J6kuXdl/yuMkbeXA3SUwTRRmdY+ISFfm2aNVVZceY2Q7O 8E9886xC66alW/fA+jBz5oAPFBZTG7OFHaVjhTonYDpFMA3BTV341jky9c0CSaDcz3QG S0D2mnG6V6Lla91Tw7ig6zp7p0NJHo00bVzt5Xtq5OFan7ayShV6RXAPxsv4W4C7KVGO Gq7w== X-Gm-Message-State: AOJu0YxOiFuyVEu00b01LNyGeelVUppadl2e+KAomxFMkkecj1BgFqXS kTrcjZn2WhdUYK8F8H/mo3cmNrUItPRorPPhp4/HCZ2YR+XujYJUSj40frat8ij9Q2LuWezjMri +u0k= X-Gm-Gg: ASbGncvP8FUUPq5OBu2i5g8AqmCols4SmPcAd8FU4NjDivVfRkH+1I3VIARD1gkOR5C pjd23dHG3KJU5liLsW2qFySE8HFquKH+fT+qWd1Z+ouU4GBdPv2CbPEFCI2BSjCDawsPimEWTTr vwEDKRIi9AExKKLnyZTbGPyXauBi0kDP9rS4eMcJ9iou7WmMTh7veKu5tc926yCMh73INK6J5/y gdnrJ4DUtiyvjraJ6SeheIJmE3XKxMVdHDiogGIQszG1MzQ8jFSKCJeyw2WaqogCyKjx2NsycS/ 81g7TJHeIsmztGu3xSmaxFWpp+glOWToH7lBbGk/GgLfGE8qSr55o8mIAt64BQ1+ufgICfdqbhf iWbhZNDic+i2Q9waNo9ld+kVC3ne9 X-Google-Smtp-Source: AGHT+IFsu51n6ocw5x63uB2WGAgmrS1OWXdzA8DKortXtjEkphBT7d7yn+VjCKbypxqJv2Uo+/S+pA== X-Received: by 2002:a05:600c:c0f:b0:43d:b51:46fb with SMTP id 5b1f17b1804b1-43db61d8dd7mr3689055e9.2.1743183399691; Fri, 28 Mar 2025 10:36:39 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Jan Beulich , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [PATCH] x86emul: Fix blowfish build in 64bit-clean environments Date: Fri, 28 Mar 2025 17:36:37 +0000 Message-Id: <20250328173637.892960-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1743183443435019000 In a 64bit-clean environment, blowfish fails: make[6]: Leaving directory '/builddir/build/BUILD/xen-4.19.1/tools/tests/x86_emulator' In file included from /usr/include/features.h:535, from /usr/include/bits/libc-header-start.h:33, from /usr/include/stdint.h:26, from /usr/lib/gcc/x86_64-xenserver-linux/12/include/stdint.h:9, from blowfish.c:18: /usr/include/gnu/stubs.h:7:11: fatal error: gnu/stubs-32.h: No such file or directory 7 | # include | ^~~~~~~~~~~~~~~~ compilation terminated. make[6]: *** [testcase.mk:15: blowfish.bin] Error 1 because of lack of glibc-i386-devel or equivelent. It's non-fatal, but reduces the content in test_x86_emulator, which we do care about running. Instead, convert all emulator testcases to being freestanding builds, resui= ng the tools/firmware/include/ headers. This in turn requires making firmware's stdint.h compatible with 64bit buil= ds. We now have compiler types for every standard type we use. Suggested-by: Jan Beulich Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 --- tools/firmware/include/stdint.h | 27 ++++++++++----------------- tools/tests/x86_emulator/testcase.mk | 3 ++- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/tools/firmware/include/stdint.h b/tools/firmware/include/stdin= t.h index 16a0b6de19c2..5c41cb8bdafc 100644 --- a/tools/firmware/include/stdint.h +++ b/tools/firmware/include/stdint.h @@ -1,21 +1,14 @@ #ifndef _STDINT_H_ #define _STDINT_H_ =20 -#if defined(__LP64__) || defined(__P64__) -#error "32bit only header" -#endif - -typedef unsigned char uint8_t; -typedef signed char int8_t; - -typedef unsigned short uint16_t; -typedef signed short int16_t; - -typedef unsigned int uint32_t; -typedef signed int int32_t; - -typedef unsigned long long uint64_t; -typedef signed long long int64_t; +typedef __INT8_TYPE__ int8_t; +typedef __UINT8_TYPE__ uint8_t; +typedef __INT16_TYPE__ int16_t; +typedef __UINT16_TYPE__ uint16_t; +typedef __INT32_TYPE__ int32_t; +typedef __UINT32_TYPE__ uint32_t; +typedef __INT64_TYPE__ int64_t; +typedef __UINT64_TYPE__ uint64_t; =20 #define INT8_MIN (-0x7f-1) #define INT16_MIN (-0x7fff-1) @@ -32,8 +25,8 @@ typedef signed long long int64_t; #define UINT32_MAX 0xffffffffu #define UINT64_MAX 0xffffffffffffffffull =20 -typedef uint32_t uintptr_t; +typedef __UINTPTR_TYPE__ uintptr_t; =20 -#define UINTPTR_MAX UINT32_MAX +#define UINTPTR_MAX __UINTPTR_MAX__ =20 #endif diff --git a/tools/tests/x86_emulator/testcase.mk b/tools/tests/x86_emulato= r/testcase.mk index 7875b95d7c97..e47fd0917b54 100644 --- a/tools/tests/x86_emulator/testcase.mk +++ b/tools/tests/x86_emulator/testcase.mk @@ -4,7 +4,8 @@ include $(XEN_ROOT)/tools/Rules.mk =20 $(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS)) =20 -CFLAGS +=3D -fno-builtin -fno-stack-protector -g0 $($(TESTCASE)-cflags) +CFLAGS +=3D -ffreestanding -nostdinc -I$(XEN_ROOT)/tools/firmware/include +CFLAGS +=3D -fno-stack-protector -g0 $($(TESTCASE)-cflags) =20 LDFLAGS_DIRECT +=3D $(shell { $(LD) -v --warn-rwx-segments; } >/dev/null 2= >&1 && echo --no-warn-rwx-segments) =20 --=20 2.39.5