Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 35a5081

Browse files
committed
Import libffi master
1 parent 82244f9 commit 35a5081

34 files changed

+1824
-138
lines changed

.appveyor.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ platform:
1313
- x64
1414
- x86
1515
- arm
16+
- arm64
1617

1718
environment:
1819
global:
@@ -30,6 +31,12 @@ install:
3031
$env:HOST="i686-pc-cygwin"
3132
$env:MSVCC="/cygdrive/c/projects/libffi/msvcc.sh"
3233
$env:SRC_ARCHITECTURE="x86"
34+
} ElseIf ($env:Platform -Match "arm64") {
35+
$env:VCVARS_PLATFORM="x86_arm64"
36+
$env:BUILD="i686-pc-cygwin"
37+
$env:HOST="aarch64-w64-cygwin"
38+
$env:MSVCC="/cygdrive/c/projects/libffi/msvcc.sh -marm64"
39+
$env:SRC_ARCHITECTURE="aarch64"
3340
} ElseIf ($env:Platform -Match "arm") {
3441
$env:VCVARS_PLATFORM="x86_arm"
3542
$env:BUILD="i686-pc-cygwin"
@@ -40,7 +47,7 @@ install:
4047
$env:VCVARS_PLATFORM="amd64"
4148
$env:BUILD="x86_64-w64-cygwin"
4249
$env:HOST="x86_64-w64-cygwin"
43-
$env:ASSEMBLER="/cygdrive/c/projects/libffi/msvcc.sh -m64"
50+
$env:MSVCC="/cygdrive/c/projects/libffi/msvcc.sh -m64"
4451
$env:SRC_ARCHITECTURE="x86"
4552
}
4653
- 'appveyor DownloadFile https://cygwin.com/setup-x86.exe -FileName setup.exe'

.gitattributes

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
# Make everything a binary data types
2-
* binary
3-
*.* binary
1+
* text=auto
2+
3+
*.sln text eol=crlf
4+
*.vcxproj* text eol=crlf

.travis/build.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,16 @@ function build_linux()
1010
make
1111
make dist
1212
make check RUNTESTFLAGS="-a $RUNTESTFLAGS"
13-
cat */testsuite/libffi.log
13+
14+
gzip -c -9 */testsuite/libffi.log > libffi.log.gz
15+
echo ================================================================
16+
echo The logs are too long for travis to handle, so we compress and
17+
echo uuencode them. Download, decode and uncompress if you need to
18+
echo read them.
19+
echo ================================================================
20+
uuencode libffi.log.gz -
21+
echo ================================================================
22+
echo ================================================================
1423
}
1524

1625
function build_ios()

.travis/install.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@ if [[ $TRAVIS_OS_NAME != 'linux' ]]; then
88
brew install libtool dejagnu;
99
else
1010
sudo apt-get update
11-
sudo apt-get install dejagnu texinfo
11+
sudo apt-get install dejagnu texinfo sharutils
1212
case "$HOST" in
1313
i386-pc-linux-gnu)
1414
sudo apt-get install gcc-multilib g++-multilib
1515
;;
1616
moxie-elf)
17-
echo 'deb http://repos.moxielogic.org:7114/MoxieLogic moxiedev main' | sudo tee -a /etc/apt/sources.list
18-
sudo apt-get update -qq
17+
echo 'deb https://repos.moxielogic.org:7114/MoxieLogic moxiedev main' | sudo tee -a /etc/apt/sources.list
18+
sudo apt-get clean # clear the cache
19+
sudo apt-get update ## -qq
20+
# debug...
21+
curl https://repos.moxielogic.org:7114/MoxieLogic/dists/moxiedev/main/binary-amd64/Packages
1922
sudo apt-get install -y --allow-unauthenticated moxielogic-moxie-elf-gcc moxielogic-moxie-elf-gcc-c++ moxielogic-moxie-elf-gcc-libstdc++ moxielogic-moxie-elf-gdb-sim
2023
;;
2124
esac

Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ noinst_HEADERS = \
7979

8080
EXTRA_libffi_la_SOURCES = \
8181
src/aarch64/ffi.c src/aarch64/sysv.S \
82+
src/aarch64/win64_armasm.S \
8283
src/alpha/ffi.c src/alpha/osf.S \
8384
src/arc/ffi.c src/arc/arcompact.S \
8485
src/arm/ffi.c src/arm/sysv.S \

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ tested:
5151
| --------------- | ---------------- | ----------------------- |
5252
| AArch64 (ARM64) | iOS | Clang |
5353
| AArch64 | Linux | GCC |
54+
| AArch64 | Windows | MSVC |
5455
| Alpha | Linux | GCC |
5556
| Alpha | Tru64 | GCC |
5657
| ARC | Linux | GCC |
@@ -169,6 +170,11 @@ remove the line in configure that sets 'fix_srcfile_path' to a 'cygpath'
169170
command. ('cygpath' is not present in MingW, and is not required when
170171
using MingW-style paths.)
171172

