ffi 1.11.1 → 1.11.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/{appveyor.yml → .appveyor.yml} +1 -1
  3. data/.gitmodules +2 -2
  4. data/CHANGELOG.md +16 -0
  5. data/Rakefile +1 -0
  6. data/ext/ffi_c/Call.c +3 -3
  7. data/ext/ffi_c/Call.h +2 -2
  8. data/ext/ffi_c/Function.c +4 -4
  9. data/ext/ffi_c/LongDouble.c +7 -7
  10. data/ext/ffi_c/libffi.darwin.mk +1 -1
  11. data/ext/ffi_c/libffi/.appveyor.yml +29 -13
  12. data/ext/ffi_c/libffi/.gitattributes +4 -0
  13. data/ext/ffi_c/libffi/.travis.yml +31 -2
  14. data/ext/ffi_c/libffi/.travis/build-in-container.sh +22 -0
  15. data/ext/ffi_c/libffi/.travis/build.sh +83 -7
  16. data/ext/ffi_c/libffi/.travis/install.sh +32 -11
  17. data/ext/ffi_c/libffi/LICENSE +1 -1
  18. data/ext/ffi_c/libffi/LICENSE-BUILDTOOLS +5 -4
  19. data/ext/ffi_c/libffi/Makefile.am +30 -38
  20. data/ext/ffi_c/libffi/README.md +15 -6
  21. data/ext/ffi_c/libffi/configure.ac +1 -1
  22. data/ext/ffi_c/libffi/configure.host +21 -7
  23. data/ext/ffi_c/libffi/include/ffi.h.in +4 -0
  24. data/ext/ffi_c/libffi/include/ffi_common.h +4 -0
  25. data/ext/ffi_c/libffi/m4/asmcfi.m4 +1 -1
  26. data/ext/ffi_c/libffi/make_sunver.pl +333 -0
  27. data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.sln +33 -0
  28. data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj +130 -0
  29. data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj.filters +57 -0
  30. data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj.user +4 -0
  31. data/ext/ffi_c/libffi/msvc_build/aarch64/aarch64_include/ffi.h +511 -0
  32. data/ext/ffi_c/libffi/msvcc.sh +27 -2
  33. data/ext/ffi_c/libffi/src/aarch64/ffi.c +124 -56
  34. data/ext/ffi_c/libffi/src/aarch64/ffitarget.h +13 -2
  35. data/ext/ffi_c/libffi/src/aarch64/sysv.S +8 -6
  36. data/ext/ffi_c/libffi/src/aarch64/win64_armasm.S +506 -0
  37. data/ext/ffi_c/libffi/src/arm/ffi.c +40 -5
  38. data/ext/ffi_c/libffi/src/arm/ffitarget.h +8 -1
  39. data/ext/ffi_c/libffi/src/arm/sysv.S +2 -0
  40. data/ext/ffi_c/libffi/src/arm/sysv_msvc_arm32.S +311 -0
  41. data/ext/ffi_c/libffi/src/closures.c +32 -8
  42. data/ext/ffi_c/libffi/src/pa/linux.S +23 -2
  43. data/ext/ffi_c/libffi/src/powerpc/ffi.c +3 -2
  44. data/ext/ffi_c/libffi/src/powerpc/ffi_linux64.c +58 -25
  45. data/ext/ffi_c/libffi/src/powerpc/linux64_closure.S +1 -1
  46. data/ext/ffi_c/libffi/src/prep_cif.c +4 -2
  47. data/ext/ffi_c/libffi/src/x86/ffi.c +13 -6
  48. data/ext/ffi_c/libffi/src/x86/ffi64.c +5 -3
  49. data/ext/ffi_c/libffi/src/x86/ffiw64.c +6 -3
  50. data/ext/ffi_c/libffi/src/x86/sysv.S +2 -2
  51. data/ext/ffi_c/libffi/src/x86/sysv_intel.S +995 -0
  52. data/ext/ffi_c/libffi/src/x86/win64.S +5 -0
  53. data/ext/ffi_c/libffi/testsuite/Makefile.am +111 -109
  54. data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +26 -5
  55. data/ext/ffi_c/libffi/testsuite/libffi.call/float2.c +9 -8
  56. data/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c +1 -1
  57. data/ffi.gemspec +1 -1
  58. data/lib/ffi/library.rb +5 -5
  59. data/lib/ffi/platform.rb +4 -1
  60. data/lib/ffi/platform/aarch64-freebsd/types.conf +89 -89
  61. data/lib/ffi/platform/aarch64-freebsd12/types.conf +89 -89
  62. data/lib/ffi/platform/aarch64-linux/types.conf +81 -81
  63. data/lib/ffi/platform/arm-freebsd/types.conf +87 -87
  64. data/lib/ffi/platform/arm-freebsd12/types.conf +87 -87
  65. data/lib/ffi/platform/arm-linux/types.conf +79 -79
  66. data/lib/ffi/platform/i386-cygwin/types.conf +1 -1
  67. data/lib/ffi/platform/i386-darwin/types.conf +63 -63
  68. data/lib/ffi/platform/i386-freebsd/types.conf +87 -87
  69. data/lib/ffi/platform/i386-freebsd12/types.conf +87 -87
  70. data/lib/ffi/platform/i386-gnu/types.conf +84 -84
  71. data/lib/ffi/platform/i386-linux/types.conf +77 -77
  72. data/lib/ffi/platform/i386-netbsd/types.conf +87 -87
  73. data/lib/ffi/platform/i386-openbsd/types.conf +89 -89
  74. data/lib/ffi/platform/i386-solaris/types.conf +96 -96
  75. data/lib/ffi/platform/i386-windows/types.conf +84 -84
  76. data/lib/ffi/platform/ia64-linux/types.conf +79 -79
  77. data/lib/ffi/platform/mips-linux/types.conf +79 -79
  78. data/lib/ffi/platform/mips64-linux/types.conf +81 -81
  79. data/lib/ffi/platform/mips64el-linux/types.conf +81 -81
  80. data/lib/ffi/platform/mipsel-linux/types.conf +79 -79
  81. data/lib/ffi/platform/mipsisa32r6-linux/types.conf +79 -79
  82. data/lib/ffi/platform/mipsisa32r6el-linux/types.conf +79 -79
  83. data/lib/ffi/platform/mipsisa64r6-linux/types.conf +81 -81
  84. data/lib/ffi/platform/mipsisa64r6el-linux/types.conf +81 -81
  85. data/lib/ffi/platform/powerpc-aix/types.conf +155 -155
  86. data/lib/ffi/platform/powerpc-darwin/types.conf +63 -63
  87. data/lib/ffi/platform/powerpc-linux/types.conf +77 -77
  88. data/lib/ffi/platform/powerpc64-linux/types.conf +81 -81
  89. data/lib/ffi/platform/s390-linux/types.conf +79 -79
  90. data/lib/ffi/platform/s390x-linux/types.conf +79 -79
  91. data/lib/ffi/platform/sparc-linux/types.conf +79 -79
  92. data/lib/ffi/platform/sparc-solaris/types.conf +103 -103
  93. data/lib/ffi/platform/sparc64-linux/types.conf +79 -79
  94. data/lib/ffi/platform/sparcv9-solaris/types.conf +103 -103
  95. data/lib/ffi/platform/x86_64-cygwin/types.conf +1 -1
  96. data/lib/ffi/platform/x86_64-darwin/types.conf +84 -84
  97. data/lib/ffi/platform/x86_64-dragonflybsd/types.conf +148 -0
  98. data/lib/ffi/platform/x86_64-freebsd/types.conf +89 -89
  99. data/lib/ffi/platform/x86_64-freebsd12/types.conf +139 -109
  100. data/lib/ffi/platform/x86_64-linux/types.conf +86 -77
  101. data/lib/ffi/platform/x86_64-netbsd/types.conf +89 -89
  102. data/lib/ffi/platform/x86_64-openbsd/types.conf +86 -86
  103. data/lib/ffi/platform/x86_64-solaris/types.conf +96 -96
  104. data/lib/ffi/platform/x86_64-windows/types.conf +99 -99
  105. data/lib/ffi/tools/types_generator.rb +5 -4
  106. data/lib/ffi/version.rb +1 -1
  107. metadata +19 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 041f37e7f1d2ed3857caabe7c68a68d3d8a9b403c5d03e8df59d0277a48f17e2
