From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from hall.aurel32.net (hall.aurel32.net [IPv6:2001:bc8:30d7:100::1]) by sourceware.org (Postfix) with ESMTPS id 558603857C5E for ; Tue, 18 Jan 2022 22:07:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 558603857C5E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=aurel32.net Authentication-Results: sourceware.org; spf=none smtp.mailfrom=aurel32.net DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=aurel32.net ; s=202004.hall; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date: Subject:Cc:To:From:Content-Type:From:Reply-To:Subject:Content-ID: Content-Description:In-Reply-To:References:X-Debbugs-Cc; bh=cvvRYr95ApNmS4BP994C4K1G5oFNXODwjA08bbGvRVc=; b=XZNynP1rsakLp/SXMLuBrnLIbw Yt4RvkmkSL58sT4KIl4Eo9SXn3S0ifulrSxzVskWGhFLfM3uZ/HQyK+AxT3z2ko4yGumtOma7l7X0 SanJYRF6kMddjTKgdU92ZXh654AGDV1W+wR4FeCAMI6lHNpBzFhDclRxta3nRWsaZVJwKLJ5SFHFE iXfc2pBtHII8BddsKZxmhmzpTqNJp+Fwh/eqYwN+G43mM5dfELt24YSI6l+1cZDvEfDbgCpZSeycl /4QoeL5V6wH7hUhu+G3c6JmhU8QncD8D7lUgevFdTzamVPNwxSyPHGCS79dlQz3+iWxD5+Kq/By9X 1yT/vvTg==; Received: from [2a01:e34:ec5d:a741:8a4c:7c4e:dc4c:1787] (helo=ohm.rr44.fr) by hall.aurel32.net with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1n9wdl-00BDfD-7B; Tue, 18 Jan 2022 23:07:45 +0100 Received: from aurel32 by ohm.rr44.fr with local (Exim 4.95) (envelope-from ) id 1n9wdk-007tUJ-Ph; Tue, 18 Jan 2022 23:07:44 +0100 From: Aurelien Jarno To: libc-stable@sourceware.org Cc: "Paul A. Clarke" , Joseph Myers Subject: [COMMITTED 2.33] powerpc: Fix unrecognized instruction errors with recent binutils Date: Tue, 18 Jan 2022 23:07:43 +0100 Message-Id: <20220118220743.1877413-1-aurelien@aurel32.net> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_PASS, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-stable@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-stable mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2022 22:07:47 -0000 From: "Paul A. Clarke" Recent versions of binutils (with commit b25f942e18d6ecd7ec3e2d2e9930eb4f996c258a) stopped preserving "sticky" options across a base `.machine` directive, nullifying the use of passing "-many" through GCC to the assembler. As a result, some instructions which were recognized even under older, more stringent `.machine` directives become unrecognized instructions in that context. In `sysdeps/powerpc/tst-set_ppr.c`, the use of the `mfppr32` extended mnemonic became unrecognized, as the default compilation with GCC for 32bit powerpc adds a `.machine ppc` in the resulting assembly, so the command line option `-Wa,-many` is essentially ignored, and the ISA 2.06 instructions and mnemonics, like `mfppr32`, are unrecognized. The compilation of `sysdeps/powerpc/tst-set_ppr.c` fails with: Error: unrecognized opcode: `mfppr32' Add appropriate `.machine` directives in the assembly to bracket the `mfppr32` instruction. Part of a 2019 fix (commit 9250e6610fdb0f3a6f238d2813e319a41fb7a810) to the above test's Makefile to add `-many` to the compilation when GCC itself stopped passing `-many` to the assember no longer has any effect, so remove that. Reported-by: Joseph Myers (cherry picked from commit ee874f44fd55988808a4a162ef21bfa2cc8dc6f7) --- sysdeps/powerpc/Makefile | 5 ----- sysdeps/powerpc/tst-set_ppr.c | 3 ++- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/sysdeps/powerpc/Makefile b/sysdeps/powerpc/Makefile index d1c71a0ca4..06491b0ef6 100644 --- a/sysdeps/powerpc/Makefile +++ b/sysdeps/powerpc/Makefile @@ -62,11 +62,6 @@ ifeq ($(subdir),misc) sysdep_headers += sys/platform/ppc.h tests += test-gettimebase tests += tst-set_ppr - -# This test is expected to run and exit with EXIT_UNSUPPORTED on -# processors that do not implement the Power ISA 2.06 or greater. -# But the test makes use of instructions from Power ISA 2.06 and 2.07. -CFLAGS-tst-set_ppr.c += -Wa,-many endif ifeq ($(subdir),wcsmbs) diff --git a/sysdeps/powerpc/tst-set_ppr.c b/sysdeps/powerpc/tst-set_ppr.c index 7684f5d6ea..e80da15320 100644 --- a/sysdeps/powerpc/tst-set_ppr.c +++ b/sysdeps/powerpc/tst-set_ppr.c @@ -44,7 +44,8 @@ get_thread_priority (void) { /* Read the PPR. */ ppr_t ppr; - asm volatile (MFPPR" %0" : "=r"(ppr)); + asm volatile (".machine push; .machine power7; "MFPPR" %0; .machine pop" + : "=r"(ppr)); /* Return the thread priority value. */ return EXTRACT_THREAD_PRIORITY (ppr); } -- 2.34.1