From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by sourceware.org (Postfix) with ESMTPS id 768E53858402 for ; Tue, 28 Sep 2021 11:26:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 768E53858402 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-wr1-x435.google.com with SMTP id i23so57498889wrb.2 for ; Tue, 28 Sep 2021 04:26:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ick6XfwV5z42PV7jUKzCDgm/p3Id3UIOXCh8EJ7Bp40=; b=T1XkP0a3NvnJSWLMQPiyl6vQcUROscObqDiZNZDq9tX+ams6gVWweLRkqzkX5ocHEk 6vn1xbeiG/wTNMH433qPvmLJ6vJH2c7VQOVvXOOrS3ST6REMhGv3ndIcW3suzFyhENGS AhGA4t2ijfH2awxk4uyuP02/id7YUmrJmNFNXZUUV4j34kCB+iBMsro7OraJ5Qw0uIRk Ywx43ad3nQmZkPaFrOTJWgM1zEUOhYn7kSrxzPOy71CoXx5cglUMtJq3JL8nBL7grr0c d+Qc524uWfGkuU8dBoq7u3mUqLQVS5Zcby3rj1pF6bWZBrCL/ndaU0rIluG7wvSpRUPH W6Ew== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=ick6XfwV5z42PV7jUKzCDgm/p3Id3UIOXCh8EJ7Bp40=; b=11Daf50Q6NwC3aX931IBHEu/QleVwBL3G4YajaoE2yajToIxDTK5clgSd7ZQrIr/Fm ZB9DRVhsj2DHMbwzlH8xVKgOAJbB7VYRMKivv8R0bnTEjazs7Rsehb/MWcko3n49m49q MXaY/cu7uRyHe0rHE5qUg9ZEtfnCbcPV8AiCALEfkLM5jOB63OqLTqIblp/VtlTiE1Jd 7Dl33wUU3i4MGIqR2OHtGuNz+5jt8X6oW+TBieh0mXcvVspvGQfnq7OpC/+nKm5P56QR liGPtN3OMz90GjbhO4Mj421tRBU1bPKWjIIMzPcKuXykMVPpn50PMzoRcfLQPu5KHcq6 Ip7A== X-Gm-Message-State: AOAM531YMr9SkcXZgsEyfg/npXLKDOUAWhYX2+SLrHA0meAOj47V3Enz UiKK6/gZdDDOZcHKBRSPhg58DbkDx6x7XQ== X-Google-Smtp-Source: ABdhPJxJIbHwEew2n22l0OHCXWG1SxMCdsTvVRnWYu5CEFlDBPrfAsXC6lsYaN41UJ9CoH4ApKS+YQ== X-Received: by 2002:a5d:400b:: with SMTP id n11mr5819988wrp.317.1632828389383; Tue, 28 Sep 2021 04:26:29 -0700 (PDT) Received: from localhost (host86-169-137-11.range86-169.btcentralplus.com. [86.169.137.11]) by smtp.gmail.com with ESMTPSA id f1sm20970320wri.43.2021.09.28.04.26.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Sep 2021 04:26:29 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Subject: [PUSHED 1/6] top-level configure: setup target_configdirs based on repository Date: Tue, 28 Sep 2021 12:26:19 +0100 Message-Id: X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2021 11:26:33 -0000 The top-level configure script is shared between the gcc repository and the binutils-gdb repository. The target_configdirs variable in the configure.ac script, defines sub-directories that contain components that should be built for the target using the target tools. Some components, e.g. zlib, are built as both host and target libraries. This causes problems for binutils-gdb. If we run 'make all' in the binutils-gdb repository we end up trying to build a target version of the zlib library, which requires the target compiler be available. Often the target compiler isn't immediately available, and so the build fails. The problem with zlib impacted a previous attempt to synchronise the top-level configure scripts from gcc to binutils-gdb, see this thread: https://sourceware.org/pipermail/binutils/2019-May/107094.html And I'm in the process of importing libbacktrace in to binutils-gdb, which is also a host and target library, and triggers the same issues. I believe that for binutils-gdb, at least at the moment, there are no target libraries that we need to build. In the configure script we build three lists of things we want to build, $configdirs, $build_configdirs, and $target_configdirs, we also build two lists of things we don't want to build, $skipdirs and $noconfigdirs. We then remove anything that is in the lists of things not to build, from the list of things that should be built. My proposal is to add everything in target_configdirs into skipdirs, if the source tree doesn't contain a gcc/ sub-directory. The result is that for binutils-gdb no target tools or libraries will be built, while for the gcc repository, nothing should change. If a user builds a unified source tree, then the target tools and libraries should still be built as the gcc/ directory will be present. I've tested a build of gcc on x86-64, and the same set of target libraries still seem to get built. On binutils-gdb this change resolves the issues with 'make all'. ChangeLog: * configure: Regenerate. * configure.ac (skipdirs): Add the contents of target_configdirs if we are not building gcc. --- configure | 10 ++++++++++ configure.ac | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/configure b/configure index fcec657de7a..787fcf89100 100755 --- a/configure +++ b/configure @@ -6848,6 +6848,16 @@ case ,${enable_languages}, in ;; esac +# If gcc/ is not in the source tree then we'll not be building a +# target compiler, assume in that case we don't want to build any +# target libraries or tools. +# +# This was added primarily for the benefit for binutils-gdb who reuse +# this configure script, but don't always have target tools available. +if test ! -d ${srcdir}/gcc; then + skipdirs="${skipdirs} ${target_configdirs}" +fi + # Remove the entries in $skipdirs and $noconfigdirs from $configdirs, # $build_configdirs and $target_configdirs. # If we have the source for $noconfigdirs entries, add them to $notsupp. diff --git a/configure.ac b/configure.ac index 1b1aa80f7c7..2b10e9a1b02 100644 --- a/configure.ac +++ b/configure.ac @@ -2233,6 +2233,16 @@ case ,${enable_languages}, in ;; esac +# If gcc/ is not in the source tree then we'll not be building a +# target compiler, assume in that case we don't want to build any +# target libraries or tools. +# +# This was added primarily for the benefit for binutils-gdb who reuse +# this configure script, but don't always have target tools available. +if test ! -d ${srcdir}/gcc; then + skipdirs="${skipdirs} ${target_configdirs}" +fi + # Remove the entries in $skipdirs and $noconfigdirs from $configdirs, # $build_configdirs and $target_configdirs. # If we have the source for $noconfigdirs entries, add them to $notsupp. -- 2.25.4