From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1kkhpw-0007c9-2f for mharc-grub-devel@gnu.org; Thu, 03 Dec 2020 01:11:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41730) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkhpv-0007by-6H for grub-devel@gnu.org; Thu, 03 Dec 2020 01:11:27 -0500 Received: from mail-lj1-x235.google.com ([2a00:1450:4864:20::235]:45000) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kkhpt-00046n-4V for grub-devel@gnu.org; Thu, 03 Dec 2020 01:11:26 -0500 Received: by mail-lj1-x235.google.com with SMTP id s9so1206609ljo.11 for ; Wed, 02 Dec 2020 22:11:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficientek-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=VR5CM7bobXg2f4ZgLnYgt6xLviCJv3oT7rOoN3LvmBg=; b=fB9C/WrorynQY7D+jEFAgZRggSwNYhXyxyQQat55d1EG34BwUHudmpIZRiGf90aEvi iRsd1gi5WPEcP+73eXK7hxKJtbyM3knsrwoxnLVbCZcq+aq7rPlyaYVgeBZW8lh7ZqBp UcIvF40fY6/AKv6vCOYOD1f559FCXjIrGDOBPtqLLhJ5rAE7v+S/LCZpfq1PFAY/iBiQ QJXvKridTYbAJ/9OCa4xKDRd0NTBWUeMayqnxAw1pHWyLMA7TiYlQ9HXL6eHWlBBXfTD agMSHpqL2W4WLb1yP5Zp+x/wa6DTmBi5kHDyCAtx+dYx/MYHJB/4vn7Z2uRJwBHbyJQN z/kQ== 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=VR5CM7bobXg2f4ZgLnYgt6xLviCJv3oT7rOoN3LvmBg=; b=K+ywwTxNiqxEiF3049ZKzGSb0CCdnDvqTd3l52jLMBPLRzn4/9yOw1OV+J6EE+Z02n wJC0/1UuQADy2FBFAUttgsKSprfooV3jVPHDAl0yd7XlQdt5j3Spn+Qi7jTSKUBE20Od H3wVx5/VWH+IhW8dkeVXjrCzTfKfoRlWsiQCmliLBaZLJqteUIAkIfSN2yC6Wt02lT+P MyP13S/QnQk85HokfXJBG2GLINwHYikpOe4maXbTf1mpWMoTOBs26IWV2PjYbbEuqwfW h6X6AOgobCCdczMYBf+TcEAoaKDOhLbUP7Vq9UdvkPbbQysDgiyO5vGYJziF2WFW1kV/ KzFw== X-Gm-Message-State: AOAM530maEWLiEhcBBv8SClZfPuS47UrTiD+c9YeJltVYQEEcavZ2VSC ywKEUnAGf4JXgSVQ3Q/ZIPdbUQdMzB6frg== X-Google-Smtp-Source: ABdhPJwpIw4ePf3yaxfRmbxP4doWUG0OzTZ+CJKB77hu+MFk1K//zAVHpiv8s60wQLVQ1fP1n7SVsw== X-Received: by 2002:a2e:97c1:: with SMTP id m1mr625151ljj.278.1606975881799; Wed, 02 Dec 2020 22:11:21 -0800 (PST) Received: from localhost.localdomain ([136.49.211.192]) by smtp.gmail.com with ESMTPSA id v17sm115255lfa.81.2020.12.02.22.11.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2020 22:11:21 -0800 (PST) From: Glenn Washburn To: grub-devel@gnu.org Cc: Daniel Kiper , Glenn Washburn Subject: [PATCH] arm-coreboot: Declare global struct ps2_state as static so symbols don't cause link failure Date: Thu, 3 Dec 2020 00:10:26 -0600 Message-Id: <20201203061026.3976080-1-development@efficientek.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::235; envelope-from=development@efficientek.com; helo=mail-lj1-x235.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2020 06:11:27 -0000 This appears to be a new issue surfaced by switching from gcc 9.3.0 to 10.1.0 cross compiling toolchain. When linking these two object files together, there is an error generated: "multiple definition of `ps2_state'". This only appears to be an issue when --target=arm-linux-gnueabi and --with-platform=coreboot. There's no need for these structs to have global as opposed to file scope, so declaring them as static fixes this issue. Signed-off-by: Glenn Washburn --- grub-core/term/arm/cros.c | 2 +- grub-core/term/arm/pl050.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-core/term/arm/cros.c b/grub-core/term/arm/cros.c index 1ff9f8ccf..a17e49c32 100644 --- a/grub-core/term/arm/cros.c +++ b/grub-core/term/arm/cros.c @@ -30,7 +30,7 @@ #include #include -struct grub_ps2_state ps2_state; +static struct grub_ps2_state ps2_state; struct grub_cros_ec_keyscan old_scan; diff --git a/grub-core/term/arm/pl050.c b/grub-core/term/arm/pl050.c index e4cda3056..b082243b0 100644 --- a/grub-core/term/arm/pl050.c +++ b/grub-core/term/arm/pl050.c @@ -29,7 +29,7 @@ static volatile grub_uint32_t *pl050_regs; -struct grub_ps2_state ps2_state; +static struct grub_ps2_state ps2_state; static void keyboard_controller_wait_until_ready (void) -- 2.27.0