4
- data.tar.gz: 4c9bcdce1d0ba85318109bb074a0e19c87f5c004440a491d5f532ac2ec20b82c
3
+ metadata.gz: 04c74309ebb2a5097fc2451c48a5e7fee0b8860936802ba3bb451acb772b768a
4
+ data.tar.gz: 4c15514c883db50211a359ab0a08126c0feac0530e2328fbe96abc7dbd242724
5
5
  SHA512:
6
- metadata.gz: 4ae610d83039e9edc3ce4fe3708319cc4c1fc0d8d6dbddc96b4f4b51eec5875fb9052adfce7620664707a73696f3d17c4c1c956037ac252e1924a36fde57ad4c
7
- data.tar.gz: 3a745c80a61c816826ded2c3e29eb13746e1686edcd14f98d06d012d31352b7eaf30e15d9517e662a80beb65f48e1af6e0bceddbf23346d3268ccf6d6ea820ea
6
+ metadata.gz: 1bae5351b7b33d23817ee245894ff31f0c1afffbca4f4ffff42975ea4a61eeab84c0020de2ad0aa81db578379acc7a3bf8713f3415e2d8755809b1ffa32ea1c0
7
+ data.tar.gz: 569166da61cfacb4d96a1bd079eb14533766b0663da2f6cd16845cfbaa8cd41bb736835ffdab339babce31f861e8f2a3a815c43b4e9315fcc4f9890b71aa441a
@@ -23,5 +23,5 @@ environment:
23
23
  EXTCONFOPTS: "--disable-system-libffi"
