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

libffi can't build with Visual Studio 2012 anymore #149

Closed
gpakosz opened this issue Nov 18, 2014 · 6 comments
Closed

libffi can't build with Visual Studio 2012 anymore #149

gpakosz opened this issue Nov 18, 2014 · 6 comments

Comments

@gpakosz
Copy link
Contributor

gpakosz commented Nov 18, 2014

When trying to compile the v3.2.1 tag with Visual Studio 2012:

  • for the x86 architecture, file src/x86/ffi.c contains variable declarations that are not at the beginning of blocks. This is not allowed in non C99 and Visual Studio 2012 isn't a C99 compiler.

  • for the x86_64 architecture, file src/x86/win64.S preprocessed to win64.asm exhibits the following assembler errors:

    win64.asm(1223): error A2075: jump destination too far: by 20 byte(s)
    win64.asm(1232): error A2075: jump destination too far: by 1 byte(s)

Building the v3.1 tag works fine.

PS: the master branch now uses designated initializers which is also a C99 feature Visual Studio 2012 doesn't support.

@gpakosz
Copy link
Contributor Author

gpakosz commented Nov 18, 2014

For the record, the A2075 errors also happen with Visual Studio 2013. Looks like it starts failing with commit bfcbf32.

@gpakosz
Copy link
Contributor Author

gpakosz commented Nov 18, 2014

I would remove the SHORT annotation from

https://github.com/atgreen/libffi/blob/v3.2.1/src/x86/win64.S#L173

and

https://github.com/atgreen/libffi/blob/v3.2.1/src/x86/win64.S#L182

but I would like to have the confirmation it's correct.

@fanc999
Copy link

fanc999 commented Apr 9, 2015

Hi,

I can confirm that gpakosz's updates will work,and the resulting FFI .lib works fine with the GObject builds, where the test programs in there pass.

With blessings.

@twall
Copy link

twall commented Sep 1, 2015

Confirmed this change both compiles and executes properly (used within JNA).

@nacho
Copy link

nacho commented Dec 19, 2017

Any updates on this?

@atgreen
Copy link
Member

atgreen commented Apr 2, 2018

I'm closing this. Our CI testing on appveyor shows that the latest github sources, and the 3.3-rc0 release build with with Visual Studio 12.0.

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

5 participants