Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MacOS: error 'cputype does not match previous archive members' since ffi-1.9.21 #605

Closed
dqh-au opened this issue Feb 6, 2018 · 15 comments
Closed

Comments

@dqh-au
Copy link

dqh-au commented Feb 6, 2018

Hi,

Today our project that depends on compass, that depends on ffi, stopped building. To workaround, I changed:

gem install -i ./compass compass --version $COMPASS_VERSION

to

CFLAGS="--disable-asm-optimizations" gem install -i ./compass compass --version $COMPASS_VERSION

Hope this helps.

@unimatrixZxero
Copy link

Yes, thanks, it helped me. Installs now on Mac OS X 10.3.3 (17D47) (MBP 15" mid-2015 2.8 GHz i7)

@jeffblake
Copy link

brew install automake

Worked for me.

@vinhboy
Copy link

vinhboy commented Feb 7, 2018

Confirmed conflict on Mac 10.13.3

Running autoreconf for libffi
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal -I m4 --output=aclocal.m4t
Can't exec "aclocal": No such file or directory at /usr/local/Cellar/autoconf/2.69/share/autoconf/Autom4te/FileUtils.pm line 326.
autoreconf: failed to run aclocal: No such file or directory
make: ***

@jeffblake's fix worked

@kusma
Copy link

kusma commented Feb 7, 2018

I'm seeing the same problem. The specific error I'm getting is:

libtool: link: ar cru .libs/libffi_convenience.a src/.libs/prep_cif.o src/.libs/types.o src/.libs/raw_api.o src/.libs/java_raw_api.o src/.libs/closures.o src/x86/.libs/ffi64.o src/x86/.libs/unix64.o src/x86/.libs/ffiw64.o src/x86/.libs/win64.o 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: archive member: .libs/libffi_convenience.a(ffi64.o) cputype (16777223) does not match previous archive members cputype (7) (all members must match)
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: archive member: .libs/libffi_convenience.a(unix64.o) cputype (16777223) does not match previous archive members cputype (7) (all members must match)
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: archive member: .libs/libffi_convenience.a(ffiw64.o) cputype (16777223) does not match previous archive members cputype (7) (all members must match)
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: archive member: .libs/libffi_convenience.a(win64.o) cputype (16777223) does not match previous archive members cputype (7) (all members must match)
libtool: link: ranlib .libs/libffi_convenience.a
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: archive member: .libs/libffi_convenience.a(ffi64.o) cputype (16777223) does not match previous archive members cputype (7) (all members must match)
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: archive member: .libs/libffi_convenience.a(unix64.o) cputype (16777223) does not match previous archive members cputype (7) (all members must match)
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: archive member: .libs/libffi_convenience.a(ffiw64.o) cputype (16777223) does not match previous archive members cputype (7) (all members must match)
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: archive member: .libs/libffi_convenience.a(win64.o) cputype (16777223) does not match previous archive members cputype (7) (all members must match)
make[3]: *** [libffi_convenience.la] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all] Error 2
make: *** ["/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.21/ext/ffi_c"/libffi-i386/.libs/libffi_convenience.a] Error 2

So it seems the problem is mixing 32-bit and 64-bit object files in the same archive.

Passing CFLAGS="--disable-asm-optimizations" worked fine for me as well.

larskanis added a commit to larskanis/ffi that referenced this issue Feb 10, 2018
@tduehr tduehr closed this as completed in bfc330a Feb 12, 2018
@larskanis
Copy link
Member

OK, just pushed ffi-1.9.22, which hopefully solves this issue. Could you please re-try?

pmanrubia added a commit to alphagov/content-data-api that referenced this issue Feb 23, 2018
When running `bundle install` the native extensions for the gem `ffi`
failed (see error message below). Fortunately, upgrading to 1.9.22
solves the problem. See [1]

```
Fetching ffi 1.9.21
Installing ffi 1.9.21 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/pmanrubia/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/ffi-1.9.21/ext/ffi_c
/Users/pmanrubia/.rbenv/versions/2.4.2/bin/ruby -r ./siteconf20180223-45763-yqqt94.rb extconf.rb
checking for ffi.h... no
checking for ffi.h in /usr/local/include,/usr/include/ffi... no
checking for shlwapi.h... no
checking for rb_thread_blocking_region()... no
checking for rb_thread_call_with_gvl()... yes
checking for rb_thread_call_without_gvl()... yes
creating extconf.h
creating Makefile

current directory: /Users/pmanrubia/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/ffi-1.9.21/ext/ffi_c
make "DESTDIR=" clean

current directory: /Users/pmanrubia/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/ffi-1.9.21/ext/ffi_c
make "DESTDIR="
Running autoreconf for libffi
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal -I m4 --output=aclocal.m4t
Can't exec "aclocal": No such file or directory at /usr/local/Cellar/autoconf/2.69/share/autoconf/Autom4te/FileUtils.pm line 326.
autoreconf: failed to run aclocal: No such file or directory
make: *** ["/Users/pmanrubia/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/ffi-1.9.21/ext/ffi_c/libffi-x86_64-darwin16"/.libs/libffi_convenience.a] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/pmanrubia/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/ffi-1.9.21 for inspection.
Results logged to /Users/pmanrubia/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/extensions/x86_64-darwin-16/2.4.0-static/ffi-1.9.21/gem_make.out

An error occurred while installing ffi (1.9.21), and Bundler cannot continue.
Make sure that `gem install ffi -v '1.9.21'` succeeds before bundling.

In Gemfile:
  govuk_admin_template was resolved to 6.5.0, which depends on
    bootstrap-sass was resolved to 3.3.5.1, which depends on
      sass was resolved to 3.5.5, which depends on
        sass-listen was resolved to 4.0.0, which depends on
          rb-inotify was resolved to 0.9.10, which depends on
            ffi
```

