diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2021-08-30 14:36:52 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2021-10-20 05:35:52 -0700 |
commit | d738405e7fe62cc8eb9580948a6ea39005cd7170 (patch) | |
tree | ce5e9cb12024b7472027a7a77cce2d3bb101ddac /libffi | |
parent | Rename asm_out_file function arguments. (diff) | |
download | gcc-d738405e7fe62cc8eb9580948a6ea39005cd7170.tar.gz gcc-d738405e7fe62cc8eb9580948a6ea39005cd7170.tar.bz2 gcc-d738405e7fe62cc8eb9580948a6ea39005cd7170.tar.xz |
libffi: Add HOWTO_MERGE, autogen.sh and merge.sh
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 and remove old files if needed.
* HOWTO_MERGE: New file.
* autogen.sh: Likewise.
* merge.sh: Likewise.
Diffstat (limited to 'libffi')
-rw-r--r-- | libffi/HOWTO_MERGE | 13 | ||||
-rwxr-xr-x | libffi/autogen.sh | 11 | ||||
-rwxr-xr-x | libffi/merge.sh | 51 |
3 files changed, 75 insertions, 0 deletions
diff --git a/libffi/HOWTO_MERGE b/libffi/HOWTO_MERGE new file mode 100644 index 00000000000..5b92b10c15c --- /dev/null +++ b/libffi/HOWTO_MERGE | |||
@@ -0,0 +1,13 @@ | |||
1 | In general, merging process should not be very difficult, but we need to | ||
2 | track GCC-specific patches carefully. Here is a general list of actions | ||
3 | required to perform the merge: | ||
4 | |||
5 | * Checkout recent GCC tree. | ||
6 | * Run merge.sh script from the libffi directory. | ||
7 | * Add new files and remove old files if needed. | ||
8 | * Apply all needed GCC-specific patches to libffi (note that some of | ||
9 | them might be already included to upstream). The list of these patches | ||
10 | is stored into LOCAL_PATCHES file. May need to re-run autogen.sh to | ||
11 | regenerate configure and Makefile.in files. | ||
12 | * Send your patches for review to GCC Patches Mailing List (gcc-patches@gcc.gnu.org). | ||
13 | * 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 @@ | |||
1 | #!/bin/sh | ||
2 | #exec autoreconf -v -i | ||
3 | |||
4 | rm -rf autom4te.cache | ||
5 | aclocal -I .. -I ../config | ||
6 | autoheader -I .. -I ../config | ||
7 | autoconf | ||
8 | automake --foreign --add-missing --copy Makefile | ||
9 | automake --foreign include/Makefile | ||
10 | automake --foreign man/Makefile | ||
11 | 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 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | # FIXME: do we need a license (or whatever else) header here? | ||
4 | |||
5 | # This script merges libffi sources from upstream. | ||
6 | |||
7 | # Default to the tip of master branch. | ||
8 | commit=${1-master} | ||
9 | |||
10 | fatal() { | ||
11 | echo "$1" | ||
12 | exit 1; | ||
13 | } | ||
14 | |||
15 | get_upstream() { | ||
16 | rm -rf upstream | ||
17 | git clone https://github.com/libffi/libffi.git upstream | ||
18 | pushd upstream | ||
19 | git checkout $commit || fatal "Failed to checkout $commit" | ||
20 | popd | ||
21 | } | ||
22 | |||
23 | get_current_rev() { | ||
24 | cd upstream | ||
25 | git rev-parse HEAD | ||
26 | } | ||
27 | |||
28 | pwd | grep 'libffi$' || \ | ||
29 | fatal "Run this script from the libffi directory" | ||
30 | get_upstream | ||
31 | CUR_REV=$(get_current_rev) | ||
32 | echo Current upstream revision: $CUR_REV | ||
33 | |||
34 | # Remove the unused files. | ||
35 | pushd upstream | ||
36 | rm -rf ChangeLog.old .appveyor* .ci .github .gitignore .travis* \ | ||
37 | config.guess config.sub libtool-ldflags m4 make_sunver.pl \ | ||
38 | msvc_build | ||
39 | rm -rf .git autogen.sh | ||
40 | cp -a . .. | ||
41 | popd | ||
42 | |||
43 | rm -rf upstream | ||
44 | |||
45 | # Update the MERGE file. | ||
46 | cat << EOF > MERGE | ||
47 | $CUR_REV | ||
48 | |||
49 | The first line of this file holds the git revision number of the | ||
50 | last merge done from the master library sources. | ||
51 | EOF | ||