Skip to content

Commit

Permalink
import libffi-3.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
chai2010 committed Nov 25, 2024
1 parent 4e14ec0 commit 1283057
Show file tree
Hide file tree
Showing 418 changed files with 91,109 additions and 0 deletions.
84 changes: 84 additions & 0 deletions libffi/.appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
shallow_clone: true

# We're currently only testing libffi built with Microsoft's
# tools.
# This matrix should be expanded to include at least:
# 32- and 64-bit gcc/cygwin
# 32- and 64-bit gcc/mingw
# 32- and 64-bit clang/mingw
# and perhaps more.

image: Visual Studio 2017
platform:
- x64
- x86
- arm
- arm64

configuration:
- Debug
- Release

environment:
global:
CYG_ROOT: C:/cygwin64
CYG_CACHE: C:/cygwin64/var/cache/setup
CYG_MIRROR: http://mirrors.kernel.org/sourceware/cygwin/
VSVER: 15
matrix:
- SHARED_ARG: "--enable-shared --disable-static"
- SHARED_ARG: "--enable-static --disable-shared"

install:
- ps: >-
If ($env:Platform -Match "x86") {
$env:VCVARS_PLATFORM="x86"
$env:BUILD="i686-pc-cygwin"
$env:HOST="i686-pc-cygwin"
$env:MSVCC="/cygdrive/c/projects/libffi/msvcc.sh"
$env:SRC_ARCHITECTURE="x86"
} ElseIf ($env:Platform -Match "arm64") {
$env:VCVARS_PLATFORM="x86_arm64"
$env:BUILD="i686-pc-cygwin"
$env:HOST="aarch64-w64-cygwin"
$env:MSVCC="/cygdrive/c/projects/libffi/msvcc.sh -marm64"
$env:SRC_ARCHITECTURE="aarch64"
} ElseIf ($env:Platform -Match "arm") {
$env:VCVARS_PLATFORM="x86_arm"
$env:BUILD="i686-pc-cygwin"
$env:HOST="arm-w32-cygwin"
$env:MSVCC="/cygdrive/c/projects/libffi/msvcc.sh -marm"
$env:SRC_ARCHITECTURE="arm"
} Else {
$env:VCVARS_PLATFORM="amd64"
$env:BUILD="x86_64-w64-cygwin"
$env:HOST="x86_64-w64-cygwin"
$env:MSVCC="/cygdrive/c/projects/libffi/msvcc.sh -m64"
$env:SRC_ARCHITECTURE="x86"
}
If ($env:Configuration -Match "Debug") {
$env:DEBUG_ARG="--enable-debug"
} Else {
$env:DEBUG_ARG="--disable-debug"
}
- 'appveyor DownloadFile https://cygwin.com/setup-x86_64.exe -FileName setup.exe'
- 'setup.exe -qgnNdO -R "%CYG_ROOT%" -s "%CYG_MIRROR%" -l "%CYG_CACHE%" -P dejagnu -P autoconf -P automake -P libtool'
- '%CYG_ROOT%/bin/bash -lc "cygcheck -dc cygwin"'
- echo call VsDevCmd to set VS150COMNTOOLS
- call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat"
- ps: $env:VSCOMNTOOLS=(Get-Content ("env:VS" + "$env:VSVER" + "0COMNTOOLS"))
- echo "Using Visual Studio %VSVER%.0 at %VSCOMNTOOLS%"
- call "%VSCOMNTOOLS%..\..\vc\Auxiliary\Build\vcvarsall.bat" %VCVARS_PLATFORM%

build_script:
- c:\cygwin64\bin\sh -lc "(cd $OLDPWD; ./autogen.sh)"
- c:\cygwin64\bin\sh -lc "(cd $OLDPWD; ./configure CC='%MSVCC%' CXX='%MSVCC%' LD='link' CPP='cl -nologo -EP' CXXCPP='cl -nologo -EP' CPPFLAGS='-DFFI_BUILDING_DLL' AR='/cygdrive/c/projects/libffi/.travis/ar-lib lib' NM='dumpbin -symbols' STRIP=':' --build=$BUILD --host=$HOST $DEBUG_ARG $SHARED_ARG)"
- c:\cygwin64\bin\sh -lc "(cd $OLDPWD; cp src/%SRC_ARCHITECTURE%/ffitarget.h include)"
- c:\cygwin64\bin\sh -lc "(cd $OLDPWD; make)"
- c:\cygwin64\bin\sh -lc "(cd $OLDPWD; cp $HOST/.libs/libffi.lib $HOST/testsuite/libffi-8.lib || true)"
- c:\cygwin64\bin\sh -lc "(cd $OLDPWD; cp `find . -name 'libffi-?.dll'` $HOST/testsuite/ || true)"
- c:\cygwin64\bin\sh -lc "(cd $OLDPWD; TERM=none make check RUNTESTFLAGS='-v -v -v -v --target '$HOST DEJAGNU=$PWD/.appveyor/site.exp SITEDIR=$PWD/.appveyor)"


on_finish:
- c:\cygwin64\bin\sh -lc "(cd $OLDPWD; cat `find ./ -name libffi.log`)"
16 changes: 16 additions & 0 deletions libffi/.appveyor/site.exp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright (C) 2021 Anthony Green

lappend boards_dir $::env(SITEDIR)

verbose "Global Config File: target_triplet is $target_triplet" 1
global target_list

case "$target_triplet" in {
{ "aarch*cygwin*" } {
set target_list "unix-noexec"
}
{ "arm*cygwin*" } {
set target_list "unix-noexec"
}
}

7 changes: 7 additions & 0 deletions libffi/.appveyor/unix-noexec.exp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
load_generic_config "remote"

proc noexec_load { dest prog args } {
return "unsupported"
}