24
24
  - RUBYVER: 25-x64
25
25
  EXTCONFOPTS: "--enable-system-libffi"
26
- - RUBYVER: 25
26
+ - RUBYVER: 26
27
27
  EXTCONFOPTS: "--enable-system-libffi"
@@ -1,4 +1,4 @@
1
1
  [submodule "ext/ffi_c/libffi"]
2
2
  path = ext/ffi_c/libffi
3
- url = https://github.com/larskanis/libffi.git
4
- branch = fix-stdcall
3
+ url = https://github.com/libffi/libffi.git
4
+ branch = master
@@ -1,3 +1,18 @@
1
+ 1.11.2 / 2019-11-11
2
+ -------------------
3
+
4
+ Added:
5
+ * Add DragonFlyBSD as a platform. #724
6
+
7
+ Changed:
8
+ * Sort all types.conf files, so that files and changes are easier to compare.
9
+ * Regenerated type conf for freebsd12 and x86_64-linux targets. #722
10
+ * Remove MACOSX_DEPLOYMENT_TARGET that was targeting very old version 10.4. #647
11
+ * Fix library name mangling for non glibc Linux/UNIX. #727
12
+ * Fix compiler warnings raised by ruby-2.7
13
+ * Update libffi to latest master.
14
+
15
+
1
16
  1.11.1 / 2019-05-20
2
17
  -------------------
3
18
 
@@ -8,6 +23,7 @@ Changed:
8
23
 
9
24
  1.11.0 / 2019-05-17
10
25
  -------------------
26
+ This version was yanked on 2019-05-20 to fix an install issue on ruby-1.9.3. #700
11
27
 
12
28
  Added:
13
29
  * Add ability to disable or force use of system libffi. #669
data/Rakefile CHANGED
@@ -176,6 +176,7 @@ file types_conf => File.join("lib", "ffi", "version.rb") do |task|
176
176
  end
