From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by sourceware.org (Postfix) with ESMTPS id 64E50385DC37 for ; Fri, 3 Apr 2020 23:00:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 64E50385DC37 IronPort-SDR: IrCntKqOZK0YV5pBL2mkXR3e1KVk0p/IzM587HvenwjXJFrXJygBk+Nh8Zj0HMGzXOYwnB4a4f WksOmNuw8zGT685u3lhBt+WsQwErAOQ1gyoExuxjgmpfrdVbFl0cl1yCEeh13JFnnDoVt+KpH7 ziZAUgkynbxopNEvurewrD8K2J+dMAQmi91AjJcUFomGKZQaNinDHpJieyPGUdJqZz+rT+k3EO x22TUNw7WjhsIdNctEcWWU36B8r/ntxOsEcKCtV4mBWXbACPuDT+jg+ogz+UksAJq8Do8CUXrp zeA= X-IronPort-AV: E=Sophos;i="5.72,341,1580745600"; d="scan'208";a="134547461" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 04 Apr 2020 07:00:48 +0800 IronPort-SDR: zjPHxcFvd2SxsCBgSRaOZbuZol/c1oE3Wcbb8jY9T2B/CdKfzCcr5iE4JysrIvc415LPd1wGIB RAPIqr6fWz/1MhjqoyJ7BP9yaP2oW+bBSC22UNUTcVwjU1Tk5B20daOZBa8yCCYCHJIwLOSax/ /a6iUq5oo6rNg+wu09sW1l2QaJdc9h+HtA/Ok33tqmB0kxvmaf3JHh0o/Nj+2TL0IWPF6apri7 PQWHAwv8Gc6MUNvz08d31hbNBIzRGV8y7g+tzhYw7AeP5RDCK1vFqZEsvyW0gvq7HDAryzGjfp Ct/Z8uzVkcgvmlyIERxidJHl Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Apr 2020 15:52:10 -0700 IronPort-SDR: EXJfnGIF/+omTtCRG7bqt4KzrPay0alAwTaj3QQ6pYPjfR0AVDQkMT4xbmUda1dx1lmiwm6g+I xvrwHiaj6e/S7Wc3pIKMTGTIYZRFqbszU3DAhdeT0v0KtI8tY/LvMzGF87M6KPSaJ5tXtj81AC YzaTcwOEIOBz+wW4n2PAYzVfEMrFWbvg4hf6bVfIYNIb1ikkGBoDUXE5dC6D80CeBGowxpemPb hbNHlx1/cVf6ldMc9Rwfw1U0p3jAk8Fl3Wt6vebt1cjHlecBi7hXhZ9ZVbTUXUeW8m8WD4l5le j1A= 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; 03 Apr 2020 16:00:47 -0700 Date: Sat, 4 Apr 2020 00:00:44 +0100 (BST) From: "Maciej W. Rozycki" To: gcc-patches@gcc.gnu.org cc: Jeff Law , Mike Stump , Chung-Lin Tang , Ian Lance Taylor Subject: [PATCH v4 1/5] 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-Spam-Status: No, score=-13.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Apr 2020 23:00:51 -0000 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-site-extra.exp to output files. * configure: Regenerate. * libatomic/testsuite/libatomic-site-extra.exp.in: New file. * testsuite/Makefile.am (EXTRA_DEJAGNU_SITE_CONFIG): New variable. * testsuite/Makefile.in: Regenerate. --- No change from v3. Changes from v2: - Revert to v1. - Rename testsuite/libatomic-test-support.exp.in to testsuite/libatomic-site-extra.exp.in. Changes from v1: - Remove testsuite/libatomic-test-support.exp.in and the associated changes. - Pass $(CC) via `--tool_exec' in $(AM_RUNTESTFLAGS). --- libatomic/configure | 3 +++ libatomic/configure.ac | 1 + libatomic/testsuite/Makefile.am | 2 ++ libatomic/testsuite/Makefile.in | 5 ++++- libatomic/testsuite/libatomic-site-extra.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 @@ -15728,6 +15728,8 @@ fi ac_config_files="$ac_config_files Makefile testsuite/Makefile" +ac_config_files="$ac_config_files testsuite/libatomic-site-extra.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 @@ -16799,6 +16801,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-site-extra.exp") CONFIG_FILES="$CONFIG_FILES testsuite/libatomic-site-extra.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 @@ -288,4 +288,5 @@ else fi AC_CONFIG_FILES(Makefile testsuite/Makefile) +AC_CONFIG_FILES(testsuite/libatomic-site-extra.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-site-extra.exp Index: gcc/libatomic/testsuite/Makefile.in =================================================================== --- gcc.orig/libatomic/testsuite/Makefile.in +++ gcc/libatomic/testsuite/Makefile.in @@ -109,7 +109,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-site-extra.exp CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) @@ -278,6 +278,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-site-extra.exp all: all-am .SUFFIXES: @@ -310,6 +311,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-site-extra.exp: $(top_builddir)/config.status $(srcdir)/libatomic-site-extra.exp.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo Index: gcc/libatomic/testsuite/libatomic-site-extra.exp.in =================================================================== --- /dev/null +++ gcc/libatomic/testsuite/libatomic-site-extra.exp.in @@ -0,0 +1 @@ +set GCC_UNDER_TEST {@CC@}