From patchwork Sat Nov 9 01:07:24 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: 1192349 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-512870-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="k5h08Wuz"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.b="b+gF2x9D"; 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 478zWy1h1pz9sP4 for ; Sat, 9 Nov 2019 12:07:40 +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:message-id:mime-version:content-type; q=dns; s= default; b=i3O8eiz3pWXr7jnOENQyZps14syPMUaGLfDDuMAcPTVKLVkos+YMg DXYgKL/JR8e7CJNJP7+5h6GKi/l4FcJMxXSNUiK85Wr5IV4g9vlUZeg9gO6hDkdg RcbpcondE/GcnEvY1ZbSNgYhc0GLXiAJmpsPxGt/ajGMZlBMUMZn9c= 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:message-id:mime-version:content-type; s= default; bh=9JXA1woPH/kAcJSn8UxEyMZWmh0=; b=k5h08WuzPjITQBPx0fHs j0dIdwyKrYK6C3btNaJTtBuQye3SwyP+BL0IqMpFy6UGNbW63CGvMXdFWnf0Niul RKFFga21tyUeNhhB3IOKuEPbuZ341LcW8Jh/IpkNSHBYIeTLr54ePpBKjqgsAlsS XxcTeGBF3zWTweVLXuwIWAw= Received: (qmail 81964 invoked by alias); 9 Nov 2019 01:07:33 -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 81954 invoked by uid 89); 9 Nov 2019 01:07:33 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-8.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=UD:orig, sysroot, lappend, sk:gcc-tes X-HELO: esa6.hgst.iphmx.com Received: from esa6.hgst.iphmx.com (HELO esa6.hgst.iphmx.com) (216.71.154.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 09 Nov 2019 01:07:31 +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=1573261652; x=1604797652; h=date:from:to:subject:message-id:mime-version; bh=9F5IK7D9Z756mhxtaQm3zPrESSuHjRdonTLnq1zi8CE=; b=b+gF2x9DuQGehN8g4e8LLNO2Su2GM3nt0uGSNg3MsrVOTsbaL2UJDnVn 1tNwSxwdl9WCQlAPZ+g2dzxEsY1afSxd2qmb8p8tr+riGleW4kod2c7aT Y55ke9tY6f9JBjFrd962j/ujh+hIRf8djIqs8YXfT7Ivi0le+LChmHyoJ smG4b7a895t4ALS+DQdRakdaC1bGedFJ+eVyym6jFbnEQaV2TH4BS7KQB H+PtCzjysiGFBV4FmDahFVUusfXFF6kVGnqyjHmh2wXl2Q9QaJGm/S+ew KzDsMQx/rZqBzBMzwbmd8FUT+EKk/PQgluUpdweUUWRxSWG6AogVzgdxG w==; IronPort-SDR: 9RKcYGi3hXdigabqEAkuiAJZRuailkG3tvyHAIFsVMqrOUjoN/5OLmVk3SRPb4XHTi9I1G4j/e SP7RybYZPRGSAlH3wfELh/w0w6syFp8QzEoaNboE0YFGlDS8VLCBhssY+pkwq41IygWOzw4bwE xC/e2UFFvBxMQP1gPizwq0edX83LKtbEY3pZnI1rNbgDt1lKJIuQxdgmvNikjN0SW35WjUvt5R S8gCvLAiwQ+spGLClVZcfPr6Wjdpf+2oFJW+Ce/kUvqk8AdhYXm1XZ2XuvkHyWtcUAlC4mdxed S30= Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 09 Nov 2019 09:07:30 +0800 IronPort-SDR: An0p8FM53bYEbaYk4S7mMFuR7+ap3EmrBdnE3N6BO/hOhKI3I5MFXBVXIoePDVSbnullB4Dxbd ECJI41IAbsYwq31uztNEkOImEbWlAqrMfs12ciHQzqs2XQq7WeM2j8KvVi/6CJmt1PomXL8Sn2 Y/fxxiMCvOPsl5VHQuUIi1WNQNizOGeYDNOq1S8dfxJhDGD7W/ZQCLKObWfe0YdqRglMXdRax0 E5T0tWiuVfO6T4Ik5jHoOAYD/csjvHbwEDi8wh6+pdnfd6IjGjVC1OUt8JYWHys4yuHmCHmMWc rmr5nPbmDH5LstKJny7zpH+G Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Nov 2019 17:02:38 -0800 IronPort-SDR: 9tc9mGGTEuH7fCYeJwBztg7eNH5Wbpi1wNV8jPHRTh96iP9i3K3SpBm/Nx5GW1vdS8ppIHpiXQ 91a8t6qiPJdql+qE7eZnSjDkV1ItIAV3yxy1epTF/LsjBt0cjPcxZhzCNuSi2pCM7jgHsaf9Xb TyY3ho3vgrvINomoiAqK0ZTfs+647NwJ9c1Mpbb68RzjUEHb3CBmc3SyEbFDjb62ytWIbzLwDe zitdxJldsQfK3CqtBgqGiOdtwmx5a+IqcbV48O/mRFEpswjSZ2hZjOk7TfUISY/Ivl6s3jkEQB IzA= WDCIronportException: Internal Received: from unknown (HELO redsun52) ([10.149.66.28]) by uls-op-cesaip01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Nov 2019 17:07:30 -0800 Date: Sat, 9 Nov 2019 01:07:24 +0000 (GMT) From: "Maciej W. Rozycki" To: gcc-patches@gcc.gnu.org Subject: [PATCH] libgomp/test: Add flags to find libatomic in build-tree testing Message-ID: 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 targets such as `riscv-linux-gnu' that imply `-latomic' with the `-pthread' GCC option, implied in turn by the offload 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 said 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. --- libgomp/testsuite/lib/libgomp.exp | 10 ++++++++++ 1 file changed, 10 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,16 @@ 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 != "" } { + # Offload options imply `-pthread', and that implies `-latomic' + # on some targets, so wire in libatomic build directories. + 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 != "" } {