177
177
  end
178
178
 
179
+ desc "Create or update type information for platform #{FFI::Platform::NAME}"
179
180
  task :types_conf => types_conf do
180
181
  end
181
182
 
@@ -355,15 +355,15 @@ call_blocking_function(void* data)
355
355
  }
356
356
 
357
357
  VALUE
358
- rbffi_do_blocking_call(void *data)
358
+ rbffi_do_blocking_call(VALUE data)
359
359
  {
360
- rb_thread_call_without_gvl(call_blocking_function, data, (void *) -1, NULL);
360
+ rb_thread_call_without_gvl(call_blocking_function, (void*)data, (void *) -1, NULL);
361
361
 
362
362
  return Qnil;
363
363
  }
364
364
 
365
365
  VALUE
366
- rbffi_save_frame_exception(void *data, VALUE exc)
366
+ rbffi_save_frame_exception(VALUE data, VALUE exc)
367
367
  {
368
368
  rbffi_frame_t* frame = (rbffi_frame_t *) data;
369
369
  frame->exc = exc;
@@ -96,8 +96,8 @@ typedef struct rbffi_blocking_call {
96
96
  void* params;
97
97
  } rbffi_blocking_call_t;
98
98
 
99
- VALUE rbffi_do_blocking_call(void* data);
100
- VALUE rbffi_save_frame_exception(void *data, VALUE exc);
99
+ VALUE rbffi_do_blocking_call(VALUE data);
100
+ VALUE rbffi_save_frame_exception(VALUE data, VALUE exc);
101
101
 
102
102
  #ifdef __cplusplus
103
103
  }
@@ -88,8 +88,8 @@ static VALUE function_init(VALUE self, VALUE rbFunctionInfo, VALUE rbProc);
88
88
  static void callback_invoke(ffi_cif* cif, void* retval, void** parameters, void* user_data);
89
89
  static bool callback_prep(void* ctx, void* code, Closure* closure, char* errmsg, size_t errmsgsize);
90
90
  static void* callback_with_gvl(void* data);
91
- static VALUE invoke_callback(void* data);
92
- static VALUE save_callback_exception(void* data, VALUE exc);
91
+ static VALUE invoke_callback(VALUE data);
92
+ static VALUE save_callback_exception(VALUE data, VALUE exc);
93
93
 
94
94
  #define DEFER_ASYNC_CALLBACK 1
95
95
 
@@ -658,7 +658,7 @@ callback_with_gvl(void* data)
658
658
  }
659
659
 
660
660
  static VALUE
661
- invoke_callback(void* data)
661
+ invoke_callback(VALUE data)
662
662
  {
663
663
  struct gvl_callback* cb = (struct gvl_callback *) data;
664
664
 
@@ -848,7 +848,7 @@ invoke_callback(void* data)
848
848
  }
849
849
 
850
850
  static VALUE