173+
To build static library for ARM64 with MSVC using visual studio solution, msvc_build folder have
174+
aarch64/Ffi_staticLib.sln
175+
required header files in aarch64/aarch64_include/
176+
177+
172178
SPARC Solaris builds require the use of the GNU assembler and linker.
173179
Point ``AS`` and ``LD`` environment variables at those tool prior to
174180
configuration.
@@ -191,14 +197,13 @@ History
191197

192198
See the git log for details at http://github.com/libffi/libffi.
193199

194-
3.4 TBD
200+
3.3 TBD
195201
Add RISC-V support.
196202
New API in support of GO closures.
197203
Default to Microsoft's 64 bit long double ABI with Visual C++.
198-
GNU compiler uses 80 bits (128 in memory) FFI_GNUW64 ABI.
199-
Many new tests cases and bug fixes.
200-
201-
3.3 Mar-05-19
204+
GNU compiler uses 80 bits (128 in memory) FFI_GNUW64 ABI.
205+
Many new tests cases and bug fixes.
206+
Add windows on arm64 (WOA) support.
202207
Add Windows 32-bit arm support.
203208
204209
3.2.1 Nov-12-14

configure.host

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
# THIS TABLE IS SORTED. KEEP IT THAT WAY.
77
# Most of the time we can define all the variables all at once...
88
case "${host}" in
9+
aarch64*-*-cygwin* | aarch64*-*-mingw* | aarch64*-*-win* )
10+
TARGET=ARM_WIN64; TARGETDIR=aarch64
11+
MSVC=1
12+
;;
13+
914
aarch64*-*-*)
1015
TARGET=AARCH64; TARGETDIR=aarch64
1116
SOURCES="ffi.c sysv.S"
@@ -250,6 +255,9 @@ case "${TARGET}" in
250255
ARM_WIN32)
251256
SOURCES="ffi.c sysv_msvc_arm32.S"
252257
;;
258+
ARM_WIN64)
259+
SOURCES="ffi.c win64_armasm.S"
260+
;;
253261
MIPS)
254262
SOURCES="ffi.c o32.S n32.S"
255263
;;

include/ffi.h.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,11 +283,13 @@ FFI_API size_t ffi_raw_size (ffi_cif *cif);
283283
packing, even on 64-bit machines. I.e. on 64-bit machines longs
284284
and doubles are followed by an empty 64-bit word. */
285285

286+
#if !FFI_NATIVE_RAW_API
286287
FFI_API
287288
void ffi_java_raw_call (ffi_cif *cif,
288289
void (*fn)(void),
289290
void *rvalue,
290291
ffi_java_raw *avalue);
292+
#endif
291293

292294
FFI_API
293295
void ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_java_raw *raw);
@@ -414,6 +416,7 @@ ffi_prep_raw_closure_loc (ffi_raw_closure*,
414416
void *user_data,
415417
void *codeloc);
416418

419+
#if !FFI_NATIVE_RAW_API
417420
FFI_API ffi_status
418421
ffi_prep_java_raw_closure (ffi_java_raw_closure*,
419422
ffi_cif *cif,
@@ -426,6 +429,7 @@ ffi_prep_java_raw_closure_loc (ffi_java_raw_closure*,
426429
void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*),
427430
void *user_data,
428431
void *codeloc);
432+
#endif
429433

430434
#endif /* FFI_CLOSURES */
431435

include/ffi_common.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ ffi_status ffi_prep_cif_core(ffi_cif *cif,
9999
ffi_type *rtype,
100100
ffi_type **atypes);
101101

102+
/* Translate a data pointer to a code pointer. Needed for closures on
103+
some targets. */
104+
void *ffi_data_to_code_pointer (void *data) FFI_HIDDEN;
105+
102106
/* Extended cif, used in callback from assembly routine */
103107
typedef struct
104108
{

m4/asmcfi.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ AC_DEFUN([GCC_AS_CFI_PSEUDO_OP],
22
[AC_CACHE_CHECK([assembler .cfi pseudo-op support],
33
gcc_cv_as_cfi_pseudo_op, [
44
gcc_cv_as_cfi_pseudo_op=unknown
5-
AC_TRY_COMPILE([asm (".cfi_startproc\n\t.cfi_endproc");],,
5+
AC_TRY_COMPILE([asm (".cfi_sections\n\t.cfi_startproc\n\t.cfi_endproc");],,
66
[gcc_cv_as_cfi_pseudo_op=yes],
77
[gcc_cv_as_cfi_pseudo_op=no])
88
])

0 commit comments

Comments
 (0)