From patchwork Thu Apr 7 16:12:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Trofimovich X-Patchwork-Id: 52710 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6FDAB3864842 for ; Thu, 7 Apr 2022 16:13:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6FDAB3864842 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1649348005; bh=Wtn4WYxJ98QTJBExmQc7g37HYXEqSsXYqQ5cU8oUrGE=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=UT+IwB5IdinAm2BTZaoLphhSni6wkZbbqBcmAe3bHCVgxBgr2h7eE2hRzyJe+XH5i s/kN+3t4smDhHANe8l67T9WL0Wlhwt7+S030jjIju9So5xUEFC2MH7+OOIaxn5yYFi mZGCbC4fdULt5IN1jKEQXVyYBm8CyoJ+lP9Rh8pg= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by sourceware.org (Postfix) with ESMTPS id 1728E3851C02 for ; Thu, 7 Apr 2022 16:12:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1728E3851C02 Received: by mail-wm1-x330.google.com with SMTP id 2-20020a1c0202000000b0038e9ce3b2a9so45654wmc.2 for ; Thu, 07 Apr 2022 09:12:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Wtn4WYxJ98QTJBExmQc7g37HYXEqSsXYqQ5cU8oUrGE=; b=SVTQzHvdYxiKmYCnRWYzxXOhjx7vItOm+sH3c1uvzeOSx749B6FAWLoZSVkVXP8s6S F+oOb38N2T/jhtPHdCxRW8oSJypR2NDX2i9+FqSN6ZEJQZO9elWHcoSXk/O9YYDbaxx1 +eG1GNB0GfdLtHYDliec8b7MmBpLkNYjEexPiX145FsoN+1yalI+bmlL5dVBHUS2yP9L ztNtCbZvfkpOGsx/7wXLkpzPxpuE+jRw1v65RIjcPpmo0slkjPeiHpa9F6kPGPq4jLoJ DIti27b+rFc7I3qRawUvLxTi8DyFpEh+jg6TjNZYHqgtFEV4epahXRQnes3JdUzf7Ck5 e9dg== X-Gm-Message-State: AOAM533usKCeaJWmnleJdQqVRgOYWifwNmigfzyxmlB3sFR3O/h50gJt aXFiaRbGnjS4xJZ+Z5Mth+w= X-Google-Smtp-Source: ABdhPJwaMrXex2Kq91bt4Sz3lfaukiyU8VthslUxcBf37B3lwIRaUIyL72xTd5Fih/YQI/jSgytJTQ== X-Received: by 2002:a05:600c:1c0e:b0:38c:be20:2990 with SMTP id j14-20020a05600c1c0e00b0038cbe202990mr12609795wms.86.1649347954689; Thu, 07 Apr 2022 09:12:34 -0700 (PDT) Received: from nz.home (host81-147-8-147.range81-147.btcentralplus.com. [81.147.8.147]) by smtp.gmail.com with ESMTPSA id q16-20020adff950000000b00205aa05fa03sm17481313wrr.58.2022.04.07.09.12.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 09:12:34 -0700 (PDT) Received: by nz.home (Postfix, from userid 1000) id 619702B79706D; Thu, 7 Apr 2022 17:12:33 +0100 (BST) To: gcc-patches@gcc.gnu.org Subject: [PATCH] libgcc: IA64: don't compile glibc-based unwinder without libc headers Date: Thu, 7 Apr 2022 17:12:21 +0100 Message-Id: <20220407161221.4139013-1-slyich@gmail.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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: Sergei Trofimovich via Gcc-patches From: Sergei Trofimovich Reply-To: Sergei Trofimovich Cc: Ian Lance Taylor , Sergei Trofimovich Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" From: Sergei Trofimovich In --without-headers mode gcc fails to bootstrap on libgcc as: /build/build/./gcc/xgcc -B/build/build/./gcc/ ... -Dinhibit_libc -c fde-glibc.c ../../../gcc-12-20220403/libgcc/config/ia64/fde-glibc.c:33:10: fatal error: stdlib.h: No such file or directory Most other linux targets are able to build the --without-headers compiler without additional effort. This change adds IA64 to the fold. The change drops part of the code that relies on DYNAMIC glibc section traversal for backtraces. Tested bootstrap of ia64-unknown-linux-gnu with and without libc headers present. libgcc/ * config/ia64/fde-glibc.c: Make a no-op in inhibit_libc mode. --- libgcc/config/ia64/fde-glibc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libgcc/config/ia64/fde-glibc.c b/libgcc/config/ia64/fde-glibc.c index 9caac2bca24..bd74847fa85 100644 --- a/libgcc/config/ia64/fde-glibc.c +++ b/libgcc/config/ia64/fde-glibc.c @@ -22,20 +22,21 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ /* Locate the FDE entry for a given address, using glibc ld.so routines to avoid register/deregister calls at DSO load/unload. */ #ifndef _GNU_SOURCE #define _GNU_SOURCE 1 #endif #include "config.h" +#ifndef inhibit_libc #include #include #include #include "unwind-ia64.h" #if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 2) \ || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && !defined(DT_CONFIG)) # error You need GLIBC 2.2.4 or later on IA-64 Linux #endif @@ -152,10 +153,11 @@ _Unwind_FindTableEntry (void *pc, unw_word *segment_base, unw_word *gp, data.pc = (Elf64_Addr) pc; data.segment_base = segment_base; data.gp = gp; data.ret = NULL; if (dl_iterate_phdr (_Unwind_IteratePhdrCallback, &data) < 0) return NULL; return data.ret; } +#endif