From patchwork Mon Nov 11 18:12:44 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: 1193052 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-512977-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="WRpLf5FG"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.b="EteiHPQU"; 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 47BfB93YBcz9sP3 for ; Tue, 12 Nov 2019 05:13:05 +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:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=vRnPiUGuaR/UdWXJvpieKU/o/O8HVqp+PaKezvlMzdKDxD0XKp JXAJXS7ka7hf0BTjHinWMqwK4P6jHpiJcIWdzR0Bv8M7+kSnnpl4IRtkMUrijMll vQ64MQG10Vk5EvtGtKFVa6HYb/YjLTu238Mti9vGks4pjgN0tcYPf8XjE= 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:cc:subject:message-id:mime-version:content-type; s= default; bh=+RVaREfZCjfUGn5ecAlqxZveZ30=; b=WRpLf5FG0w0S/2LWWX4O 20nWW2AH8F7ur+NuZAbrsXEbkmGf4856VTMEIrvxJfIGwLYPsNQYiWUd1cuYqHZ3 Qu2rDZo1U67rwUj0+p04C13yz/3XzbSi/46H/7i726QStwuuC5pv9gCofreMqBOn ez/afPgZj8IU8PdyGWyTJH8= Received: (qmail 79618 invoked by alias); 11 Nov 2019 18:12:54 -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 79603 invoked by uid 89); 11 Nov 2019 18:12:54 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-8.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, KAM_SHORT autolearn=ham version=3.3.1 spammy= 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:52 +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=1573495980; x=1605031980; h=date:from:to:cc:subject:message-id:mime-version; bh=AEUr/ZNTCuy1XfLYIiw5QJxmrMw8RTbQvg7YgqLEC90=; b=EteiHPQUrqxqYyRkkhqGq1IJ56SYtPU8ugqgcuf4FFrEom6sIalVTjQ1 29hN1ne9oHDu0dH+c6O9q2Dh4s5eXns+tOCiL53uoEGsYQBP8bxQfEQDk bVw0Mgkqb2TpaQE0zBuUIM4hGCKJgKwtKxnqDtL3t3x9RF/J1y7vUFSVz Q+lYtIfkthP69/lJzp/VWx5iFi2xH9OXvjDw918Gp07w7KzpMigxeL63+ lwHKFWFgtzyF3Th42dS3fnjKmjAqJGfkGOk0vZ8I1LnDV0tcprhXu+S15 zcnbtbk1yUV/OzNR0eXQImRUHdd2Diw6nVEzX7nf+FRNzURGZPj6Hqz+W g==; IronPort-SDR: tUPopbhcW2JTkAFACeqN0IfcQVEQ8JMSJf+YSl341bcQi+B52T9A87u5Fk8oMvmIfZaOjE5FJL AROKaTIJAKVrldz5i78DvCHi4WsgNpDTnE5l8w/ZCsj1sw15qAWWTTzf835t7Dp0AQaimLylfI zeq3FpVsuUw8kB7axo5pYOM+lxtbdV1fXr32eloMWCzV09+kE14qpRD1lbPQO6cihDTfyoKtpF u5Ie7V59LvgRVBXr3Vc7UFb3Qy/eErLWAQTtDFli7pdKHlC6vPUmFlBjzRolor9y9Y3L0G2knW L9s= X-URL-LookUp-ScanningError: 1 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:52 +0800 IronPort-SDR: gGE29lImBkWx8pN4/Ks39QiRQRf+++rNTJxTUt2mUXmT6vTRqebvOuJao+HawVorCam24lakNM 3PptFImbrFCLsEA2ug5/TDOrjRqOfkPsHoirl6RoghJcy0QQ31sTnYuWc2WtQKjUEN3WBpB74a L4wv9c3UV0wqHL3IH0p5/m8wmpaYX+t03hZZVxb1AB7RWaP4bF5+uxOf3SuI5SPdIBOt95xrQQ ETwmobwBUQysdZ4wkCA+NLleojg0hbOvKx8+wX3ZfgiLFKpawnFnvYHNGhr0tMqrmYaS4CB3nM xkUdj+1H4GmIR2pPZ9WN3e+Q 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:50 -0800 IronPort-SDR: an78HJeoZSKsbD5WTBfDq28ab9a1zUKYSx5m0k+9KAx/XUKjxDgISiRa6oEvf/23jfuzejY/9u lSnRAPatvzD0EaSPosz2fwmM8RYcmr44RxD9vGQ9HkU3MwVQQorGSFpo7DIYJGMrMTn/0twXLp i7YByhiIDCf19ZTYCJh1rEGNyCXYrzl6YwDhxqi5482DxJtS99q28QkrWFZymsH97dezphJAtt UmAl8fHHl1CHS0YwM7SeJMl2sPgQdIIPOfuiwiHUVHxM0xStT4N4ujZp2xx91EhK93jbe1Lai8 YsE= 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:46 -0800 Date: Mon, 11 Nov 2019 18:12:44 +0000 (GMT) From: "Maciej W. Rozycki" To: gcc-patches@gcc.gnu.org cc: libffi-discuss@sourceware.org, golang-dev@googlegroups.com Subject: [PATCH 3/4] libgo/test: Fix compilation for build sysroot Message-ID: User-Agent: Alpine 2.21 (LFD 202 2017-01-01) MIME-Version: 1.0 Fix a problem with the libgo 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 GOC_UNDER_TEST TCL variable, set from $GOC 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 .../bin/riscv64-linux-gnu-ld: cannot find -lc collect2: error: ld returned 1 exit status compiler exited with status 1 No summary comparison, because the libgo testsuite does not provide one in this configuration for some reason, however this change improves 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 0 PASSes and 159 FAILs to 133 PASSes and 26 FAILs. libgo/ * configure.ac: Add testsuite/libgo-test-support.exp to output files. * configure: Regenerate. * testsuite/libgo-test-support.exp.in: New file. * testsuite/Makefile.am (EXTRA_DEJAGNU_SITE_CONFIG): New variable. * testsuite/Makefile.in: Regenerate. * testsuite/lib/libgo.exp: Don't override GOC_UNDER_TEST previously set. --- libgo/configure | 3 ++- libgo/configure.ac | 2 +- libgo/testsuite/Makefile.am | 2 ++ libgo/testsuite/Makefile.in | 5 ++++- libgo/testsuite/lib/libgo.exp | 13 ++++++++----- libgo/testsuite/libgo-test-support.exp.in | 1 + 6 files changed, 18 insertions(+), 8 deletions(-) gcc-test-libgo-gcc-under-test.diff Index: gcc/libgo/configure =================================================================== --- gcc.orig/libgo/configure +++ gcc/libgo/configure @@ -15850,7 +15850,7 @@ else multilib_arg= fi -ac_config_files="$ac_config_files Makefile testsuite/Makefile" +ac_config_files="$ac_config_files Makefile testsuite/Makefile testsuite/libgo-test-support.exp" ac_config_commands="$ac_config_commands default" @@ -17031,6 +17031,7 @@ do "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "testsuite/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/Makefile" ;; + "testsuite/libgo-test-support.exp") CONFIG_FILES="$CONFIG_FILES testsuite/libgo-test-support.exp" ;; "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; Index: gcc/libgo/configure.ac =================================================================== --- gcc.orig/libgo/configure.ac +++ gcc/libgo/configure.ac @@ -877,7 +877,7 @@ else multilib_arg= fi -AC_CONFIG_FILES(Makefile testsuite/Makefile) +AC_CONFIG_FILES(Makefile testsuite/Makefile testsuite/libgo-test-support.exp) AC_CONFIG_COMMANDS([default], [if test -n "$CONFIG_FILES"; then Index: gcc/libgo/testsuite/Makefile.am =================================================================== --- gcc.orig/libgo/testsuite/Makefile.am +++ gcc/libgo/testsuite/Makefile.am @@ -11,6 +11,8 @@ RUNTEST = `if [ -f $(top_srcdir)/../deja echo $(top_srcdir)/../dejagnu/runtest ; \ else echo runtest; fi` +EXTRA_DEJAGNU_SITE_CONFIG = libgo-test-support.exp + # When running the tests we set GCC_EXEC_PREFIX to the install tree so that # files that have already been installed there will be found. The -B option # overrides it, so use of GCC_EXEC_PREFIX will not result in using GCC files Index: gcc/libgo/testsuite/Makefile.in =================================================================== --- gcc.orig/libgo/testsuite/Makefile.in +++ gcc/libgo/testsuite/Makefile.in @@ -106,7 +106,7 @@ am__configure_deps = $(am__aclocal_m4_de DIST_COMMON = $(srcdir)/Makefile.am mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = +CONFIG_CLEAN_FILES = libgo-test-support.exp CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) @@ -299,6 +299,7 @@ RUNTEST = `if [ -f $(top_srcdir)/../deja echo $(top_srcdir)/../dejagnu/runtest ; \ else echo runtest; fi` +EXTRA_DEJAGNU_SITE_CONFIG = libgo-test-support.exp # When running the tests we set GCC_EXEC_PREFIX to the install tree so that # files that have already been installed there will be found. The -B option @@ -338,6 +339,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): +libgo-test-support.exp: $(top_builddir)/config.status $(srcdir)/libgo-test-support.exp.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo Index: gcc/libgo/testsuite/lib/libgo.exp =================================================================== --- gcc.orig/libgo/testsuite/lib/libgo.exp +++ gcc/libgo/testsuite/lib/libgo.exp @@ -14,13 +14,16 @@ # along with GCC; see the file COPYING3. If not see # . -set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a] -if {$gccdir != ""} { - set gccdir [file dirname $gccdir] -} -set GOC_UNDER_TEST "$gccdir/gccgo -B$gccdir/" set TESTING_IN_BUILD_TREE 1 +if ![info exists GOC_UNDER_TEST] then { + set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a] + if {$gccdir != ""} { + set gccdir [file dirname $gccdir] + } + set GOC_UNDER_TEST "$gccdir/gccgo -B$gccdir/" +} + if [info exists GOTEST_TMPDIR] { set tmpdir $GOTEST_TMPDIR } Index: gcc/libgo/testsuite/libgo-test-support.exp.in =================================================================== --- /dev/null +++ gcc/libgo/testsuite/libgo-test-support.exp.in @@ -0,0 +1 @@ +set GOC_UNDER_TEST {@GOC@}