[cffi-devel] 64bit hosts without multilib

Daniel Herring dherring at tentpost.com
Wed Jan 4 05:13:56 UTC 2012


On Tue, 3 Jan 2012, Robert Goldman wrote:

> On 1/3/12 Jan 3 -7:49 PM, Luís Oliveira wrote:
>> On Wed, Jan 4, 2012 at 12:51 AM, Elias Pipping <pipping at lavabit.com> wrote:
>>> Checking for /lib/ld-linux.so.2 would be one possibility.
>>
>> That would only take care of Linux. I'm afraid my Makefile-fu is weak
>> and I don't see an obvious way to fix this. I've registered this bug
>> here: <https://bugs.launchpad.net/cffi/+bug/911557>.
>
> I am not anything like an expert in C compiling, but doesn't autoconf do
> something to test for precisely this kind of situation?  I believe it
> simply tries some trivial compilations or linkings and checks for
> failure.  Could we adopt a solution like this for CFFI?  Could we use an
> AC_CHECK_LIB test, cunningly written for Linux, Mac OS X, and Windows to
> figure out whether 32-bit, 64-bit or both are supported?  (does autoconf
> even work on windows? I have no idea...)

Yes and not so much.

Autoconf's philosophy is basically along the lines of "ask the compiler" 
and "detect things in configure, not in makefiles".  So if you want to see 
whether -m32 or -m64 works, you'd write simple AC_COMPILE_IFELSE tests 
that try passing these options and see what fails.  Then set flags 
("variable substitutions") for the final makefiles.

Autoconf on windows works, but requires a POSIX shell.  Should be ok on 
either cygwin or MSYS if you're comfortable with that restriction.


However, it looks to me like there's a simpler solution to the present 
problem.

Simply put a minus sign ('-') on front of the lines involving -m32.  Then 
gmake will print an error but continue without failing.  (forget 
offhand whether this is portable or a GNUism)
http://www.gnu.org/software/make/manual/html_node/Errors.html

- Daniel


More information about the cffi-devel mailing list