From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by sourceware.org (Postfix) with ESMTPS id DE2BE385DC02 for ; Fri, 3 Apr 2020 22:55:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org DE2BE385DC02 IronPort-SDR: 25dwTYhQsCtKK/dz20rUqYTtZD3k6ssXMRsE5P90rdgWsd0CygPrdm4yVy7qErZafD5xgzZRzc rc+1h23SSAzJJrwYsjNKQ/yh2SJXLgfMaMXOXzQC3ryy1Y6RO5gs31+GzI2zu+JgLKrbhk27xi NRspd6DX8/g69Lq76dOt0zxMV55wazN3H7ZxjUktyTXS7IgBjq+1hMEgAILtKgcBCcjy2NwKa0 58BkaRMwrxwz1ptKuurP75S1oIlpB+k/FhKy/yvlJqQMeSiKJD22Q7la4whw/xl3c4nOfrEUt1 h1s= X-IronPort-AV: E=Sophos;i="5.72,341,1580745600"; d="scan'208";a="134863964" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 04 Apr 2020 06:55:15 +0800 IronPort-SDR: XHCMVuC34078KeTGuh8BOgRG/I6cIzffyU66RpupQ8FsIkgGQkCXzA5mjV5/sqgK8TFkRsny1c QGn7Njs09C8+s6E1xAQS9hHsQVKqtrNzz/9HyyLyj/Ooo1OXlscIWjZucF7vPuLZbuP/1MV7yB RAHTUvCCWRuWSUWqsiam+ytBqwpbZFhzq7dEVcufvOzlIP/6H1zHX7G2w2gu/oqF9YJf6PJwv1 AowijrkRdfvf0aghPjhsVsrDtK4igYo3DYvzR93ZtqPIxsFjYFPDlqZGpNkddaSRqvsCT6fzS8 111rKm+YXumrEaCWGn84QZKQ Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Apr 2020 15:46:04 -0700 IronPort-SDR: aJFegNBcqdJRYtF1lsZzy2dN2ZHz/yuVucGcd9PPyL4SolJoyFYAoEgorfA72HeRDrpF7km8u8 +vyuDUD5Y3ePSjuY79aDnE2ulAabbu8IXBkXJjfoZgmm4Lo0xgQa07SwgOGXxMcnPV5WPsKUtY w3TACg1rOAbImHUck6OErl9ydVvkgeobLrQ6oCc9/DNRZzizazUfIDK0tMWO6HZfoeQvoMqYwc DjfRe+BqFqF7dLUjLH1NSINnmSg2Ol6Nk/V7vbheh6zrK07HetRGmdePfe7J66CUIhK1hHOJDM QWY= 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; 03 Apr 2020 15:55:15 -0700 Date: Fri, 3 Apr 2020 23:55:10 +0100 (BST) From: "Maciej W. Rozycki" To: libffi-discuss@sourceware.org cc: Anthony Green , Mike Stump , gcc-patches@gcc.gnu.org Subject: [PATCH libffi 0/4] Robustify compiler and library path selection in the testsuite Message-ID: 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=-14.1 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, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP, URIBL_ABUSE_SURBL autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libffi-discuss@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libffi-discuss mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Apr 2020 22:55:22 -0000 Hi, In the course of a discussion at one of the GCC mailing lists here: I have realised that some parts related to libffi testing have not been merged to GCC, and they are needed to choose the right compiler in a cross-compiler build environment where the build root option has been used. Additionally the right target run-time loader's library path has to be set via the LD_LIBRARY_PATH environment variable for running the test suite in a cross-compilation environment where the location of the host libraries is obviously irrelevant. We are keen to keep the GCC's copy of libffi as close as possible to the upstream version however while usable the current solution has some issues which we would rather avoid. I have therefore decided to address some of them with the intent to have the result backported to GCC. As it stands I'm told the current version of libffi cannot be fully merged to GCC, as there have been an ABI change that will require technical evaluation. So the intent has been to backport the changes proposed here individually. See the individual change descriptions and any further discussion included for full details of each patch proposed. These changes have been regression-tested with the `x86_64-linux-gnu' native configuration, and also the `x86_64-linux-gnu' host and the `riscv64-linux-gnu' target using RISC-V QEMU in the Linux user emulation mode as the target board. In the latter case I actually dropped libffi into GCC as a replacement of the version included there, with a minor update like below (+script regeneration) to add multilib support. Any questions, comments, or concerns? Otherwise, please apply. Maciej Index: gcc/libffi/Makefile.am =================================================================== --- gcc.orig/libffi/Makefile.am +++ gcc/libffi/Makefile.am @@ -2,7 +2,7 @@ AUTOMAKE_OPTIONS = foreign subdir-objects -ACLOCAL_AMFLAGS = -I m4 +ACLOCAL_AMFLAGS = -I m4 -I ../config SUBDIRS = include testsuite man if BUILD_DOCS @@ -158,3 +158,12 @@ AM_CCASFLAGS = $(AM_CPPFLAGS) if [ -d $(top_srcdir)/.git ] ; then (cd $(top_srcdir); git log --no-decorate) ; else echo 'See git log for history.' ; fi > $(distdir)/ChangeLog s=`awk '/was released on/{ print NR; exit}' $(top_srcdir)/README.md`; tail -n +$$(($$s-1)) $(top_srcdir)/README.md > $(distdir)/README.md +# Multilib support. Automake should provide these on its own. +all-recursive: all-multi +install-recursive: install-multi +mostlyclean-recursive: mostlyclean-multi +clean-recursive: clean-multi +distclean-recursive: distclean-multi +maintainer-clean-recursive: maintainer-clean-multi + +include $(top_srcdir)/../multilib.am Index: gcc/libffi/configure.ac =================================================================== --- gcc.orig/libffi/configure.ac +++ gcc/libffi/configure.ac @@ -5,6 +5,8 @@ AC_PREREQ(2.68) AC_INIT([libffi], [3.3], [http://github.com/libffi/libffi/issues]) AC_CONFIG_HEADERS([fficonfig.h]) +AM_ENABLE_MULTILIB(, ..) + AC_CANONICAL_SYSTEM target_alias=${target_alias-$host_alias}