libffi fails to build with Clang #21

Closed
ryao opened this Issue May 30, 2012 · 9 comments

Projects

None yet

7 participants

@ryao
ryao commented May 30, 2012

The following failure will occur when building with Clang:

libtool: compile: clang -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -DFFI_BUILDING -g -O2 -pipe -march=amdfam10 -mtune=amdfam10 -Wall -fexceptions -c ../src/x86/ffi64.c -fPIC -DPIC -o src/x86/.libs/ffi64.o /bin/bash ./libtool --tag=CC --mode=compile clang -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -DFFI_BUILDING -g -O2 -pipe -march=amdfam10 -mtune=amdfam10 -Wall -fexceptions -c -o src/x86/ffi.lo ../src/x86/ffi.c ../src/x86/unix64.S:357:17: error: invalid variant 'rel' .long .LUW0@rel ^ ../src/x86/unix64.S:399:17: error: invalid variant 'rel' .long .LUW5@rel ^

I discovered this issue on Gentoo. The Mozilla developers wrote a patch for it. Further information can be found in the downstream bug trackers:

https://bugs.gentoo.org/show_bug.cgi?id=417179
https://bugzilla.mozilla.org/show_bug.cgi?id=631928

@pwaller
pwaller commented Aug 8, 2012

I have also encountered this issue trying to build CPython-3.2.3, it causes ctypes to fail to build using the version of libffi which they ship with it.

@Gurpartap

any update?

@oblitum
oblitum commented Sep 5, 2012

I built it on Intel Mac with Clang without such problems.

@pwaller
pwaller commented Sep 5, 2012

@oblitum: what version of clang?

@oblitum
oblitum commented Sep 5, 2012

@pwaller: 3.2, trunk SVN @ 163017

@nadiasvertex

I have the same problem under Arch Linux with clang-3.2 stable.

@masuidrive

I have the same problem too.
It's reproduced on TravisCI and clang-3.1.

Compiling log is https://travis-ci.org/mobiruby/mruby-cfunc/jobs/4073337

@atgreen
Member
atgreen commented Jan 11, 2013

I've committed a fix. Please test it out.

Thanks,

AG

On Thu, Jan 10, 2013 at 2:14 PM, Yuichiro MASUI notifications@github.comwrote:

I have the same problem too.
It's reproduced on TravisCI and clang-3.1.

Compiling log is https://travis-ci.org/mobiruby/mruby-cfunc/jobs/4073337


Reply to this email directly or view it on GitHubhttps://github.com/atgreen/libffi/issues/21#issuecomment-12113517.

@ryao
ryao commented Jan 11, 2013

@atgreen I can confirm that the fix works. Thanks a bunch. :)

@ryao ryao closed this Jan 11, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment