From patchwork Sun Aug 13 03:09:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Karim Taha X-Patchwork-Id: 1820682 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=OGMIl44F; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RNzyg1gbsz1yf6 for ; Mon, 14 Aug 2023 00:13:15 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qVBpG-00080Y-SC; Sun, 13 Aug 2023 10:12:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qVBpF-0007zu-BL for qemu-devel@nongnu.org; Sun, 13 Aug 2023 10:12:13 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qVBpD-0000mh-Bk for qemu-devel@nongnu.org; Sun, 13 Aug 2023 10:12:13 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-318015ade49so3234390f8f.0 for ; Sun, 13 Aug 2023 07:12:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691935929; x=1692540729; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BL3xjDJvjzEgMaYToYQ6Bx56p2LIHs2TtBVlnMHlDaw=; b=OGMIl44FYsUlcHjbeu7cfznZbvmKT5d6jXpQEltrhvfGt+Pw8DWvmejNq1WFiS5tcO JdJvPa31uBHDqRFN09In+RF5eUF0CbHCKplurKmw6t4kSBGZYEPafoaVn1gqLoKw1kLf oFm0l39WCytBNPmTDbHl7l9uty1SuUPad49FDceNwOOVJUYLgxXQE2J4XE2nla/d/ixG 3qnBNi24pBnPwS0EamterCEQvHrKvSgUS4c9ZD/m5Z8+KclE5kDB6cqfF6veihEYiLZ9 XVWii9xwJoofHzbaADG9Y7/R2+HtmdX1/5yFblWxZixKKHXcZeXd2tphFI3dxjWn5LLp gNPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691935929; x=1692540729; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BL3xjDJvjzEgMaYToYQ6Bx56p2LIHs2TtBVlnMHlDaw=; b=iGuYFC8cof5IMbKDeY5OpsgI5voS6XeLdkNYR950Ab3VvxjeojByKUpDEcCQmq4MZf MSjnD1pN0dcnts9AWMYaKXnsY7ImLW+FCpVu0Wwf1yMJik95Z2mZ2QBkiKnMcqDRzRSv KdFL6C/6Rn9aunne0K0TgpQ0PwG/8PXj6U9G/woJ02v/1XI7snecayB+009uexYhEIU9 ikaIyUllilfXeRyvZ7Gy8eyf0Yq8BWYbFXUW12yWsmWIRi1iLBkB+qGZLu9oGONdMXWZ Pg13FNtmlyE7FfdUrVHXx5b4ngssRgdMboW2MCiAv5XgVwJscgcrWVBMUnvypg7jPuRd 8w5g== X-Gm-Message-State: AOJu0YzHAFN/NqaGFjxjugBnHp/3RibomxLtzLrfRge0/cYMbdx+98sp Am2bic+be3+Sp21m0EPjSWBbkujwj8U= X-Google-Smtp-Source: AGHT+IFLzafRNGkwyVjblyp6UlDWeWNjOj1sxzamPt0DHR6yIeQo/7ms37aP8fdq+v2GG+GW9UeuyA== X-Received: by 2002:a5d:40ce:0:b0:30e:19a8:4b0a with SMTP id b14-20020a5d40ce000000b0030e19a84b0amr5327511wrq.2.1691935929470; Sun, 13 Aug 2023 07:12:09 -0700 (PDT) Received: from karim.my.domain ([197.39.204.50]) by smtp.gmail.com with ESMTPSA id l18-20020a5d4112000000b003144b95e1ecsm11409101wrp.93.2023.08.13.07.12.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Aug 2023 07:12:09 -0700 (PDT) From: Karim Taha To: qemu-devel@nongnu.org Cc: imp@bsdimp.com, Karim Taha , Richard Henderson Subject: [PATCH v2 01/32] Move _WANT_FREEBSD macros to include/qemu/osdep.h Date: Sun, 13 Aug 2023 05:09:42 +0200 Message-Id: <20230813031013.1743-2-kariem.taha2.7@gmail.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230813031013.1743-1-kariem.taha2.7@gmail.com> References: <20230813031013.1743-1-kariem.taha2.7@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=kariem.taha2.7@gmail.com; helo=mail-wr1-x42e.google.com X-Spam_score_int: -2 X-Spam_score: -0.3 X-Spam_bar: / X-Spam_report: (-0.3 / 5.0 requ) BAYES_00=-1.9, DATE_IN_PAST_06_12=1.543, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Warner Losh move _WANT_FREEBSD macros from bsd-user/freebsd/os-syscall.c to include/qemu/osdep.h in order to pull some struct defintions needed later in the build. Signed-off-by: Warner Losh Signed-off-by: Karim Taha Acked-by: Richard Henderson --- bsd-user/freebsd/os-syscall.c | 11 ----------- include/qemu/osdep.h | 13 +++++++++++++ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c index de36c4b71c..2224a280ea 100644 --- a/bsd-user/freebsd/os-syscall.c +++ b/bsd-user/freebsd/os-syscall.c @@ -17,17 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ - -/* - * We need the FreeBSD "legacy" definitions. Rust needs the FreeBSD 11 system - * calls since it doesn't use libc at all, so we have to emulate that despite - * FreeBSD 11 being EOL'd. - */ -#define _WANT_FREEBSD11_STAT -#define _WANT_FREEBSD11_STATFS -#define _WANT_FREEBSD11_DIRENT -#define _WANT_KERNEL_ERRNO -#define _WANT_SEMUN #include "qemu/osdep.h" #include "qemu/cutils.h" #include "qemu/path.h" diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index cc61b00ba9..1ca94ad3de 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -88,6 +88,19 @@ QEMU_EXTERN_C int daemon(int, int); #define __USE_MINGW_ANSI_STDIO 1 #endif +/* + * We need the FreeBSD "legacy" definitions. Rust needs the FreeBSD 11 system + * calls since it doesn't use libc at all, so we have to emulate that despite + * FreeBSD 11 being EOL'd. + */ +#ifdef __FreeBSD__ +#define _WANT_FREEBSD11_STAT +#define _WANT_FREEBSD11_STATFS +#define _WANT_FREEBSD11_DIRENT +#define _WANT_KERNEL_ERRNO +#define _WANT_SEMUN +#endif + #include #include #include