851
- save_callback_exception(void* data, VALUE exc)
851
+ save_callback_exception(VALUE data, VALUE exc)
852
852
  {
853
853
  struct gvl_callback* cb = (struct gvl_callback *) data;
854
854
 
@@ -9,9 +9,9 @@
9
9
 
10
10
  static VALUE rb_cBigDecimal = Qnil;
11
11
  static VALUE bigdecimal_load(VALUE unused);
12
- static VALUE bigdecimal_failed(VALUE value);
12
+ static VALUE bigdecimal_failed(VALUE value, VALUE exc);
13
13
 
14
- VALUE
14
+ VALUE
15
15
  rbffi_longdouble_new(long double ld)
16
16
  {
17
17
  if (!RTEST(rb_cBigDecimal)) {
@@ -28,13 +28,13 @@ rbffi_longdouble_new(long double ld)
28
28
  return rb_float_new(ld);
29
29
  }
30
30
 
31
- long double
31
+ long double
32
32
  rbffi_num2longdouble(VALUE value)
33
33
  {
34
34
  if (TYPE(value) == T_FLOAT) {
35
35
  return rb_num2dbl(value);
36
36
  }
37
-
37
+
38
38
  if (!RTEST(rb_cBigDecimal) && rb_const_defined(rb_cObject, rb_intern("BigDecimal"))) {
39
39
  rb_cBigDecimal = rb_const_get(rb_cObject, rb_intern("BigDecimal"));
40
40
  }
@@ -49,15 +49,15 @@ rbffi_num2longdouble(VALUE value)
49
49
  }
50
50
 
51
51
 
52
- static VALUE
52
+ static VALUE
53
53
  bigdecimal_load(VALUE unused)
54
54
  {
55
55
  rb_require("bigdecimal");
56
56
  return rb_const_get(rb_cObject, rb_intern("BigDecimal"));
57
57
  }
58
58
 
59
- static VALUE
60
- bigdecimal_failed(VALUE value)
59
+ static VALUE
60
+ bigdecimal_failed(VALUE value, VALUE exc)
61
61
  {
62
62
  return value;
63
63
  }
@@ -58,7 +58,7 @@ build_ffi = \
58
58
  env CC="$(CCACHE) $(CC)" CFLAGS="-arch $(1) $(LIBFFI_CFLAGS)" LDFLAGS="-arch $(1)" \
59
59
  $(LIBFFI_CONFIGURE) --host=$(1)-apple-darwin > /dev/null; \
60
60
  fi); \
61
- env MACOSX_DEPLOYMENT_TARGET=10.4 $(MAKE) -C "$(BUILD_DIR)"/libffi-$(1)
61
+ $(MAKE) -C "$(BUILD_DIR)"/libffi-$(1)
62
62
 
63
63
  target_ffi = "$(BUILD_DIR)"/libffi-$(1)/.libs/libffi_convenience.a:; $(call build_ffi,$(1))
64
64
 
@@ -1,6 +1,6 @@
1
1
  shallow_clone: true
2
2
 
3
- # We're currently only testing 64-bit libffi built with Microsoft's
3
+ # We're currently only testing libffi built with Microsoft's
4
4
  # tools.
5
5
  # This matrix should be expanded to include at least:
6
6
  # 32- and 64-bit gcc/cygwin
@@ -8,9 +8,12 @@ shallow_clone: true
8
8
  # 32- and 64-bit clang/mingw
9
9
  # and perhaps more.
10
10
 
11
- image: Visual Studio 2013
11
+ image: Visual Studio 2017
12
12
  platform:
13
13
  - x64
14
+ - x86
15
+ - arm
16
+ - arm64
14
17
 
15
18
  environment:
16
19
  global:
@@ -18,33 +21,46 @@ environment:
18
21
  CYG_CACHE: C:/cygwin/var/cache/setup
19
22
  CYG_MIRROR: http://mirrors.kernel.org/sourceware/cygwin/
20
23
  matrix:
21
- - VSVER: 12
24
+ - VSVER: 15
22
25
 
23
26
  install:
24
27
  - ps: >-
25
28
  If ($env:Platform -Match "x86") {
26
29
  $env:VCVARS_PLATFORM="x86"
27
- $env:BUILD="x86-pc-cygwin"
28
- $env:HOST="x86-pc-windows"
30
+ $env:BUILD="i686-pc-cygwin"
31
+ $env:HOST="i686-pc-cygwin"
32
+ $env:MSVCC="/cygdrive/c/projects/libffi/msvcc.sh"
33
+ $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"
40
+ } ElseIf ($env:Platform -Match "arm") {
41
+ $env:VCVARS_PLATFORM="x86_arm"
42
+ $env:BUILD="i686-pc-cygwin"
43
+ $env:HOST="arm-w32-cygwin"
44
+ $env:MSVCC="/cygdrive/c/projects/libffi/msvcc.sh -marm"
45
+ $env:SRC_ARCHITECTURE="arm"
29
46
  } Else {
30
47
  $env:VCVARS_PLATFORM="amd64"
31
48
  $env:BUILD="x86_64-w64-cygwin"
32
49
  $env:HOST="x86_64-w64-cygwin"
50
+ $env:MSVCC="/cygdrive/c/projects/libffi/msvcc.sh -m64"
51
+ $env:SRC_ARCHITECTURE="x86"
33
52
  }
34
53
  - 'appveyor DownloadFile https://cygwin.com/setup-x86.exe -FileName setup.exe'
35
54
  - 'setup.exe -qnNdO -R "%CYG_ROOT%" -s "%CYG_MIRROR%" -l "%CYG_CACHE%" -P dejagnu >NUL'
36
55
  - '%CYG_ROOT%/bin/bash -lc "cygcheck -dc cygwin"'
56
+ - echo call VsDevCmd to set VS150COMNTOOLS
57
+ - call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat"
37
58
  - ps: $env:VSCOMNTOOLS=(Get-Content ("env:VS" + "$env:VSVER" + "0COMNTOOLS"))
38
59
  - echo "Using Visual Studio %VSVER%.0 at %VSCOMNTOOLS%"
39
- - call "%VSCOMNTOOLS%\..\..\VC\vcvarsall.bat" %VCVARS_PLATFORM%
60
+ - call "%VSCOMNTOOLS%..\..\vc\Auxiliary\Build\vcvarsall.bat" %VCVARS_PLATFORM%
40
61
 
41
62
  build_script:
42
63
  - c:\cygwin\bin\sh -lc "(cd $OLDPWD; ./autogen.sh;)"
43
- - c:\cygwin\bin\sh -lc "(cd $OLDPWD; ./configure CC='/cygdrive/c/projects/libffi/msvcc.sh -m64' CXX='/cygdrive/c/projects/libffi/msvcc.sh -m64' 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;)"
44
- - c:\cygwin\bin\sh -lc "(cd $OLDPWD; cp src/x86/ffitarget.h include; make; find .;)"
64
+ - c:\cygwin\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;)"
65
+ - c:\cygwin\bin\sh -lc "(cd $OLDPWD; cp src/%SRC_ARCHITECTURE%/ffitarget.h include; make; find .;)"
45
66
  - c:\cygwin\bin\sh -lc "(cd $OLDPWD; cp `find . -name 'libffi-?.dll'` $HOST/testsuite/; make check; cat `find ./ -name libffi.log`)"
