[Openmcl-devel] problems building interface databases on Debian multiarch

Gary Byers gb at clozure.com
Sun Aug 5 23:24:22 PDT 2012


If you add "-v" to the CFLAGS in effect in your script, you should see
output like:

#include <...> search starts here:
  /usr/local/bin/../ffigen/include
  /usr/include
  /usr/local/include
End of search list.

with the default (somewhat redundant) -isystem options in effect; that's
one way of trying to determine where ffigen is looking for system include
files.

On a few Ubuntu 12.04 and 11.10 systems that I looked at (that apparently
also offer 'multiarch support'), /usr/include/gnu exists (in some cases as
a symbolic link to something like /usr/include/some-arch/gnu).  I don't
know why it exists for me and doesn't exist for you.

Newer versions (>= 4.4 ?  I don't know) of gcc support a -imultiarch option
that seems to take a relative directory name as an argument.  On a system
running the x8664 version of Ubuntu 12.04,

$ gcc -m32 -v file.c

shows that this option is passed as "-imultiarch i386-linux-gnu".  I'd guess
that this is the mechanism that causes the directory /usr/include/i386-linux-gnu
to be searched, but this system doesn't seem to have such a directory.  At first
glance, this stuff doesn't give the impression of being finished.

That's about the extent of my knowledge here (and is a ways past the extent of
my interest.)  I'm a little skeptical of the fact that /usr/include/gnu (and
possibly other subdirectories of /usr/include) is just missing for you, since
that would mean that compilers that didn't support -imultiarch wouldn't have
any way to find <gcc/stubs.h>.  If a compiler was (via sheer luck or other means)
able to find that file, it'd find that it includes either a 32-bit or 64-bit-specific
file (making the notion that this sort of thing needs to be squirreled away in
some magic architecture-specific directory sort of suspect in the first place.)

If you use the .cdb files that Matt or I generated (whenever one of us
last generated them), you'll be able to access a certain set of
constant/type/structure/function declarations and definitions.  If you
generate your own set, you'll be able to access another set that's
likely to be extraordinarily similar.  (This stuff - especially the
stuff in the standard C library - changes sometimes, but much of it
tends to do so very slowly.)


On Mon, 6 Aug 2012, Faheem Mitha wrote:

>
> Hi,
>
> I hit a bit of a snag with building the interface databases on Debian
> unstable. Debian has switched to using multiarch, which puts headers
> in different places than the traditional ones. Eg. <gnu/stubs.h> is
> now in
>
> /usr/include/i386-linux-gnu/gnu/stubs.h
>
> instead of
>
> /usr/include/gnu/stubs.h
>
> The error log is given below.
>
> At first I thought this would be a major problem, but then I realised
> that one can probably just add the extra include paths to those that
> ffigen searches, e.g. add the necessary include paths to
>
> CFLAGS="-isystem ${FFIGEN_DIR}/include -isystem /usr/include -isystem 
> /usr/local/include -quiet -fffigen ${CFLAGS}"
>
> in ffigen4/bin/h-to-ffi.sh. It seems that -isystem is the flag to use here.
>
> Does this sound correct?  I'll try it anyway. but a confirmation would
> be appreciated.
>
>                                                       Regards, Faheem
>
> ######################################################################
>
> # Build interface directories
> export CCL_INTERFACE_DB=x86-headers; export
> CURDIR=/?BUILDDIR?/ccl-1.8+svn15431; export CFLAGS="";
> ./debian/build_interface_headers.sh
> +++ /usr/include/libelf.h
> In file included from /usr/include/libelf.h:1:
> /usr/include/libelf/libelf.h:26:23: error: sys/types.h: No such file or
> directory
> In file included from /usr/include/elf.h:24,
>                 from /usr/include/libelf/sys_elf.h:70,
>                 from /usr/include/libelf/libelf.h:31,
>                 from /usr/include/libelf.h:1:
> /usr/include/features.h:323:26: error: bits/predefs.h: No such file or
> directory
> /usr/include/features.h:356:25: error: sys/cdefs.h: No such file or directory
> /usr/include/features.h:388:23: error: gnu/stubs.h: No such file or directory
> In file included from /usr/include/elf.h:30,
>                 from /usr/include/libelf/sys_elf.h:70,
>                 from /usr/include/libelf/libelf.h:31,
>                 from /usr/include/libelf.h:1:
> /usr/include/stdint.h:27:24: error: bits/wchar.h: No such file or directory
> /usr/include/stdint.h:28:27: error: bits/wordsize.h: No such file or 
> directory
> In file included from /usr/include/elf.h:30,
>                 from /usr/include/libelf/sys_elf.h:70,
>                 from /usr/include/libelf/libelf.h:31,
>                 from /usr/include/libelf.h:1:
> /usr/include/stdint.h:37: error: syntax error before 'typedef'
> In file included from /usr/include/libelf.h:1:
> /usr/include/libelf/libelf.h:55: error: syntax error before 'typedef'
> /usr/include/libelf/libelf.h:140: error: parse error before 'time_t'
> /usr/include/libelf/libelf.h:144: error: parse error before 'ar_size'
> /usr/include/libelf/libelf.h:146: error: parse error before '}' token
> /usr/include/libelf/libelf.h:164: error: parse error before 'off_t'
> /usr/include/libelf/libelf.h:167: error: parse error before '}' token
> /usr/include/libelf/libelf.h:179: error: parse error before '*' token
> /usr/include/libelf/libelf.h:193: error: parse error before '*' token
> /usr/include/libelf/libelf.h:195: error: parse error before 'elf_getbase'
> /usr/include/libelf/libelf.h:196: error: parse error before '*' token
> /usr/include/libelf/libelf.h:196: error: parse error before 'Elf_Data'
> /usr/include/libelf/libelf.h:205: error: parse error before '*' token
> /usr/include/libelf/libelf.h:212: error: parse error before '*' token
> /usr/include/libelf/libelf.h:212: error: parse error before 'Elf_Data'
> /usr/include/libelf/libelf.h:215: error: parse error before 'elf_update'
> /usr/include/libelf/libelf.h:217: error: parse error before '*' token
> /usr/include/libelf/libelf.h:217: error: parse error before '*' token
> /usr/include/libelf/libelf.h:219: error: parse error before '*' token
> /usr/include/libelf/libelf.h:219: error: parse error before '*' token
> /usr/include/libelf/libelf.h:239: error: parse error before '*' token
> /usr/include/libelf/libelf.h:239: error: parse error before '*' token
> /usr/include/libelf/libelf.h:241: error: parse error before '*' token
> /usr/include/libelf/libelf.h:241: error: parse error before '*' token
> make: *** [binary-arch] Error 1
> dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 
> 2
> ????????????????????????????????????????????????????????????????????????????????
> Build finished at 20120806-0238
>
> Finished
> ????????
>
> E: Build failure (dpkg-buildpackage died)
>
> ????????????????????????????????????????????????????????????????????????????????



More information about the Openmcl-devel mailing list