ffi 1.15.0 → 1.15.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aa4ec9f3d594a52a39d6ed09a73f1b25f912306d86447e183008adfedd8ef112
4
- data.tar.gz: b998fa031983d27bc0bfb698e8284e8bc2fa931bd72e8fc21b761828d688f49d
3
+ metadata.gz: b935d4af8929617d392e006c859332b37f754114850da947258561823bfb81b6
4
+ data.tar.gz: 7a56d828fed5ab247416d1425c70ac330704b16713922132e7ad6220df94195b
5
5
  SHA512:
6
- metadata.gz: e2352da0e9bf497be6000ebf0dc9f2714c2fa8b4a4d379d7e05d0cfcb51d002e0a83f47463f54284f561b2a7250ddb73e82ea6a13d90c1e84fe1e7277fe5993f
7
- data.tar.gz: 750d28e73978ec4bc9f2546a66a9293b610200aec7e91165b226b6a6ba1b6c3bc409cf30841f9d21ade246c4e5c7d39d89ea5a3d858649319ea381718e4dafb8
6
+ metadata.gz: 9afe880918848377b8ce402b0504833e5b3f0328ef8c878869f0ff0aa4c6f18d82c57cbe1617528416dc261e2fafa966dea08331b84c08beb49b75aa164f884d
7
+ data.tar.gz: e8632420a47345812ccc66bb72460705cd9bdbd034ae1bfed62920cb2851d6c8291cbad4540997c597a70dc4f8aa21111818e87b473d75dced69b7357be3e952
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ 1.15.1 / 2021-05-22
2
+ -------------------
3
+
4
+ Fixed:
5
+ * Append -pthread to linker options. #893
6
+ * Use arm or aarch64 to identify Apple ARM CPU arch. #899
7
+ * Allow overriding `gcc` with the `CC` env var in `const_generator.rb` and `struct_generator.rb`. #897
8
+
9
+
1
10
  1.15.0 / 2021-03-05
2
11
  -------------------
3
12
 
data/Gemfile CHANGED
@@ -5,7 +5,7 @@ group :development do
5
5
  gem 'rake-compiler', '~> 1.0.3'
6
6
  gem 'rake-compiler-dock', '~> 1.0'
7
7
  gem 'rspec', '~> 3.0'
8
- gem 'bundler', '~> 2.0'
8
+ gem 'bundler', '>= 1.16', '< 3'
9
9
  end
10
10
 
11
11
  group :doc do
data/README.md CHANGED
@@ -62,6 +62,10 @@ On JRuby and TruffleRuby, there are no requirements to install the FFI gem, and
62
62
  From rubygems:
63
63
 
64
64
  [sudo] gem install ffi
65
+
66
+ From a Gemfile using git or GitHub
67
+
68
+ gem 'ffi', github: 'ffi/ffi', submodules: true
65
69
 
66
70
  or from the git repository on github:
67
71
 
data/ext/ffi_c/extconf.rb CHANGED
@@ -57,7 +57,10 @@ if RUBY_ENGINE == 'ruby' || RUBY_ENGINE == 'rbx'
57
57
  append_ldflags "-Wl,--exclude-libs,ALL"
58
58
  end
59
59
 
60
- ffi_alloc_default = RbConfig::CONFIG['host_os'] =~ /darwin/i && RbConfig::CONFIG['host'] =~ /arm/i
60
+ # Some linux archs need explicit linking to pthread, see https://github.com/ffi/ffi/issues/893
61
+ append_ldflags "-pthread"
62
+
63
+ ffi_alloc_default = RbConfig::CONFIG['host_os'] =~ /darwin/i && RbConfig::CONFIG['host'] =~ /arm|aarch64/i
61
64
  if enable_config('libffi-alloc', ffi_alloc_default)
62
65
  $defs << "-DUSE_FFI_ALLOC"
63
66
  end
@@ -71,7 +74,7 @@ if RUBY_ENGINE == 'ruby' || RUBY_ENGINE == 'rbx'
71
74
  File.open("Makefile", "a") do |mf|
72
75
  mf.puts "LIBFFI_HOST=--host=#{RbConfig::CONFIG['host_alias']}" if RbConfig::CONFIG.has_key?("host_alias")
73
76
  if RbConfig::CONFIG['host_os'] =~ /darwin/i
74
- if RbConfig::CONFIG['host'] =~ /arm/i
77
+ if RbConfig::CONFIG['host'] =~ /arm|aarch64/i
75
78
  mf.puts "LIBFFI_HOST=--host=aarch64-apple-#{RbConfig::CONFIG['host_os']}"
76
79
  end
77
80
  mf.puts "include ${srcdir}/libffi.darwin.mk"
data/lib/ffi.rb CHANGED
@@ -1,5 +1,4 @@
1
- if RUBY_ENGINE == 'ruby' || RUBY_ENGINE == 'rbx'
2
- Object.send(:remove_const, :FFI) if defined?(::FFI)
1
+ if RUBY_ENGINE == 'ruby'
3
2
  begin
4
3
  require RUBY_VERSION.split('.')[0, 2].join('.') + '/ffi_c'
5
4
  rescue Exception
@@ -124,7 +124,8 @@ module FFI
124
124
  f.puts "\n\treturn 0;\n}"
125
125
  f.flush
126
126
 
127
- output = `gcc #{options[:cppflags]} -D_DARWIN_USE_64_BIT_INODE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -x c -Wall -Werror #{f.path} -o #{binary} 2>&1`
127
+ cc = ENV['CC'] || 'gcc'
128
+ output = `#{cc} #{options[:cppflags]} -D_DARWIN_USE_64_BIT_INODE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -x c -Wall -Werror #{f.path} -o #{binary} 2>&1`
128
129
 
129
130
  unless $?.success? then
130
131
  output = output.split("\n").map { |l| "\t#{l}" }.join "\n"
@@ -82,7 +82,8 @@ module FFI
82
82
  f.puts "\n return 0;\n}"
83
83
  f.flush
84
84
 
85
- output = `gcc #{options[:cppflags]} #{options[:cflags]} -D_DARWIN_USE_64_BIT_INODE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -x c -Wall -Werror #{f.path} -o #{binary} 2>&1`
85
+ cc = ENV['CC'] || 'gcc'
86
+ output = `#{cc} #{options[:cppflags]} #{options[:cflags]} -D_DARWIN_USE_64_BIT_INODE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -x c -Wall -Werror #{f.path} -o #{binary} 2>&1`
86
87
 
87
88
  unless $?.success? then
88
89
  @found = false
data/lib/ffi/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module FFI
2
- VERSION = '1.15.0'
2
+ VERSION = '1.15.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ffi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.15.0
4
+ version: 1.15.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wayne Meissner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-05 00:00:00.000000000 Z
11
+ date: 2021-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake