From patchwork Tue Aug 31 15:36:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 1522680 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=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=F6riRiWb; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GzWZ54ckrz9sT6 for ; Wed, 1 Sep 2021 01:38:52 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 82A123858437 for ; Tue, 31 Aug 2021 15:38:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 82A123858437 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1630424330; bh=A0EfNmGlOGPniFDctwlGlh9ZgvMLA79dVSof6aBFxyM=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=F6riRiWbeFHgCathhfBFUz/L0pRZeKxIowGtDvehyMGUs1n9RPx1Ar7pkJVWcwepx 37rIGnSqVfSItx9ko6U1NTZg+J+MnR+22jpP5pLSV7gzTpjcm+Xg5NUFMIMrXntfed 8DVzQZmcKBrSd8KRHBxjCGppzUFViVaWhTLUazgQ= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by sourceware.org (Postfix) with ESMTPS id 52E483858414 for ; Tue, 31 Aug 2021 15:37:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 52E483858414 Received: by mail-pg1-x534.google.com with SMTP id 17so17132124pgp.4 for ; Tue, 31 Aug 2021 08:37:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=A0EfNmGlOGPniFDctwlGlh9ZgvMLA79dVSof6aBFxyM=; b=GARreF9G7bmIc0qxrhfwm39wG+cu+jBGjhI1f9b1EErcaDFlyGqonwA2DXoQTBInCo YbkUYxVdEwfpQM8Dt99RybM2o3WBcy41Ovpvd2TqDpWvaS/q7QctiVD3PjmJ3CxJpgeg U/LXRAdg4pVoz6cZ7eqXxefjQbznmnAMWl/AAAHzjXvZUUTMpICloHM/ozGs8UPtRDSA 1B72xI5Ynd8QrLV51wfOeEsh0WPqNjPNSTO7TYoAUWqYLIT76kA/HjRR9xdTkKsg09gu OWo8BNg3tXi1bw6JVz5AAoHXpbAuOygvC/iltgFbd0CYPKIDM3AXlDGnQp0E8vzN9w00 oHUA== X-Gm-Message-State: AOAM533BsHexJxsFZmu2Z0y1dLudn+83KUEn6rj/YBUlpMi7Lg9cnT8i 5iRFPw7pktN6EZaW54/VIdDeotVPQgQ= X-Google-Smtp-Source: ABdhPJyTAZGkdM5HYo/TVeNjWm+u13V9vTNmCONfu6hLRU7tR/B24NImMASib7axnb5zUQVimFkvfQ== X-Received: by 2002:a63:dc42:: with SMTP id f2mr26940443pgj.152.1630424222110; Tue, 31 Aug 2021 08:37:02 -0700 (PDT) Received: from gnu-cfl-2.localdomain ([172.58.38.240]) by smtp.gmail.com with ESMTPSA id j2sm17789996pfe.201.2021.08.31.08.37.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Aug 2021 08:37:01 -0700 (PDT) Received: from gnu-cfl-2.. (localhost [IPv6:::1]) by gnu-cfl-2.localdomain (Postfix) with ESMTP id CD9ECC02CC; Tue, 31 Aug 2021 08:36:59 -0700 (PDT) To: gcc-patches@gcc.gnu.org Subject: [PATCH 1/4] libffi: Add HOWTO_MERGE, autogen.sh and merge.sh Date: Tue, 31 Aug 2021 08:36:56 -0700 Message-Id: <20210831153659.3756892-2-hjl.tools@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210831153659.3756892-1-hjl.tools@gmail.com> References: <20210831153659.3756892-1-hjl.tools@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-3031.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_ABUSEAT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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-Patchwork-Original-From: "H.J. Lu via Gcc-patches" From: "H.J. Lu" Reply-To: "H.J. Lu" Cc: Jakub Jelinek Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Add scripts for syncing with libffi upstream: 1. Clone libffi repo. 2. Checkout the specific commit. 3. Remove the unused files. 4. Add new files if needed. * HOWTO_MERGE: New file. * autogen.sh: Likewise. * merge.sh: Likewise. --- libffi/HOWTO_MERGE | 13 ++++++++++++ libffi/autogen.sh | 11 ++++++++++ libffi/merge.sh | 51 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+) create mode 100644 libffi/HOWTO_MERGE create mode 100755 libffi/autogen.sh create mode 100755 libffi/merge.sh diff --git a/libffi/HOWTO_MERGE b/libffi/HOWTO_MERGE new file mode 100644 index 00000000000..6821c6dee3f --- /dev/null +++ b/libffi/HOWTO_MERGE @@ -0,0 +1,13 @@ +In general, merging process should not be very difficult, but we need to +track GCC-specific patches carefully. Here is a general list of actions +required to perform the merge: + +* Checkout recent GCC tree. +* Run merge.sh script from the libffi directory. +* Add new files if needed. +* Apply all needed GCC-specific patches to libffi (note that some of + them might be already included to upstream). The list of these patches + is stored into LOCAL_PATCHES file. May need to re-run autogen.sh to + regenerate configure and Makefile.in files. +* Send your patches for review to GCC Patches Mailing List (gcc-patches@gcc.gnu.org). +* Update LOCAL_PATCHES file when you've committed the whole patch set with new revisions numbers. diff --git a/libffi/autogen.sh b/libffi/autogen.sh new file mode 100755 index 00000000000..95bfc389faf --- /dev/null +++ b/libffi/autogen.sh @@ -0,0 +1,11 @@ +#!/bin/sh +#exec autoreconf -v -i + +rm -rf autom4te.cache +aclocal -I .. -I ../config +autoheader -I .. -I ../config +autoconf +automake --foreign --add-missing --copy Makefile +automake --foreign include/Makefile +automake --foreign man/Makefile +automake --foreign testsuite/Makefile diff --git a/libffi/merge.sh b/libffi/merge.sh new file mode 100755 index 00000000000..b36fbb92185 --- /dev/null +++ b/libffi/merge.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +# FIXME: do we need a license (or whatever else) header here? + +# This script merges libffi sources from upstream. + +# Default to the tip of master branch. +commit=${1-master} + +fatal() { + echo "$1" + exit 1; +} + +get_upstream() { + rm -rf upstream + git clone https://github.com/libffi/libffi.git upstream + pushd upstream + git checkout $commit || fatal "Failed to checkout $commit" + popd +} + +get_current_rev() { + cd upstream + git rev-parse HEAD +} + +pwd | grep 'libffi$' || \ + fatal "Run this script from the libffi directory" +get_upstream +CUR_REV=$(get_current_rev) +echo Current upstream revision: $CUR_REV + +# Remove the unused files. +pushd upstream +rm -rf ChangeLog.old .appveyor* .ci .github .gitignore .travis* \ + config.guess config.sub libtool-ldflags m4 make_sunver.pl \ + msvc_build +rm -rf .git autogen.sh +cp -a . .. +popd + +rm -rf upstream + +# Update the MERGE file. +cat << EOF > MERGE +$CUR_REV + +The first line of this file holds the git revision number of the +last merge done from the master library sources. +EOF From patchwork Tue Aug 31 15:36:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 1522681 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=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=P9O9OWKG; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GzWZn5wM2z9s24 for ; Wed, 1 Sep 2021 01:39:29 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4FF743857811 for ; Tue, 31 Aug 2021 15:39:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4FF743857811 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1630424366; bh=W0+pusRtMu+Gm8pE4DZ/rtYO80MimqceKlR5qX2Y4OY=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=P9O9OWKG7Zk1OAs2tVE1GLQiIO5BedcUfs9oDY6YoR9n3bMi1iOB8NzbunrsEaRyK xPgVprhj44Exq1DD8IcQfMCIs00kR+60rmT/nV9dfeabCdL9c0DxWd6zLEtfeu3gMy MVv0MtpOVL0nNVTa0Cr2kqOQBGRunxEDHrRDqBi8= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by sourceware.org (Postfix) with ESMTPS id 3152A3858410 for ; Tue, 31 Aug 2021 15:37:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3152A3858410 Received: by mail-pg1-x52a.google.com with SMTP id q68so17086424pga.9 for ; Tue, 31 Aug 2021 08:37:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=W0+pusRtMu+Gm8pE4DZ/rtYO80MimqceKlR5qX2Y4OY=; b=rIym3UKuyYcs1e+eOyoYYwPcrq5wEYWKUQTf8Qckc8ingVeYFnWIz3lmTgDbWbKhkT 8uTcO8NhSjIpV1Va9g3YmUbX0YkM4Vuf6jg71O/Y95fYEZkbzUWLFxlrJ7gmIR7hxcUa +n4jAx7PHveaVqaIJ/Rxpo7wT8VzKfXKjcWdKppNr+WxWZcJ1QheL87fxDY5Q0KOQSmS eeA3lqn7iYoTGLGaio1O01K9s6TKGUz0WyARUQGr4iuMLYp4UqgEPCrMWOTprD2XwhMR wOuQYCugLx6n1iG2qg0xT38zEo033h3iemyVmyhB4egvbIg7thty8BHc3EN/KgjjP8It rpPg== X-Gm-Message-State: AOAM531lc46777yWKaUNhNpHey3mKyvljGuKTDZu8OgV+Dg+qG6PIQzK L/OaI3AZx0FxWC78dNOe09pT8uxjlPU= X-Google-Smtp-Source: ABdhPJz8+Z0agbYGbo4OlIUhUkomKTulZbFrC8kaL4znHvFDIoJply1QB2dInSiP4CAzaxzzbvWcLQ== X-Received: by 2002:a05:6a00:2346:b0:3e1:9a1e:4a0d with SMTP id j6-20020a056a00234600b003e19a1e4a0dmr29193819pfj.47.1630424221921; Tue, 31 Aug 2021 08:37:01 -0700 (PDT) Received: from gnu-cfl-2.localdomain ([172.58.38.240]) by smtp.gmail.com with ESMTPSA id o10sm17756124pfk.212.2021.08.31.08.37.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Aug 2021 08:37:01 -0700 (PDT) Received: from gnu-cfl-2.. (localhost [IPv6:::1]) by gnu-cfl-2.localdomain (Postfix) with ESMTP id DDD5CC032A; Tue, 31 Aug 2021 08:36:59 -0700 (PDT) To: gcc-patches@gcc.gnu.org Subject: [PATCH 3/4] libffi: Integrate with GCC Date: Tue, 31 Aug 2021 08:36:58 -0700 Message-Id: <20210831153659.3756892-4-hjl.tools@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210831153659.3756892-1-hjl.tools@gmail.com> References: <20210831153659.3756892-1-hjl.tools@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-3031.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_STOCKGEN, RCVD_IN_ABUSEAT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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-Patchwork-Original-From: "H.J. Lu via Gcc-patches" From: "H.J. Lu" Reply-To: "H.J. Lu" Cc: Jakub Jelinek Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" 1. Integrate with GCC. 2. Support multilib. * Makefile.am (AUTOMAKE_OPTIONS): Add info-in-builddir. (ACLOCAL_AMFLAGS): Set to -I .. -I ../config. (SUBDIRS): Don't add doc. (TEXINFO_TEX): New. (MAKEINFOFLAGS): Likewise. (info_TEXINFOS): Likewise. (STAMP_GENINSRC): Likewise. (STAMP_BUILD_INFO): Likewise. (all-local): Likewise. (stamp-geninsrc): Likewise. (doc/libffi.info): Likewise. (stamp-build-info:): Likewise. (CLEANFILES): Likewise. (MAINTAINERCLEANFILES): Likewise. (AM_MAKEFLAGS): Likewise. (all-recursive): Likewise. (install-recursive): Likewise. (mostlyclean-recursive): Likewise. (clean-recursive): Likewise. (distclean-recursive): Likewise. (maintainer-clean-recursive): Likewise. (LTLDFLAGS): Replace libtool-ldflags with ../libtool-ldflags. (AM_CFLAGS): Add -g -fexceptions. (libffi.map-sun): Replace make_sunver.pl with ../contrib/make_sunver.pl. (dist-hook): Removed. Include $(top_srcdir)/../multilib.am. * configure.ac: Add AM_ENABLE_MULTILIB. Remove the frv*-elf check. (AX_ENABLE_BUILDDIR): Removed. (AM_INIT_AUTOMAKE): Add [no-dist]. Add --enable-generated-files-in-srcdir. (C_CONFIG_MACRO_DIR): Removed. (AX_COMPILER_VENDOR): Likewise. (AX_CC_MAXOPT): Likewise. (AX_CFLAGS_WARN_ALL): Likewise. Remove the GCC check. (SYMBOL_UNDERSCORE): Removed. (AX_CHECK_COMPILE_FLAG): Likewise. Remove --disable-docs. (ACX_CHECK_PROG_VER): Check makeinfo. (BUILD_DOCS): Updated. Remove --disable-multi-os-directory. (GCC_WITH_TOOLEXECLIBDIR): New. Support cross host. Support --enable-multilib. * include/Makefile.am (nodist_include_HEADERS): Removed. (gcc_version): New. (toollibffidir): Likewise. (toollibffi_HEADERS): Likewise. * Makefile.in: Regenerate. (GCC_BASE_VER): New. (AC_CONFIG_FILES): Remove doc/Makefile. (AC_CONFIG_LINKS): New. * aclocal.m4: Likewise. * configure: Likewise. * fficonfig.h.in: Likewise. * mdate-sh: Likewise. * include/Makefile.in: Likewise. * man/Makefile.in: Likewise. * testsuite/Makefile.in: Likewise. --- libffi/Makefile.am | 116 +- libffi/Makefile.in | 1963 ++++ libffi/aclocal.m4 | 1202 ++ libffi/configure | 19584 +++++++++++++++++++++++++++++++++ libffi/configure.ac | 126 +- libffi/fficonfig.h.in | 227 + libffi/include/Makefile.am | 6 +- libffi/include/Makefile.in | 566 + libffi/man/Makefile.in | 516 + libffi/mdate-sh | 224 + libffi/testsuite/Makefile.in | 606 + 11 files changed, 25052 insertions(+), 84 deletions(-) create mode 100644 libffi/Makefile.in create mode 100644 libffi/aclocal.m4 create mode 100755 libffi/configure create mode 100644 libffi/fficonfig.h.in create mode 100644 libffi/include/Makefile.in create mode 100644 libffi/man/Makefile.in create mode 100755 libffi/mdate-sh create mode 100644 libffi/testsuite/Makefile.in diff --git a/libffi/Makefile.am b/libffi/Makefile.am index 1b18198ad18..02e36176c67 100644 --- a/libffi/Makefile.am +++ b/libffi/Makefile.am @@ -1,18 +1,10 @@ ## Process this with automake to create Makefile.in -AUTOMAKE_OPTIONS = foreign subdir-objects +AUTOMAKE_OPTIONS = foreign subdir-objects info-in-builddir -ACLOCAL_AMFLAGS = -I m4 +ACLOCAL_AMFLAGS = -I .. -I ../config SUBDIRS = include testsuite man -if BUILD_DOCS -## This hack is needed because it doesn't seem possible to make a -## conditional info_TEXINFOS in Automake. At least Automake 1.14 -## either gives errors -- if this attempted in the most -## straightforward way -- or simply unconditionally tries to build the -## info file. -SUBDIRS += doc -endif EXTRA_DIST = LICENSE ChangeLog.old \ m4/libtool.m4 m4/lt~obsolete.m4 \ @@ -26,6 +18,90 @@ EXTRA_DIST = LICENSE ChangeLog.old \ # local.exp is generated by configure DISTCLEANFILES = local.exp +# Automake Documentation: +# If your package has Texinfo files in many directories, you can use the +# variable TEXINFO_TEX to tell Automake where to find the canonical +# `texinfo.tex' for your package. The value of this variable should be +# the relative path from the current `Makefile.am' to `texinfo.tex'. +TEXINFO_TEX = ../gcc/doc/include/texinfo.tex + +# Defines info, dvi, pdf and html targets +MAKEINFOFLAGS = -I $(srcdir)/../gcc/doc/include +info_TEXINFOS = doc/libffi.texi + +# AM_CONDITIONAL on configure option --generated-files-in-srcdir +if GENINSRC +STAMP_GENINSRC = stamp-geninsrc +else +STAMP_GENINSRC = +endif + +# AM_CONDITIONAL on configure check ACX_CHECK_PROG_VER([MAKEINFO]) +if BUILD_DOCS +STAMP_BUILD_INFO = stamp-build-info +else +STAMP_BUILD_INFO = +endif + +all-local: $(STAMP_GENINSRC) + +stamp-geninsrc: doc/libffi.info + cp -p $(top_builddir)/doc/libffi.info $(srcdir)/doc/libffi.info + @touch $@ + +doc/libffi.info: $(STAMP_BUILD_INFO) + +stamp-build-info: doc/libffi.texi $(srcdir)/doc/version.texi doc/$(am__dirstamp) + $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)/doc -o doc/libffi.info $(srcdir)/doc/libffi.texi + @touch $@ + +CLEANFILES = $(STAMP_GENINSRC) $(STAMP_BUILD_INFO) +MAINTAINERCLEANFILES = $(srcdir)/doc/libffi.info + +## ################################################################ + +## +## This section is for make and multilib madness. +## + +# Work around what appears to be a GNU make bug handling MAKEFLAGS +# values defined in terms of make variables, as is the case for CC and +# friends when we are called from the top level Makefile. +AM_MAKEFLAGS = \ + "AR_FLAGS=$(AR_FLAGS)" \ + "CC_FOR_BUILD=$(CC_FOR_BUILD)" \ + "CFLAGS=$(CFLAGS)" \ + "CXXFLAGS=$(CXXFLAGS)" \ + "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \ + "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \ + "INSTALL=$(INSTALL)" \ + "INSTALL_DATA=$(INSTALL_DATA)" \ + "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ + "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \ + "JC1FLAGS=$(JC1FLAGS)" \ + "LDFLAGS=$(LDFLAGS)" \ + "LIBCFLAGS=$(LIBCFLAGS)" \ + "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \ + "MAKE=$(MAKE)" \ + "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \ + "PICFLAG=$(PICFLAG)" \ + "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \ + "RUNTESTFLAGS=$(RUNTESTFLAGS)" \ + "SHELL=$(SHELL)" \ + "exec_prefix=$(exec_prefix)" \ + "infodir=$(infodir)" \ + "libdir=$(libdir)" \ + "mandir=$(mandir)" \ + "prefix=$(prefix)" \ + "AR=$(AR)" \ + "AS=$(AS)" \ + "CC=$(CC)" \ + "CXX=$(CXX)" \ + "LD=$(LD)" \ + "NM=$(NM)" \ + "RANLIB=$(RANLIB)" \ + "DESTDIR=$(DESTDIR)" + # Subdir rules rely on $(FLAGS_TO_PASS) FLAGS_TO_PASS = $(AM_MAKEFLAGS) @@ -104,9 +180,9 @@ libffi_convenience_la_LIBADD = $(libffi_la_LIBADD) libffi_convenience_la_DEPENDENCIES = $(libffi_la_DEPENDENCIES) nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES) -LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/libtool-ldflags $(LDFLAGS)) +LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) -AM_CFLAGS = +AM_CFLAGS = -Wall -g -fexceptions if FFI_DEBUG # Build debug. Define FFI_DEBUG on the commandline so that, when building with # MSVC, it can link against the debug CRT. @@ -121,9 +197,9 @@ endif if LIBFFI_BUILD_VERSIONED_SHLIB_SUN libffi_version_script = -Wl,-M,libffi.map-sun libffi_version_dep = libffi.map-sun -libffi.map-sun : libffi.map $(top_srcdir)/make_sunver.pl \ +libffi.map-sun : libffi.map $(top_srcdir)/../contrib/make_sunver.pl \ $(libffi_la_OBJECTS) $(libffi_la_LIBADD) - perl $(top_srcdir)/make_sunver.pl libffi.map \ + perl $(top_srcdir)/../contrib/make_sunver.pl libffi.map \ `echo $(libffi_la_OBJECTS) $(libffi_la_LIBADD) | \ sed 's,\([^/ ]*\)\.l\([ao]\),.libs/\1.\2,g'` \ > $@ || (rm -f $@ ; exit 1) @@ -144,8 +220,12 @@ libffi_la_DEPENDENCIES = $(libffi_la_LIBADD) $(libffi_version_dep) AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src AM_CCASFLAGS = $(AM_CPPFLAGS) -dist-hook: - d=`(cd $(distdir); pwd)`; (cd doc; make pdf; cp *.pdf $$d/doc) - 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 diff --git a/libffi/configure.ac b/libffi/configure.ac index 70f6d2c2ea4..d67b205ea92 100644 --- a/libffi/configure.ac +++ b/libffi/configure.ac @@ -5,18 +5,30 @@ AC_PREREQ(2.68) AC_INIT([libffi], [3.4.2], [http://github.com/libffi/libffi/issues]) AC_CONFIG_HEADERS([fficonfig.h]) +AM_ENABLE_MULTILIB(, ..) + AC_CANONICAL_SYSTEM target_alias=${target_alias-$host_alias} -case "${host}" in - frv*-elf) - LDFLAGS=`echo $LDFLAGS | sed "s/\-B[^ ]*libgloss\/frv\///"`\ -B`pwd`/../libgloss/frv/ - ;; -esac - -AX_ENABLE_BUILDDIR - -AM_INIT_AUTOMAKE +AM_INIT_AUTOMAKE([no-dist]) + +# We would like our source tree to be readonly. However when releases or +# pre-releases are generated, the flex/bison generated files as well as the +# various formats of manuals need to be included along with the rest of the +# sources. Therefore we have --enable-generated-files-in-srcdir to do +# just that. +AC_MSG_CHECKING(generated-files-in-srcdir) +AC_ARG_ENABLE(generated-files-in-srcdir, +AS_HELP_STRING([--enable-generated-files-in-srcdir], + [put copies of generated files in source dir intended for creating source tarballs for users without texinfo bison or flex]), +[case "$enableval" in + yes) enable_generated_files_in_srcdir=yes ;; + no) enable_generated_files_in_srcdir=no ;; + *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);; + esac], +[enable_generated_files_in_srcdir=no]) +AC_MSG_RESULT($enable_generated_files_in_srcdir) +AM_CONDITIONAL(GENINSRC, test "$enable_generated_files_in_srcdir" = yes) # The same as in boehm-gc and libstdc++. Have to borrow it from there. # We must force CC to /not/ be precious variables; otherwise @@ -39,25 +51,12 @@ AC_SUBST(CFLAGS) AM_PROG_AS AM_PROG_CC_C_O AC_PROG_LIBTOOL -AC_CONFIG_MACRO_DIR([m4]) AC_CHECK_TOOL(READELF, readelf) # Test for 64-bit build. AC_CHECK_SIZEOF([size_t]) -AX_COMPILER_VENDOR -AX_CC_MAXOPT -# The AX_CFLAGS_WARN_ALL macro doesn't currently work for sunpro -# compiler. -if test "$ax_cv_c_compiler_vendor" != "sun"; then - AX_CFLAGS_WARN_ALL -fi - -if test "x$GCC" = "xyes"; then - CFLAGS="$CFLAGS -fexceptions" -fi - cat > local.exp < conftest.c - if $CC $CFLAGS -c -fpic -fexceptions $libffi_cv_no_lto -o conftest.o conftest.c > /dev/null 2>&1; then + if $CC $CFLAGS -c -fpic -fexceptions -fno-lto -o conftest.o conftest.c > /dev/null 2>&1; then if $READELF -WS conftest.o | grep -q -n 'eh_frame .* WA'; then libffi_cv_ro_eh_frame=no fi @@ -306,12 +298,12 @@ if test "x$GCC" = "xyes"; then fi fi -AC_ARG_ENABLE(docs, - AC_HELP_STRING([--disable-docs], - [Disable building of docs (default: no)]), - [enable_docs=no], - [enable_docs=yes]) -AM_CONDITIONAL(BUILD_DOCS, [test x$enable_docs = xyes]) +# See if makeinfo has been installed and is modern enough +# that we can use it. +ACX_CHECK_PROG_VER([MAKEINFO], [makeinfo], [--version], + [GNU texinfo.* \([0-9][0-9.]*\)], + [4.[4-9]*|4.[1-9][0-9]*|[5-9]*|[1-9][0-9]*]) +AM_CONDITIONAL(BUILD_DOCS, test $gcc_cv_prog_makeinfo_modern = "yes") AH_BOTTOM([ #ifdef HAVE_HIDDEN_VISIBILITY_ATTRIBUTE @@ -386,47 +378,51 @@ AC_ARG_ENABLE(purify-safety, AC_DEFINE(USING_PURIFY, 1, [Define this if you are using Purify and want to suppress spurious messages.]) fi) -AC_ARG_ENABLE(multi-os-directory, -[ --disable-multi-os-directory - disable use of gcc --print-multi-os-directory to change the library installation directory]) - -# These variables are only ever used when we cross-build to X86_WIN32. -# And we only support this with GCC, so... -if test "x$GCC" = "xyes"; then - if test -n "$with_cross_host" && - test x"$with_cross_host" != x"no"; then - toolexecdir='${exec_prefix}'/'$(target_alias)' - toolexeclibdir='${toolexecdir}'/lib - else - toolexecdir='${libdir}'/gcc-lib/'$(target_alias)' - toolexeclibdir='${libdir}' - fi - if test x"$enable_multi_os_directory" != x"no"; then - multi_os_directory=`$CC $CFLAGS -print-multi-os-directory` - case $multi_os_directory in - .) ;; # Avoid trailing /. - ../*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;; - esac - fi - AC_SUBST(toolexecdir) +GCC_WITH_TOOLEXECLIBDIR + +if test -n "$with_cross_host" && + test x"$with_cross_host" != x"no"; then + toolexecdir='$(exec_prefix)/$(target_alias)' + case ${with_toolexeclibdir} in + no) + toolexeclibdir='$(toolexecdir)/lib' + ;; + *) + toolexeclibdir=${with_toolexeclibdir} + ;; + esac else - toolexeclibdir='${libdir}' + toolexecdir='$(libdir)/gcc-lib/$(target_alias)' + toolexeclibdir='$(libdir)' fi +multi_os_directory=`$CC -print-multi-os-directory` +case $multi_os_directory in + .) ;; # Avoid trailing /. + *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;; +esac +AC_SUBST(toolexecdir) AC_SUBST(toolexeclibdir) +if test "${multilib}" = "yes"; then + multilib_arg="--enable-multilib" +else + multilib_arg= +fi + # Check linker support. LIBFFI_ENABLE_SYMVERS +# Determine what GCC version number to use in filesystem paths. +GCC_BASE_VER + AC_CONFIG_COMMANDS(include, [test -d include || mkdir include]) AC_CONFIG_COMMANDS(src, [ test -d src || mkdir src test -d src/$TARGETDIR || mkdir src/$TARGETDIR ], [TARGETDIR="$TARGETDIR"]) -AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile doc/Makefile libffi.pc) +AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc) -AC_OUTPUT +AC_CONFIG_LINKS(include/ffitarget.h:src/$TARGETDIR/ffitarget.h) -# Copy this file instead of using AC_CONFIG_LINK in order to support -# compiling with MSVC, which won't understand cygwin style symlinks. -cp ${srcdir}/src/$TARGETDIR/ffitarget.h include/ffitarget.h +AC_OUTPUT diff --git a/libffi/include/Makefile.am b/libffi/include/Makefile.am index 5f0d4066f4a..d7d1641f00c 100644 --- a/libffi/include/Makefile.am +++ b/libffi/include/Makefile.am @@ -6,4 +6,8 @@ DISTCLEANFILES=ffitarget.h noinst_HEADERS=ffi_common.h ffi_cfi.h tramp.h EXTRA_DIST=ffi.h.in -nodist_include_HEADERS = ffi.h ffitarget.h +# Where generated headers like ffitarget.h get installed. +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) +toollibffidir := $(libdir)/gcc/$(target_alias)/$(gcc_version)/include + +toollibffi_HEADERS = ffi.h ffitarget.h From patchwork Tue Aug 31 15:36:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 1522679 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=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=TyF0Bjyz; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GzWXb3R4pz9s24 for ; Wed, 1 Sep 2021 01:37:34 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DFA523857C73 for ; Tue, 31 Aug 2021 15:37:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DFA523857C73 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1630424251; bh=J6+Vdc97NYPD4X9ZwdcktqBEX6hmoTCKtHVgoWl9WNU=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=TyF0BjyzanS1t9GyX7usrdKyUOzOSdahfYuwQSHuT8Ki1DzG/GRmBlTUznbovXDfV W/ym82uM8R7WiYxujsXdlLPpaR0Ap5y+4pmSyztXYxQborogw6EkKdkeUh0kE37oPq q+0I7Oz6jhMo472KCPNNP4LoBu7NXVgKdlBT1tJc= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by sourceware.org (Postfix) with ESMTPS id E1B35385840B for ; Tue, 31 Aug 2021 15:37:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E1B35385840B Received: by mail-pg1-x529.google.com with SMTP id s11so17090773pgr.11 for ; Tue, 31 Aug 2021 08:37:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=J6+Vdc97NYPD4X9ZwdcktqBEX6hmoTCKtHVgoWl9WNU=; b=lXYHDMHHRc48cyEa98Y1VFfgDL2E3KHMm60bcARYlpSYKFkXZ0sdr0YNxF0jJ6R8xR JzESt65teeWQ3iYXX8G/ZLMP8r9OlUgq+jzEB3SI3LoE81gniJx4Qg3kMHQgrz/E9hcU Hlz3jz3tOUP6QJ0S6uHSAMJHG2m8s4n44kE//aTuqTTe8IKWUmUj+G0tN65NGNEjZT8O 8+N/Pn8eMrwBQo8f/hx1SEwbKW6U+DEMf8E5OWY/pLh3ki6nmdIDErK9vyoewY6on78l 1Z9XSUx8EhyxpPHbcPEc2ojqbN1LZtL4aNmMoLId4r+mVSkUE0EYYaxbe9mDCx/jihEi Aoig== X-Gm-Message-State: AOAM531QVssLqrTXyr/hncjSBoV/bgvV9V1UUQpyHb2w/FfWtCV0zW6G v846ybjgx/WUzGKi/EmkG7pLqhftWAg= X-Google-Smtp-Source: ABdhPJxQ5Zh43pttbUC/76fBxs2DU4cP1zLfh9956wh9xcff2kY60F9Uq/W0L3+1u0ShtsB66svRuQ== X-Received: by 2002:a63:1504:: with SMTP id v4mr27300635pgl.151.1630424221668; Tue, 31 Aug 2021 08:37:01 -0700 (PDT) Received: from gnu-cfl-2.localdomain ([172.58.38.240]) by smtp.gmail.com with ESMTPSA id k20sm19434306pfu.133.2021.08.31.08.37.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Aug 2021 08:37:01 -0700 (PDT) Received: from gnu-cfl-2.. (localhost [IPv6:::1]) by gnu-cfl-2.localdomain (Postfix) with ESMTP id E961BC035E; Tue, 31 Aug 2021 08:36:59 -0700 (PDT) To: gcc-patches@gcc.gnu.org Subject: [PATCH 4/4] libffi: Integrate testsuite with GCC testsuite Date: Tue, 31 Aug 2021 08:36:59 -0700 Message-Id: <20210831153659.3756892-5-hjl.tools@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210831153659.3756892-1-hjl.tools@gmail.com> References: <20210831153659.3756892-1-hjl.tools@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-3031.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, RCVD_IN_ABUSEAT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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-Patchwork-Original-From: "H.J. Lu via Gcc-patches" From: "H.J. Lu" Reply-To: "H.J. Lu" Cc: Jakub Jelinek Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" --- libffi/testsuite/lib/libffi.exp | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/libffi/testsuite/lib/libffi.exp b/libffi/testsuite/lib/libffi.exp index 4f4dd48d2c6..d8bf6269a36 100644 --- a/libffi/testsuite/lib/libffi.exp +++ b/libffi/testsuite/lib/libffi.exp @@ -15,12 +15,15 @@ # . proc load_gcc_lib { filename } { - global srcdir - load_file $srcdir/lib/$filename + global srcdir loaded_libs + load_file $srcdir/../../gcc/testsuite/lib/$filename + set loaded_libs($filename) "" } load_lib dg.exp load_lib libgloss.exp +load_gcc_lib target-supports.exp +load_gcc_lib target-supports-dg.exp load_gcc_lib target-libpath.exp load_gcc_lib wrapper.exp @@ -277,6 +280,7 @@ proc libffi-init { args } { global srcdir global blddirffi global objdir + global blddircxx global TOOL_OPTIONS global tool global libffi_include @@ -285,13 +289,13 @@ proc libffi-init { args } { global ld_library_path global compiler_vendor - if ![info exists blddirffi] { - set blddirffi [pwd]/.. - } - + set blddirffi [lookfor_file [get_multilibs] libffi] verbose "libffi $blddirffi" + set blddircxx [lookfor_file [get_multilibs] libstdc++-v3] + verbose "libstdc++ $blddircxx" + + set compiler_vendor "gnu" - # Which compiler are we building with? if { [string match $compiler_vendor "gnu"] } { set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a] if {$gccdir != ""} { @@ -320,6 +324,8 @@ proc libffi-init { args } { # add the library path for libffi. append ld_library_path ":${blddirffi}/.libs" + # add the library path for libstdc++ as well. + append ld_library_path ":${blddircxx}/src/.libs" verbose "ld_library_path: $ld_library_path" @@ -332,6 +338,7 @@ proc libffi-init { args } { if { $libffi_dir != "" } { set libffi_dir [file dirname ${libffi_dir}] set libffi_link_flags "-L${libffi_dir}/.libs" + lappend libffi_link_flags "-L${blddircxx}/src/.libs" } set_ld_library_path_env_vars @@ -398,9 +405,8 @@ proc libffi_target_compile { source dest type options } { lappend options "libs= -lpthread" } - # this may be required for g++, but just confused clang. if { [string match "*.cc" $source] } { - lappend options "c++" + lappend options "ldflags=-lstdc++" } if { [string match "arc*-*-linux*" $target_triplet] } {