46
-
47
- # FIXME: "make check" currently fails. It just looks like msvcc needs
48
- # to learn about -L and -l options. If you add "make check; cat `find
49
- # ./ -name libffi.log" to the end of that build command you'll see
50
- # what I mean.
@@ -0,0 +1,4 @@
1
+ * text=auto
2
+
3
+ *.sln text eol=crlf
4
+ *.vcxproj* text eol=crlf
@@ -3,10 +3,38 @@ sudo: required
3
3
 
4
4
  language: cpp
5
5
 
6
+ # For qemu-powered targets, get the list of supported processors from
7
+ # travis by setting QEMU_CPU=help, then set -mcpu= for the compilers
8
+ # accordingly.
9
+
6
10
  matrix:
7
11
  include:
8
12
  - os: osx
9
- env: HOST=arm-apple-darwin
13
+ env: HOST=aarch64-apple-darwin13
14
+ - os: osx
15
+ env: HOST=x86_64-apple-darwin10
16
+ - os: linux
17
+ env: HOST=sh4-linux-gnu CONFIGURE_OPTIONS=--disable-shared QEMU_LD_PREFIX=/usr/sh4-linux-gnu
18
+ - os: linux
19
+ env: HOST=alpha-linux-gnu CONFIGURE_OPTIONS=--disable-shared QEMU_LD_PREFIX=/usr/alpha-linux-gnu
20
+ - os: linux
21
+ 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
22
+ - os: linux
23
+ env: HOST=s390x-linux-gnu MEVAL='export CC="s390x-linux-gnu-gcc-8" && CXX="s390x-linux-gnu-g++-8"' CONFIGURE_OPTIONS=--disable-shared QEMU_LD_PREFIX=/usr/s390x-linux-gnu QEMU_CPU=max
24
+ - os: linux
25
+ env: HOST=arm32v7-linux-gnu LIBFFI_TEST_OPTIMIZATION="-O0"
26
+ - os: linux
27
+ env: HOST=arm32v7-linux-gnu LIBFFI_TEST_OPTIMIZATION="-O2"
28
+ - os: linux
29
+ env: HOST=arm32v7-linux-gnu LIBFFI_TEST_OPTIMIZATION="-O2 -fomit-frame-pointer"
30
+ - os: linux
31
+ env: HOST=sparc64-linux-gnu
32
+ - os: linux
33
+ env: HOST=aarch64-linux-gnu
34
+ - os: linux
35
+ env: HOST=powerpc64le-unknown-linux-gnu
36
+ - os: linux
37
+ env: HOST=mips64el-linux-gnu
10
38
  - os: linux
11
39
  compiler: gcc
12
40
  env: HOST=i386-pc-linux-gnu MEVAL='export CC="$CC -m32" && CXX="$CXX -m32"'
@@ -27,8 +55,9 @@ before_install:
27
55
  - if test x"$MEVAL" != x; then eval ${MEVAL}; fi
28
56
 
29
57
  install:
30
- - ./.travis/install.sh
58
+ - travis_wait 30 ./.travis/install.sh
31
59
 
32
60
  script:
33
61
  - if ! test x"$MEVAL" = x; then eval ${MEVAL}; fi
62
+ - travis_wait 45 sleep infinity &
34
63
  - ./.travis/build.sh
@@ -0,0 +1,22 @@
1
+ #!/bin/bash
2
+
3
+ cd /opt
4
+
5
+ export QEMU_LD_PREFIX=/usr/${HOST}
6
+
7
+ ./configure ${HOST+--host=$HOST --disable-shared}
8
+ make
9
+ make dist
10
+ make check RUNTESTFLAGS="-a $RUNTESTFLAGS"
11
+ EXITCODE=$?
12
+ gzip -c -9 */testsuite/libffi.log > libffi.log.gz
13
+ echo ================================================================
14
+ echo The logs are too long for travis to handle, so we compress and
15
+ echo uuencode them. Download, decode and uncompress if you need to
16
+ echo read them.
17
+ echo ================================================================
18
+ uuencode libffi.log.gz -
19
+ echo ================================================================
20
+ echo ================================================================
21
+ exit $EXITCODE
22
+
@@ -1,7 +1,28 @@
1
1
  #!/bin/bash
2
2
 
3
- # exit this script if any commmand fails
4
- # set -e
3
+ set -x
4
+
5
+ if [ -z ${QEMU_CPU+x} ]; then
6
+ export SET_QEMU_CPU=
7
+ else
8
+ export SET_QEMU_CPU="-e QEMU_CPU=${QEMU_CPU}"
9
+ fi
10
+
11
+ # Default to podman where available, docker otherwise.
12
+ # Override by setting the DOCKER environment variable.
13
+ if test -z "$DOCKER"; then
14
+ which podman > /dev/null 2>&1
15
+ if [ $? != 0 ]; then
16
+ export DOCKER=docker
17
+ else
18
+ export DOCKER=podman
19
+ fi
20
+ fi
21
+
22
+ function build_cfarm()
23
+ {
24
+ curl -u ${CFARM_AUTH} https://cfarm-test-libffi-libffi.apps.home.labdroid.net/test?host=${HOST}\&commit=${TRAVIS_COMMIT}
25
+ }
5
26
 
6
27
  function build_linux()