set_board_info protocol "noexec"
4 changes: 4 additions & 0 deletions libffi/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* text=auto

*.sln text eol=crlf
*.vcxproj* text eol=crlf
10 changes: 10 additions & 0 deletions libffi/.github/issue_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## System Details

<!--- What platform are you working with? eg. the output of config.guess -->
<!--- Provide any toolchain details here. eg. compiler version -->

## Problems Description

<!--- Provide a description of the problem here -->
<!--- If this is a configure-time problem, attach config.log -->
<!--- If this is a testsuite problem, attach the relevant log output -->
37 changes: 37 additions & 0 deletions libffi/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
.libs
.deps
*.o
*.lo
.dirstamp
*.la
Makefile
!testsuite/libffi.bhaible/Makefile
Makefile.in
aclocal.m4
compile
!.travis/compile
configure
depcomp
doc/libffi.info
*~
fficonfig.h.in
fficonfig.h
include/ffi.h
include/ffitarget.h
install-sh
libffi.pc
libtool
ltmain.sh
m4/libtool.m4
m4/lt*.m4
mdate-sh
missing
stamp-h1
libffi*gz
autom4te.cache
libffi.xcodeproj/xcuserdata
libffi.xcodeproj/project.xcworkspace
build_*/
darwin_*/
src/arm/trampoline.S
**/texinfo.tex
83 changes: 83 additions & 0 deletions libffi/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
sudo: required

language: cpp

# For qemu-powered targets, get the list of supported processors from
# travis by setting QEMU_CPU=help, then set -mcpu= for the compilers
# accordingly.

matrix:
include:
- os: linux
env: HOST=powerpc-eabisim RUNTESTFLAGS="--target_board powerpc-eabisim" DEJAGNU="/opt/.travis/site.exp"
- os: linux
env: HOST=or1k-elf RUNTESTFLAGS="--target_board or1k-sim" DEJAGNU="/opt/.travis/site.exp"
- os: linux
env: HOST=m32r-elf RUNTESTFLAGS="--target_board m32r-sim" DEJAGNU="/opt/.travis/site.exp"
- os: linux
env: HOST=bfin-elf RUNTESTFLAGS="--target_board bfin-sim" DEJAGNU="/opt/.travis/site.exp"
# This configuration is still using the native x86 toolchain?
# - os: osx
# env: HOST=aarch64-apple-darwin13
- os: osx
env: HOST=x86_64-apple-darwin10
- os: linux
env: HOST=x86_64-w64-mingw32 MEVAL='export CC="x86_64-w64-mingw32-gcc" && CXX="x86_64-w64-mingw32-g++" RUNTESTFLAGS="--target_board wine-sim" DEJAGNU="$TRAVIS_BUILD_DIR/.travis/site.exp" CONFIGURE_OPTIONS=--disable-shared LIBFFI_TEST_OPTIMIZATION="-O2"
- os: linux
env: HOST=sh4-linux-gnu CONFIGURE_OPTIONS=--disable-shared QEMU_LD_PREFIX=/usr/sh4-linux-gnu
- os: linux
env: HOST=alpha-linux-gnu CONFIGURE_OPTIONS=--disable-shared QEMU_LD_PREFIX=/usr/alpha-linux-gnu
- os: linux
env: HOST=m68k-linux-gnu MEVAL='export CC="m68k-linux-gnu-gcc-8 -mcpu=547x" && CXX="m68k-linux-gnu-g++-8 -mcpu=547x"' CONFIGURE_OPTIONS=--disable-shared QEMU_LD_PREFIX=/usr/m68k-linux-gnu QEMU_CPU=cfv4e
- os: linux
arch: s390x
env: HOST=s390x-linux-gnu
- os: linux
arch: ppc64le
env: HOST=ppc64le-linux-gnu
- os: linux
arch: arm64
env: HOST=aarch64-linux-gnu
- os: linux
arch: arm64
env: HOST=aarch64-linux-gnu
compiler: clang
- os: linux
env: HOST=arm32v7-linux-gnu LIBFFI_TEST_OPTIMIZATION="-O0"
- os: linux
env: HOST=arm32v7-linux-gnu LIBFFI_TEST_OPTIMIZATION="-O2"
- os: linux
env: HOST=arm32v7-linux-gnu LIBFFI_TEST_OPTIMIZATION="-O2 -fomit-frame-pointer"
# The sparc64 linux system in the GCC compile farm is non-responsive.
# - os: linux
# env: HOST=sparc64-linux-gnu
# The mips64 linux system in the GCC compile farm is not allowing logins
# - os: linux
# env: HOST=mips64el-linux-gnu
- os: linux
compiler: gcc
env: HOST=i386-pc-linux-gnu MEVAL='export CC="$CC -m32" && CXX="$CXX -m32"'
- os: linux
compiler: gcc
- os: linux
compiler: gcc
env: CONFIGURE_OPTIONS=--disable-shared
- os: linux
compiler: clang
- os: linux
compiler: clang
env: CONFIGURE_OPTIONS=--disable-shared
- os: linux
env: HOST=moxie-elf MEVAL='export PATH=/opt/moxielogic/bin:$PATH && CC=moxie-elf-gcc && CXX=moxie-elf-g++' LDFLAGS=-Tsim.ld RUNTESTFLAGS="--target_board moxie-sim" DEJAGNU="$TRAVIS_BUILD_DIR/.travis/site.exp"

before_install:
- if test x"$MEVAL" != x; then eval ${MEVAL}; fi

install:
- travis_wait 60 ./.travis/install.sh

script:
- if ! test x"$MEVAL" = x; then eval ${MEVAL}; fi
- travis_wait 115 sleep infinity &
- ./.travis/build.sh
Loading

0 comments on commit 1283057

Please sign in to comment.