Re: Version 181: 'make tests' fails in x86_64 Arch Linux bec…

 new new list compose Reply to this message Top page
Attachments:
+ (text/plain)
+ (text/html)

Delete this message
Author: Kaz Kylheku
Date:  
To: Joe Eib
CC: TXR Users
Subject: Re: Version 181: 'make tests' fails in x86_64 Arch Linux because of non-standard libffi include location

Hi Joe,

Thanks for the changes.

About the exit status value of the configure test; it is never executed (which wouldn't work when cross-compiling).

It is compiled and linked to see whether there is a header file which provides a declaration for ffi_prep_cif and a library which satisfies the external reference. I just wrote the return statement willy nilly. In the actual program (see txr.c) we are using the ISO C EXIT_SUCCESS and EXIT_FAILURE constants. :)

Maybe I will just change the == to != so someone doesn't get confused by the wrong polarity.

On 05.07.2017 11:15, Joe Eib wrote:

No, you're right -- It is pkg-config. I guess my mind was automatically rejecting kebab case after looking at so much C code. Anyway, whoever maintains the libffi package for Arch is a butt for not just throwing a link to ffi.h into /usr/include/ like a sane person.
 
A couple things in your patch needed to be changed to get the new test to work properly on my system.
First, I had to alter the conftest for libffi. On my system, the return result of a true boolean is 1 (which is EXIT_FAILURE in GNU libc) so I altered it to use the POSIX success/failure macros defined in stdlib.h. EXTRA_CFLAFGS also needed to be changed to EXTRA_FLAGS and I removed the 'set -x' error trace line. With these changes, the configure script finds my libffi and everything passes during 'make tests'.
 
I'm including my patch as an attachment because I had a little trouble getting the one you sent me to work properly after copying and pasting. Thanks for addressing my issue so quickly! I'm looking forward to playing what looks like an amazing pair of languages. 

On Tue, Jul 4, 2017 at 7:04 PM, Kaz Kylheku <kaz@kylheku.com> wrote:

[This is a fwd; the original reply went to the mailing list but bounced when trying to reach you.]

[I set Reply-To: which I normally wouldn't do.]

Hi Joe,

Thanks for the report.

I will fix the double definition of ffi_sint.  I regularly build TXR as C++, but I didn't test the combination "g++ and libffi missing"!

The configure script currently doesn't test for anything other than whether -lffi is needed for linking; the test program is hard coded to #include <ffi.h>. That's the include syntax used in all the libffi documentation, so I didn't bother detecting the location.

TXR hasn't used anything so far that would require a big hammer like pkg-config. (Is it really called pkg_config on Arch, by the way?)

In the future, hopefully, we can avoid bogging down TXR with dependencies by using this nice FFI I developed.

I will change the test so it tries things exactly as it does now, and then falls back on pkg-config if those approaches fail to compile and link the test program.

Cheers ...