From patchwork Mon Jan 31 18:43:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 1586931 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=GaWCP44T; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JncRb1Mf4z9s8s for ; Tue, 1 Feb 2022 05:44:25 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BBBEF389C41B for ; Mon, 31 Jan 2022 18:44:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BBBEF389C41B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1643654662; bh=wGg4mUKVLDX5TtSBopyxmzHpLlGdiDIN82wAfPAELV0=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=GaWCP44THQAuztACBr6hAv77rIN0UFbCvFNyAiytUoj4FL8uaAYAkQ+9rhtJNMHoZ Dv7ZpX3JbgKAJ1Sj2kxOmd+uN7nM7XmmVxZi4VFBI4vhEANN6MqWDEvWMvpr3zrzwd DDc0txe8Dm7ghr8MvxTdGVDNf9vPTXYYfnsimaTw= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 2E9AC3857C77 for ; Mon, 31 Jan 2022 18:43:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2E9AC3857C77 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-613-_pFpDSAXNOqWtfWR0a1WJw-1; Mon, 31 Jan 2022 13:43:38 -0500 X-MC-Unique: _pFpDSAXNOqWtfWR0a1WJw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4B5FA100C666; Mon, 31 Jan 2022 18:43:37 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.125]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D6737105B1EE; Mon, 31 Jan 2022 18:43:36 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.16.1/8.16.1) with ESMTPS id 20VIhX8j3444544 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 31 Jan 2022 19:43:34 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 20VIhWHN3444543; Mon, 31 Jan 2022 19:43:32 +0100 Date: Mon, 31 Jan 2022 19:43:32 +0100 To: Segher Boessenkool , David Edelsohn Subject: [PATCH] rs6000: Fix up build of non-glibc/aix/darwin powerpc* targets [PR104298] Message-ID: <20220131184332.GL2646553@tucnak> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jakub Jelinek via Gcc-patches From: Jakub Jelinek Reply-To: Jakub Jelinek Cc: gcc-patches@gcc.gnu.org Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Hi! As reported by Martin, while David has added OPTION_GLIBC define to aix and Iain to darwin, all the other non-linux targets now fail because rs6000.md macro isn't defined. One possibility is to define this macro in option-defaults.h which on rs6000 targets is included last, then we don't need to define it in aix/darwin headers and for targets using linux.h or linux64.h it will DTRT too. Bootstrapped/regtested on powerpc64le-linux, ok for trunk? The other option is the first 2 hunks + changing the 3 if (!OPTION_GLIBC) FAIL; cases in rs6000.md to e.g. #ifdef OPTION_GLIBC if (!OPTION_GLIBC) #endif FAIL; or to: #ifdef OPTION_GLIBC if (!OPTION_GLIBC) #else if (true) #endif FAIL; (the latter case if Richi wants to push the -Wunreachable-code changes for GCC 13). 2022-01-31 Jakub Jelinek PR target/104298 * config/rs6000/aix.h (OPTION_GLIBC): Remove. * config/rs6000/darwin.h (OPTION_GLIBC): Likewise. * config/rs6000/option-defaults.h (OPTION_GLIBC): Define to 0 if not already defined. Jakub --- gcc/config/rs6000/aix.h.jj 2022-01-26 11:57:58.964388591 +0100 +++ gcc/config/rs6000/aix.h 2022-01-31 10:56:07.679463171 +0100 @@ -23,7 +23,6 @@ #define DEFAULT_ABI ABI_AIX #undef TARGET_AIX #define TARGET_AIX 1 -#define OPTION_GLIBC 0 /* Linux64.h wants to redefine TARGET_AIX based on -m64, but it can't be used in the #if conditional in options-default.h, so provide another macro. */ --- gcc/config/rs6000/darwin.h.jj 2022-01-29 11:11:39.213629460 +0100 +++ gcc/config/rs6000/darwin.h 2022-01-31 10:56:36.466058077 +0100 @@ -34,8 +34,6 @@ #endif #endif -#define OPTION_GLIBC 0 - /* The object file format is Mach-O. */ #define TARGET_OBJECT_FORMAT OBJECT_MACHO --- gcc/config/rs6000/option-defaults.h.jj 2022-01-11 23:11:21.940296477 +0100 +++ gcc/config/rs6000/option-defaults.h 2022-01-31 10:56:58.615746384 +0100 @@ -62,3 +62,7 @@ {"cpu_32", "%{" OPT_ARCH32 ":%{!mcpu=*:-mcpu=%(VALUE)}}" }, \ {"cpu_64", "%{" OPT_ARCH64 ":%{!mcpu=*:-mcpu=%(VALUE)}}" }, \ {"float", "%{!msoft-float:%{!mhard-float:-m%(VALUE)-float}}" } + +#ifndef OPTION_GLIBC +#define OPTION_GLIBC 0 +#endif