[1]: ffi/ffi#605
pmanrubia added a commit to alphagov/content-data-api that referenced this issue Feb 23, 2018
When running `bundle install` the native extensions for the gem `ffi`
failed (see error message below). Fortunately, upgrading to 1.9.22
solves the problem. See [1]

```
Fetching ffi 1.9.21
Installing ffi 1.9.21 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/pmanrubia/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/ffi-1.9.21/ext/ffi_c
/Users/pmanrubia/.rbenv/versions/2.4.2/bin/ruby -r ./siteconf20180223-45763-yqqt94.rb extconf.rb
checking for ffi.h... no
checking for ffi.h in /usr/local/include,/usr/include/ffi... no
checking for shlwapi.h... no
checking for rb_thread_blocking_region()... no
checking for rb_thread_call_with_gvl()... yes
checking for rb_thread_call_without_gvl()... yes
creating extconf.h
creating Makefile

current directory: /Users/pmanrubia/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/ffi-1.9.21/ext/ffi_c
make "DESTDIR=" clean

current directory: /Users/pmanrubia/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/ffi-1.9.21/ext/ffi_c
make "DESTDIR="
Running autoreconf for libffi
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal -I m4 --output=aclocal.m4t
Can't exec "aclocal": No such file or directory at /usr/local/Cellar/autoconf/2.69/share/autoconf/Autom4te/FileUtils.pm line 326.
autoreconf: failed to run aclocal: No such file or directory
make: *** ["/Users/pmanrubia/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/ffi-1.9.21/ext/ffi_c/libffi-x86_64-darwin16"/.libs/libffi_convenience.a] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/pmanrubia/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/ffi-1.9.21 for inspection.
Results logged to /Users/pmanrubia/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/extensions/x86_64-darwin-16/2.4.0-static/ffi-1.9.21/gem_make.out

An error occurred while installing ffi (1.9.21), and Bundler cannot continue.
Make sure that `gem install ffi -v '1.9.21'` succeeds before bundling.

In Gemfile:
  govuk_admin_template was resolved to 6.5.0, which depends on
    bootstrap-sass was resolved to 3.3.5.1, which depends on
      sass was resolved to 3.5.5, which depends on
        sass-listen was resolved to 4.0.0, which depends on
          rb-inotify was resolved to 0.9.10, which depends on
            ffi
```

[1]: ffi/ffi#605
@larskanis
Copy link
Member

@pmanrubia Thanks for responding, but your issue was about "autoreconf: failed to run aclocal: No such file or directory"

Is the original issue resolved, what CFLAGS="--disable-asm-optimizations" is required or otherwise the following error ocures?

libtool: link: ar cru .libs/libffi_convenience.a src/.libs/prep_cif.o src/.libs/types.o src/.libs/raw_api.o src/.libs/java_raw_api.o src/.libs/closures.o src/x86/.libs/ffi64.o src/x86/.libs/unix64.o src/x86/.libs/ffiw64.o src/x86/.libs/win64.o 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: archive member: .libs/libffi_convenience.a(ffi64.o) cputype (16777223) does not match previous archive members cputype (7) (all members must match)

@kusma
Copy link

kusma commented Feb 23, 2018

@larskanis: Doesn't seem to be fixed; I still get cputype 16777223 mixed with cputype 7 with ffi-1.9.22 without CFLAGS="--disable-asm-optimizations".

@pmanrubia
Copy link

@larskanis I do apologise, I linked to the wrong issue. I have deleted my comment as they can cause trouble to other users.

@dqh-au
Copy link
Author

dqh-au commented Feb 23, 2018

Yes still broken here, please reopen this bug if the issue isn't being tracked elsewhere

@larskanis larskanis changed the title Workaround suddenly needed to compile 1.9.21 on macOS MacOS: error 'cputype does not match previous archive members' since ffi-1.9.21 Feb 23, 2018
@larskanis
Copy link
Member

Can someone post a full console output of gem install with this issue? My guess is that it's related to the multi arch build on darwin. Unfortunately I can't reproduce this - I don't have a Mac.

@larskanis larskanis reopened this Feb 23, 2018
@matteosecli
Copy link

CFLAGS="--disable-asm-optimizations" gem install ffi -v '1.9.22' works for me; it doesn't without the suggested CFLAGS. gem install ffi -v '1.9.18', instead, works without any issue.

I'm on a MBP 15" (2017) with an i7-7820HQ CPU.

Logs (gem_make.out and mkmf.log):
ffi-1.9.22_logs.zip

@larskanis
Copy link
Member

Could you please try

gem inst ffi --pre

I've got some hope that it solves this issue...

@matteosecli
Copy link

Could you please try

gem inst ffi --pre

The above command works fine, I've just installed ffi-1.9.23.pre1 without any issue!

@larskanis
Copy link
Member

@matteosecli Thanks for the confirmation! I just pushed final ffi-1.9.23 to rubygems.org. It should fix this issue, so that the workaround to use CFLAGS="--disable-asm-optimizations" isn't needed any longer.

@matteosecli
Copy link

That's great, thank you! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants