From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 75883 invoked by alias); 11 Nov 2019 18:12:20 -0000 Mailing-List: contact libffi-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libffi-discuss-owner@sourceware.org Received: (qmail 75865 invoked by uid 89); 11 Nov 2019 18:12:19 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-8.6 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,KAM_ASCII_DIVIDERS autolearn=ham version=3.3.1 spammy=$CC, $cc, CC X-HELO: esa2.hgst.iphmx.com Received: from esa2.hgst.iphmx.com (HELO esa2.hgst.iphmx.com) (68.232.143.124) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 11 Nov 2019 18:12:18 +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=1573495957; x=1605031957; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=nnxSKfDyLPNMEyss1wKNw+UIM/BWyrJMRq6oKTrLhRY=; b=UabXcrmTKfI8w76xj/asZQ05W6Ou1Z+SoOuKdiRoThKVpieQZb/HSVb9 sBKTT3nbjt1cUHh7Zktp6axWTf5fF/Xj0Qk0QX7NlKYQA2Gb7o//ksUrG 0Z3dJf+WkOjds5swBb3J9VQM1kRPcikX8PkiPDcIZGfamEZOqKb2eqyrs 1hF9arnwhTo+TvouE+tEu27b5KGDUcS7Kj1aTt42UZhEY2+QZcLOd/Abx sL1Cng4Onl8AL+QGni6elPBzm0nbK/2yuMZiCPqgqACmghJiqvnRRWZwl 4vWjpac6xjZrOWcLdJ05xAvSi4fv37wPpqpeyfD5mPqok+CR4vLQHk+6e Q==; IronPort-SDR: plv1LV0AqOEOXQNzNb5rnTR+AfEh049PXudEn3TerYFk7CVYSTxp7g83UsEWUTUS8AoOTmdGTG 8UV0LZthmJ5uBo2pfuDRYk77G0bFft6a2YNVlq1REgb9YSKVkBfHfAddeYCBoInLxvIkQ9PCnd ZBqGLbIXw9tKbj4sQ0oNqqgE8ukgVzBkQq+ibzFatYjZQQ2EYtswzhc9ePgS0qdEixwajCG4We 0XzsYf6kbobFs+0oBhLcxfqLXPCQxpmsebRa/qM+dCQzzIfVcv6meQntFclPgEAcdhJrriQVmy gG8= 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; 12 Nov 2019 02:12:35 +0800 IronPort-SDR: TqaLmpWB5M62NeITfyQYYjxVfUqE3ZR4kIRfaTcDera9XeGqtqsQD1GL6+tC2mYTMqgojhkQGo v1J1vLp3NboVk7Gm7CGDii1y2Rh0OVz0Ec2yyTjqAIDfbVz/jlJWQuZ3H749CzQRCXbTRreZNI u3/bGGEZg4tiKdWwLutveCYtZZ+rM7TckpmbrNVSQCzN5ph087hP+DsaasEJPrjTSVVbaGvpvP cd172oWBscGsUvp4nIC2ZVNkHIaUmTJV7HRekpnHFdbbUQ1m6JCAklFGS/leOveLhN20J9Arwg z7+UaKrsM5ieNB8w2400PR59 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; 11 Nov 2019 10:07:20 -0800 IronPort-SDR: TyxVRSjnue5oAk7/OKkortQKMYIkfbfVEaOlBnpZJBSMYEcheJZ7U2tTfdc4/dFveIlyKiaR4V +kKhb/zSTxxN2hlwxp8YITndJFecB8qyH+WcVlLGKA/Dg6KMu76B6jgzoimrUZFq2oC/9Cg0rr JwLyN4j2MpUFwP2vLYjCC4KMJFiBYqQE9Y3Xgkof4S7l+t7xBxQYWHdZZkFqgqex8Uau35de6A h06MzljeMKi1+iDL+gAuE7coKhUwgQIvaBz/T1DaSFxXlahbByx/fnJOa7gG5rox3QnC+5d8PE 750= 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; 11 Nov 2019 10:12:17 -0800 Date: Mon, 11 Nov 2019 18:12:00 -0000 From: "Maciej W. Rozycki" To: gcc-patches@gcc.gnu.org cc: libffi-discuss@sourceware.org, golang-dev@googlegroups.com Subject: [PATCH 1/4] libatomic/test: Fix compilation for build sysroot In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (LFD 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-SW-Source: 2019/txt/msg00066.txt.bz2 Fix a problem with the libatomic testsuite using a method to determine the compiler to use resulting in the tool being different from one the library has been built with, and causing a catastrophic failure from the lack of a suitable `--sysroot=' option where the `--with-build-sysroot=' configuration option has been used to build the compiler resulting in the inability to link executables. Address this problem by providing a DejaGNU configuration file defining the compiler to use, via the GCC_UNDER_TEST TCL variable, set from $CC by autoconf, which will have all the required options set for the target compiler to build executables in the environment configured, removing failures like: .../bin/riscv64-linux-gnu-ld: cannot find crt1.o: No such file or directory .../bin/riscv64-linux-gnu-ld: cannot find -lm collect2: error: ld returned 1 exit status compiler exited with status 1 FAIL: libatomic.c/atomic-compare-exchange-1.c (test for excess errors) Excess errors: .../bin/riscv64-linux-gnu-ld: cannot find crt1.o: No such file or directory .../bin/riscv64-linux-gnu-ld: cannot find -lm UNRESOLVED: libatomic.c/atomic-compare-exchange-1.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: === libatomic Summary === # of unexpected failures 27 # of unresolved testcases 27 to: === libatomic Summary === # of expected passes 54 libatomic/ * configure.ac: Add testsuite/libatomic-test-support.exp to output files. * configure: Regenerate. * testsuite/libatomic-test-support.exp.in: New file. * testsuite/Makefile.am (EXTRA_DEJAGNU_SITE_CONFIG): New variable. * testsuite/Makefile.in: Regenerate. --- libatomic/configure | 3 +++ libatomic/configure.ac | 1 + libatomic/testsuite/Makefile.am | 2 ++ libatomic/testsuite/Makefile.in | 5 ++++- libatomic/testsuite/libatomic-test-support.exp.in | 1 + 5 files changed, 11 insertions(+), 1 deletion(-) gcc-test-libatomic-gcc-under-test.diff Index: gcc/libatomic/configure =================================================================== --- gcc.orig/libatomic/configure +++ gcc/libatomic/configure @@ -15701,6 +15701,8 @@ fi ac_config_files="$ac_config_files Makefile testsuite/Makefile" +ac_config_files="$ac_config_files testsuite/libatomic-test-support.exp" + cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -16772,6 +16774,7 @@ do "gstdint.h") CONFIG_COMMANDS="$CONFIG_COMMANDS gstdint.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "testsuite/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/Makefile" ;; + "testsuite/libatomic-test-support.exp") CONFIG_FILES="$CONFIG_FILES testsuite/libatomic-test-support.exp" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac Index: gcc/libatomic/configure.ac =================================================================== --- gcc.orig/libatomic/configure.ac +++ gcc/libatomic/configure.ac @@ -279,4 +279,5 @@ else fi AC_CONFIG_FILES(Makefile testsuite/Makefile) +AC_CONFIG_FILES(testsuite/libatomic-test-support.exp) AC_OUTPUT Index: gcc/libatomic/testsuite/Makefile.am =================================================================== --- gcc.orig/libatomic/testsuite/Makefile.am +++ gcc/libatomic/testsuite/Makefile.am @@ -11,3 +11,5 @@ EXPECT = $(shell if test -f $(top_buildd _RUNTEST = $(shell if test -f $(top_srcdir)/../dejagnu/runtest; then \ echo $(top_srcdir)/../dejagnu/runtest; else echo runtest; fi) RUNTEST = $(_RUNTEST) $(AM_RUNTESTFLAGS) + +EXTRA_DEJAGNU_SITE_CONFIG = libatomic-test-support.exp Index: gcc/libatomic/testsuite/Makefile.in =================================================================== --- gcc.orig/libatomic/testsuite/Makefile.in +++ gcc/libatomic/testsuite/Makefile.in @@ -108,7 +108,7 @@ am__configure_deps = $(am__aclocal_m4_de DIST_COMMON = $(srcdir)/Makefile.am mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs CONFIG_HEADER = $(top_builddir)/auto-config.h -CONFIG_CLEAN_FILES = +CONFIG_CLEAN_FILES = libatomic-test-support.exp CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) @@ -277,6 +277,7 @@ _RUNTEST = $(shell if test -f $(top_srcd echo $(top_srcdir)/../dejagnu/runtest; else echo runtest; fi) RUNTEST = $(_RUNTEST) $(AM_RUNTESTFLAGS) +EXTRA_DEJAGNU_SITE_CONFIG = libatomic-test-support.exp all: all-am .SUFFIXES: @@ -309,6 +310,8 @@ $(top_srcdir)/configure: @MAINTAINER_MOD $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): +libatomic-test-support.exp: $(top_builddir)/config.status $(srcdir)/libatomic-test-support.exp.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo Index: gcc/libatomic/testsuite/libatomic-test-support.exp.in =================================================================== --- /dev/null +++ gcc/libatomic/testsuite/libatomic-test-support.exp.in @@ -0,0 +1 @@ +set GCC_UNDER_TEST {@CC@}