From patchwork Wed Nov 20 02:13:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Maciej W. Rozycki" X-Patchwork-Id: 1197742 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-514093-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="CNR0x05Z"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.b="Q+HE/LJS"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47HmTZ6CGQz9sPK for ; Wed, 20 Nov 2019 13:14:08 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:in-reply-to:message-id:references:mime-version :content-type; q=dns; s=default; b=eaiFLVYOteSu398MAafdn0uRvv9bn ZmiyWpRwY/r9a8Skxsb9MiCAJseXlP+vU+MJ7K5dLuZwBIKB/p4RtPAVtyZ6bgAm pSI/lO4EUA4Q8Pqg1clF1Th41Z/b2kTwVnZHmTC5GHvfhrTaKIo67HDKNK6jBRkx iWHWcv0cDwWoXc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:in-reply-to:message-id:references:mime-version :content-type; s=default; bh=e1pBmqaPw7AxmmvNq72oiRxDiXI=; b=CNR 0x05Z/blQfZiJncyg8o6hM0+FSOIfJOBPOrQS6GjlyY8P5UA4EWB9XTJ20ZkeD7r 2BSAio5z1PANIO0VcIJwR+UCzlXfw2R4lnEJ0ePVJ21K5L6pxFxONwnozlK+uU1N 7OyBJoVlbJAiGpCaedEHNrLMtnrmzPQqMm+1o4xU= Received: (qmail 70479 invoked by alias); 20 Nov 2019 02:13:59 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 70411 invoked by uid 89); 20 Nov 2019 02:13:59 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-9.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy= X-HELO: esa1.hgst.iphmx.com Received: from esa1.hgst.iphmx.com (HELO esa1.hgst.iphmx.com) (68.232.141.245) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 20 Nov 2019 02:13:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1574216037; x=1605752037; h=date:from:to:subject:in-reply-to:message-id:references: mime-version; bh=RknzE6dkyrmoUMY1S8M0No63XXRuNW76zH06QyNnygk=; b=Q+HE/LJSYpntfWepV+10W7nFHW15zdClUumBHzh4XsP/C/eggSPlCF2x ztO8FHCP5CcjW4FP805RV0y9qugVtyWccSSd0t64zOERBk7HmYzhBP4It JpQqzeHH2/ZZsy009UAnbVwEF8flM2qrY5mFwt1jFuVU4Z7965UhLfa90 gqY+YhcaJwUW/tmBx40B1QtEwHdAq9FC7YTCWW3yruZpY54BYnGGnn0Rh iLOp5JCqMUmSvxMByu7JuNFdNB8EjbTnv4r8Qfx7F9xniFsVJiwnnIyNj 5rDemsya/7OdH1zsMzXrsF6EW6jqGdKSrxICYygAymnxmdnAIn3rIqqFv w==; IronPort-SDR: s94Nku8BMmPhs4hC1ksYPkgzHG/c6jUxZGTfYXWOny7q50H5Wjl63uX6Z+U3Bc6KEDKv0e38sA uAsirKqnwbeb/BBjA2sOnNqiDUJ+XFNVv7ZGyIkfcufzNgyzXJhsuQRJZjZqepHsmmRVoXZAUN SJPhQDIkzSB7tyvLmb/IL5Sap5HH45+K9zfoIT7PsZvvDrNFLlsiAuAgu4M07y4lZcDPpeQuiu PqeDsVdNhf36p+AUa6STIWnZ5XRYTJF++c6gh+XAjButlc2TKD42PkAZ3PGEUg1/h3ll2/UFOu fZM= Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 20 Nov 2019 10:13:55 +0800 IronPort-SDR: WXUwQvDsN5JJDmf+ZzEQd7c2Fl7Lxdnepz/k0++0appThVD+7j4EyDo9wccQxge2v7bn5l0pp9 ikgcD/SQJgAnCA949WzM/JlvnM1fzeQzJ9+wJKgdkYyX31oMLdW0V30octT41woLqKFv8UCMuW WJDuqct5G0Eq6gjDDGMUj1Cjs4zUTxGFzYO+S+mVcTz2RCfqYPbC3xqsOK5niUgTkhUAiLghKw 7y7ZC7764ld5X3//26uJyL4Gw3/yE0zo6/DC4+vqKPSKhL3kkJ2o9BbB68NvlHnbtt1Qk3gjNd onAfSi9+LLaaE6K1+0b/Ntpo Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Nov 2019 18:09:06 -0800 IronPort-SDR: g7ipL0li1jeYYtrgUnhhurlgwZbRiBw7oazCGrUBEemCqeR2XWRweJbTQIbaaPWjw1z+F1Eonj jC1UZlUMjSoDuan1cCffgtcPbhyczTSO/JdDFE+Q6c2oZ6ZOMTkLXhP68d8WuqiNIKtMbl/gPx 1tT2ivtFNlB1B7sx0tkE44BLm4N8YgywmEP8ZZjezz7IZw4/okkIXDz63DVPKN7snTYxh/Hjav nEHmIrUyRu5w6QLCW63kuAvkiiFl2RWBBEg1h6JSkScDmwoao2XVCgQ1ubNojoHQQgrCy6LLsO fGU= WDCIronportException: Internal Received: from unknown (HELO redsun52) ([10.149.66.28]) by uls-op-cesaip02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Nov 2019 18:13:55 -0800 Date: Wed, 20 Nov 2019 02:13:52 +0000 (GMT) From: "Maciej W. Rozycki" To: Jakub Jelinek , gcc-patches@gcc.gnu.org Subject: [PATCH v3] libgomp/test: Add flags to find libatomic in build-tree testing In-Reply-To: <20191119232405.GM4650@tucnak> Message-ID: References: <20191118153213.GZ4650@tucnak> <20191119232405.GM4650@tucnak> User-Agent: Alpine 2.21 (LFD 202 2017-01-01) MIME-Version: 1.0 Add flags to find libatomic in build-tree testing, fixing a catastrophic libgomp testsuite failure with `riscv*-*-linux*' targets, which imply `-latomic' with the `-pthread' GCC option, implied in turn by the `-fopenacc' and `-fopenmp' options, removing failures like: .../bin/riscv64-linux-gnu-ld: cannot find -latomic collect2: error: ld returned 1 exit status compiler exited with status 1 FAIL: libgomp.c/../libgomp.c-c++-common/atomic-18.c (test for excess errors) Excess errors: .../bin/riscv64-linux-gnu-ld: cannot find -latomic UNRESOLVED: libgomp.c/../libgomp.c-c++-common/atomic-18.c compilation failed to produce executable and bringing overall test results for the `riscv64-linux-gnu' target (here with the `x86_64-linux-gnu' host and RISC-V QEMU in the Linux user emulation mode as the target board) from: === libgomp Summary === # of expected passes 90 # of unexpected failures 3267 # of expected failures 2 # of unresolved testcases 3247 # of unsupported tests 548 to: === libgomp Summary === # of expected passes 6834 # of unexpected failures 4 # of expected failures 4 # of unsupported tests 518 libgomp/ * testsuite/lib/libgomp.exp (libgomp_init): Add flags to find libatomic in build-tree testing. --- On Wed, 20 Nov 2019, Jakub Jelinek wrote: > > Why do you think it is important that it is only the relevant (i.e. > > `riscv*') targets that the directory providing newly-built libatomic is > > pointed at ? > > Such changes don't happen every day, no other port added it similarly to > riscv during the 2.5 years since riscv had it, and no port needed it ever > before. With unneeded -L options the log file is larger, one needs to > cut'n'paste more when trying to reproduce stuff etc. Fair enough. OK to apply? NB I've decided to use `ishost' rather than `istarget', and updated the existing comment accordingly, even though the triplets are always the same here, because GCC's target is libgomp's host, e.g.: Test run by macro on Wed Nov 20 00:39:23 2019 Target is riscv64-unknown-linux-gnu Host is riscv64-unknown-linux-gnu Build is x86_64-pc-linux-gnu === libgomp tests === Schedule of variations: qemu-user-lp64d Running target qemu-user-lp64d [...] -- and libgomp itself does not have a notion of a target (unlike e.g. libbfd). Consequently I suspect that: # Many hosts now default to a non-ASCII C locale, however, so # they can set a charset encoding here if they need. if { [ishost "*-*-cygwin*"] } { setenv LC_ALL C.ASCII setenv LANG C.ASCII } is incorrect for `dg-output' matching as it will execute for libgomp built for `*-*-cygwin*' rather than being necessarily verified on one, and therefore `isbuild' ought to be used here. Maciej Changes from v2: - Limit the change to `riscv*-*-linux*' targets. - Refer to the host rather than target within libgomp.exp as GCC's target is libgomp's host. Changes from v1: - Replaced references to "offload options" with "`-fopenacc' and `-fopenmp' options". --- libgomp/testsuite/lib/libgomp.exp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) gcc-test-libgomp-atomic-lib-path.diff Index: gcc/libgomp/testsuite/lib/libgomp.exp =================================================================== --- gcc.orig/libgomp/testsuite/lib/libgomp.exp +++ gcc/libgomp/testsuite/lib/libgomp.exp @@ -174,6 +174,20 @@ proc libgomp_init { args } { # For build-tree testing, also consider the library paths used for builing. # For installed testing, we assume all that to be provided in the sysroot. if { $blddir != "" } { + # The `-fopenacc' and `-fopenmp' options imply `-pthread', and + # that implies `-latomic' on some hosts, so wire in libatomic + # build directories. + if [ishost "riscv*-*-linux*"] { + set shlib_ext [get_shlib_extension] + set atomic_library_path "${blddir}/../libatomic/.libs" + if { [file exists "${atomic_library_path}/libatomic.a"] + || [file exists \ + "${atomic_library_path}/libatomic.${shlib_ext}"] } { + lappend ALWAYS_CFLAGS \ + "additional_flags=-L${atomic_library_path}" + append always_ld_library_path ":${atomic_library_path}" + } + } global cuda_driver_include global cuda_driver_lib if { $cuda_driver_include != "" } {