From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 2E1B53858404 for ; Thu, 15 Sep 2022 08:50:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2E1B53858404 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-wm1-x330.google.com with SMTP id n35-20020a05600c502300b003b4924c6868so3440466wmr.1 for ; Thu, 15 Sep 2022 01:50:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=FsABagi8EVwSOFkrGDKEVAMzGp1LRNJY73Tp1bI6rWE=; b=B+0wpuY9xooSus7Xy8Rh2sP0DbNCxlFJFJ5qESKBN0qUEUmKlBU8zwLGSGpxzTOxWv pjaRAMGU/x2Oi9dxx3dE8R+CJ72fhwf2FCDVTeFAslZkhx87X9Q07Y0Q6s8Wwmw/Tyky rdeZeJsGYkwxje5bw+H1gsbluAACRPwqecKVnp7NK321lSoEwnidlk2IznD8JxfRzCSt gtiWer+SnHl7NcnAZkPk8OYnHkvKHOL30DIH8DrQWiVTDDx235uoSPtwRknbp2c0UdlX RJ5KAHlJz2FztvZ300btG1y/6k6zffllJHpqEuTAhJ7rmoSPu7MgTg7fE3rCR5AJqmow xb6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=FsABagi8EVwSOFkrGDKEVAMzGp1LRNJY73Tp1bI6rWE=; b=P7mESWgEgJNWZyfNQlimxvlWjwKHrKWjCbQ72ucJK8/rFA13rFfYAYuAFLN16flLGq fPXYlvs3c7hoZU99E7SJnwZoXU8gqVH+yPN5DzWZae4zb5SObFCW5UACVZCO/3oEV+dH T1ktN2a15N5oMBVrHJmsBPrwwPsa4eRd+MUCCeU+aVEQ9PMyFYFTrwyH5aCLkKsZ2k02 b6jTdPcgrGOJ93Ssf2q+RRxevafUcGxofVqSyeHC7m+H/NK94itaQ3aFtuKREGCUxKsp Wo9vVeyhUKIZxXjslgS4l7uhHahsIp62h3UnSfa9OMDsgHui+LvnvlUeITlwDapIS+qO gBqA== X-Gm-Message-State: ACgBeo2ujWi4+SkeA6+7HSStJSKRK6WbImwDQSanItQthy5bzeIQw9V3 3Vlp3Ww44eaOGi0jJWFFGwp4cPiybX7aCw== X-Google-Smtp-Source: AA6agR6QQigpFguyx+LC/e8AKK06qtT3MqwDWlDyZnltEuJfPeCvxkALGaHN6UOy1WQvXEPv1oHVMg== X-Received: by 2002:a05:600c:a147:b0:3b4:86e7:4315 with SMTP id ib7-20020a05600ca14700b003b486e74315mr5987636wmb.156.1663231828786; Thu, 15 Sep 2022 01:50:28 -0700 (PDT) Received: from chigot-Dell.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id s15-20020a05600c384f00b003b4727d199asm1907790wmr.15.2022.09.15.01.50.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Sep 2022 01:50:28 -0700 (PDT) From: =?UTF-8?q?Cl=C3=A9ment=20Chigot?= To: binutils@sourceware.org Cc: =?UTF-8?q?Cl=C3=A9ment=20Chigot?= Subject: [PATCH 2/2] ld/testsuite: allow to force another directory for gcc linker Date: Thu, 15 Sep 2022 10:50:20 +0200 Message-Id: <20220915085020.413110-2-chigot@adacore.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220915085020.413110-1-chigot@adacore.com> References: <20220915085020.413110-1-chigot@adacore.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Add a new variable "ld_testsuite_tmpdir" to enable manual configuration of the -B flag added to gcc calls. This flag ensure that gcc is invoking the linker and the assembler we want to test. When launching the testsuite outside of the build tree, the links made by the testsuite in tmpdir/ld will point to nothing. Thus, even with the PATH correctly setup towards the linker directory, gcc might end up falling back to its default linker. Hence this variable to ensure that gcc, whatever happens, is using the linker we want. ld/ChangeLog: * testsuite/config/default.exp: Allow to change -B flag with ld_testsuite_bindir variable. --- ld/testsuite/config/default.exp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/ld/testsuite/config/default.exp b/ld/testsuite/config/default.exp index 103b426bbd8..c1175c42760 100644 --- a/ld/testsuite/config/default.exp +++ b/ld/testsuite/config/default.exp @@ -57,14 +57,21 @@ remote_exec host "mkdir -p tmpdir" # Make symlinks from tmpdir/ld to the linker and assembler in the # build tree, so that we can use a -B option to gcc to force it to use -# the newly built linker and assembler. -if {![file isdirectory tmpdir/ld]} then { - catch "exec mkdir tmpdir/ld" status - catch "exec ln -s ../../ld-new tmpdir/ld/ld" status - catch "exec ln -s ld tmpdir/ld/collect-ld" status - catch "exec ln -s ../../../gas/as-new tmpdir/ld/as" status -} -set gcc_B_opt "-B[pwd]/tmpdir/ld/" +# the newly built linker and assembler. +# The variable ld_testsuite_bindir allows to provide another directory +# for -B option. This can be useful when launching the testsuite outside +# the build tree as the symlinks will be wrong in this case. +if {[info exists ld_testsuite_bindir]} { + set gcc_B_opt "-B$ld_testsuite_bindir/" +} else { + if {![file isdirectory tmpdir/ld]} then { + catch "exec mkdir tmpdir/ld" status + catch "exec ln -s ../../ld-new tmpdir/ld/ld" status + catch "exec ln -s ld tmpdir/ld/collect-ld" status + catch "exec ln -s ../../../gas/as-new tmpdir/ld/as" status + } + set gcc_B_opt "-B[pwd]/tmpdir/ld/" +} # load the linker path set ld_L_opt "" -- 2.25.1