7
28
  {
@@ -10,25 +31,80 @@ function build_linux()
10
31
  make
11
32
  make dist
12
33
  make check RUNTESTFLAGS="-a $RUNTESTFLAGS"
13
- cat */testsuite/libffi.log
34
+ EXITCODE=$?
35
+
36
+ gzip -c -9 */testsuite/libffi.log > libffi.log.gz
37
+ echo ================================================================
38
+ echo The logs are too long for travis to handle, so we compress and
39
+ echo uuencode them. Download, decode and uncompress if you need to
40
+ echo read them. For example, if you select and save this text
41
+ echo as libffi.uu, run: 'cat libffi.uu | uudecode | gzip -d | less'.
42
+ echo ================================================================
43
+ uuencode libffi.log.gz -
44
+ echo ================================================================
45
+ echo ================================================================
46
+
47
+ exit $EXITCODE
48
+ }
49
+
50
+ function build_foreign_linux()
51
+ {
52
+ ${DOCKER} run --rm -t -i -v `pwd`:/opt ${SET_QEMU_CPU} -e LIBFFI_TEST_OPTIMIZATION="${LIBFFI_TEST_OPTIMIZATION}" $2 bash -c /opt/.travis/build-in-container.sh
53
+ exit $?
54
+ }
55
+
56
+ function build_cross_linux()
57
+ {
58
+ ${DOCKER} run --rm -t -i -v `pwd`:/opt ${SET_QEMU_CPU} -e HOST="${HOST}" -e CC="${HOST}-gcc-8 ${GCC_OPTIONS}" -e CXX="${HOST}-g++-8 ${GCC_OPTIONS}" -e LIBFFI_TEST_OPTIMIZATION="${LIBFFI_TEST_OPTIMIZATION}" moxielogic/cross-ci-build-container:latest bash -c /opt/.travis/build-in-container.sh
59
+ exit $?
14
60
  }
15
61
 
16
62
  function build_ios()
17
63
  {
18
64
  which python
19
65
  # export PYTHON_BIN=/usr/local/bin/python
20
- ./generate-darwin-source-and-headers.py
66
+ ./generate-darwin-source-and-headers.py --only-ios
67
+ xcodebuild -showsdks
68
+ xcodebuild -project libffi.xcodeproj -target "libffi-iOS" -configuration Release -sdk iphoneos11.4
69
+ exit $?
70
+ }
71
+
72
+ function build_macosx()
73
+ {
74
+ which python
75
+ # export PYTHON_BIN=/usr/local/bin/python
76
+ ./generate-darwin-source-and-headers.py --only-osx
21
77
  xcodebuild -showsdks
22
- xcodebuild -project libffi.xcodeproj -target "libffi-iOS" -configuration Release -sdk iphoneos10.3
23
- find ./
78
+ xcodebuild -project libffi.xcodeproj -target "libffi-Mac" -configuration Release -sdk macosx10.13
79
+ exit $?
24
80
  }
25
81
 
26
- ./autogen.sh
27
82
  case "$HOST" in
28
83
  arm-apple-darwin*)
84
+ ./autogen.sh
29
85
  build_ios
30
86
  ;;
87
+ x86_64-apple-darwin*)
88
+ ./autogen.sh
89
+ build_macosx
90
+ ;;
91
+ arm32v7-linux-gnu)
92
+ ./autogen.sh
93
+ build_foreign_linux arm moxielogic/arm32v7-ci-build-container:latest
94
+ ;;
95
+ aarch64-linux-gnu| powerpc64le-unknown-linux-gnu | mips64el-linux-gnu | sparc64-linux-gnu)
96
+ build_cfarm
97
+ ;;
98
+ m68k-linux-gnu )
99
+ ./autogen.sh
100
+ GCC_OPTIONS=-mcpu=547x build_cross_linux
101
+ ;;
102
+ alpha-linux-gnu | sh4-linux-gnu | s390x-linux-gnu )
103
+ ./autogen.sh
104
+ build_cross_linux
105
+ ;;
31
106
  *)
107
+ ./autogen.sh
32
108
  build_linux
33
109
  ;;
34
110
  esac