Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0669C07E95 for ; Wed, 7 Jul 2021 07:36:43 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 068D761CB3 for ; Wed, 7 Jul 2021 07:36:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 068D761CB3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 718F382DC7; Wed, 7 Jul 2021 09:36:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="KUdJj0QA"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2A6DC82DD3; Wed, 7 Jul 2021 09:36:39 +0200 (CEST) Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 640E482C81 for ; Wed, 7 Jul 2021 09:36:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-pg1-x52e.google.com with SMTP id u14so1314846pga.11 for ; Wed, 07 Jul 2021 00:36:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/3Xlxuz16frAihhTQsf9cZ1ZxmZEsOfD3AD7y3ILUdo=; b=KUdJj0QAWW2T8w64eDzxx9QZb3hddxlJ3u2o4ZTHuIfaEOhPxzw6OMX5BPo+qFKZqy 30xriURW4g5joX71xcthUldELqBbabIlg0K2pbZhh3On1MYJ4Nn3gTFcaqbZuy5sLNJb 310lLuIgR9FOcr2Hcd0HNAh8l3nXIS+39amRh7ux2bOnAUy2jlY3iEQRstWdUBTH38Z5 EjxIcrtD5/8sfkBTfLvbSYIHqRkeWD5OHuE8XXQHeAwXEJObv+agxkgIaKKQDzhMKJo1 Z6OdKfcIHc57s5yWnlLEClFwxfM7BR2fEhnwpJdB/LvE3HmB76XDrLXfFLY7Tht+NkR+ 2fLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/3Xlxuz16frAihhTQsf9cZ1ZxmZEsOfD3AD7y3ILUdo=; b=RI01D1ectDupW27cAVs7DWd13sPEKmRb6x/u8aYRy3DePObcCfY55wUzXzkZbdnLDg SP9Y4aPo/UpyxkvGSalMRt2gE0bTTj8iYlaXXV2XJuQ3FMbBPGYqJEZmjdoUfcSxvLXB Et89r6mf/qL6bBlMOwbXi1ppr/sjyRgSPuOAQyTXvSq5q3Ril44j8BvRc8iy2+9pUpGN uSaIc9Q0AL1HPZGvhlVP+odsoibZjiAafzcYBmE6yx9wWoiel59M06sMNUMkLH6ZzUnC o5mPHEn9RZ2QpFHe3qFoHCli37jnz16/FRylvh2S8ajJV4T9NUn9STSzMRpZbzSFLs8S 23tg== X-Gm-Message-State: AOAM530+BcxMicoRoFXyUN3cYbjuNLpNj2VYTXJdRo9LWf+SdfcM4HLN /vYc8u8dzC4nctUyIHCsBds= X-Google-Smtp-Source: ABdhPJyMENqaHVd/vXtLZHEld4XiQr7wjeYYRFjqPK+k4+C/pDs0BpthhvYl5AXuAMjtpAZNHv5eEA== X-Received: by 2002:aa7:8489:0:b029:2fb:4ce0:339c with SMTP id u9-20020aa784890000b02902fb4ce0339cmr24266785pfn.16.1625643394712; Wed, 07 Jul 2021 00:36:34 -0700 (PDT) Received: from i9-aorus-gtx1080.localdomain (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id c141sm7027491pfc.13.2021.07.07.00.36.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jul 2021 00:36:34 -0700 (PDT) From: Bin Meng To: Simon Glass , u-boot@lists.denx.de Cc: Bin Meng Subject: [PATCH] x86: Drop _X86EMU_env definition when CONFIG_BIOSEMU is used Date: Wed, 7 Jul 2021 15:36:26 +0800 Message-Id: <20210707073626.1743-1-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean With x86 we can execute an option ROM either natively or using the x86 emulator (if enabled with CONFIG_BIOSEMU). Both of these share the _X86EMU_env variable, with the native code using it to hold register state during interrupt processing. At present, in 32-bit U-Boot, the variable is declared twice, once in common code and once in code only compiled with CONFIG_BIOSEMU. With GCC 11 this causes a 'multiple definitions' error on boards with CONFIG_BIOSEMU. Drop the emulator definition when CONFIG_BIOSEMU is used. Signed-off-by: Bin Meng --- arch/x86/lib/bios.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/lib/bios.c b/arch/x86/lib/bios.c index fbdc3b04e3..98cc05de2e 100644 --- a/arch/x86/lib/bios.c +++ b/arch/x86/lib/bios.c @@ -23,7 +23,9 @@ static int (*int_handler[256])(void); /* to have a common register file for interrupt handlers */ +#ifndef CONFIG_BIOSEMU X86EMU_sysEnv _X86EMU_env; +#endif asmlinkage void (*realmode_call)(u32 addr, u32 eax, u32 ebx, u32 ecx, u32 edx, u32 esi, u32 edi); -- 2.25.1