devel/linux_devtools question

andrew clarke mail at ozzmosis.com
Fri Jul 9 15:20:43 PDT 2004


On Fri, Jul 09, 2004 at 02:25:49PM -0700, Kris Kennaway wrote:

> > $setenv CC /compat/linux/usr/bin/gcc 
> > 
> > $make blah
> > /compat/linux/usr/bin/gcc -O -pipe   blah.c  -o blah
> > In file included from /usr/include/errno.h:36,
> >                  from blah.c:1:
> > /usr/include/bits/errno.h:25:26: linux/errno.h: No such file or directory
> > *** Error code 1
> > 
> > Stop in /usr/home/ozzmosis/src/csource/blah.
> 
> Not going to work since the compiler will still see freebsd headers.

That's what I initially thought too, but gcc -v seems to suggest it
should work as it says it's looking in /compat/linux/[...]/include
first.  Also, notice the file is named /usr/include/bits/errno.h, which
doesn't exist in the freebsd headers, but does in the linux headers, so
it does seem to be OK.

$/compat/linux/usr/bin/gcc -v -c blah.c
Reading specs from /compat/linux/usr/bin/../lib/gcc-lib/i386-redhat-linux/3.2/specs
...
ignoring nonexistent directory "/compat/linux/usr/i386-redhat-linux/include"
ignoring nonexistent directory "/usr/i386-redhat-linux/include"
ignoring duplicate directory "/usr/lib/gcc-lib/i386-redhat-linux/3.2/include"
#include "..." search starts here:
#include <...> search starts here:
 /compat/linux/usr/lib/gcc-lib/i386-redhat-linux/3.2/include
 /usr/local/include
 /usr/include
End of search list.
In file included from /usr/include/errno.h:36,
                 from blah.c:1:
/usr/include/bits/errno.h:25:26: linux/errno.h: No such file or directory

This works:

$cat blah2.c
#include <stdio.h>

int main(void) { return puts("kwyjibo"; }

$/compat/linux/usr/bin/make blah2
cc     blah2.c   -o blah2

$file blah2
blah2: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for
GNU/Linux 2.2.5, dynamically linked (uses shared libs), not stripped

> chroot to /compat/linux and build from there, so the compiler
> toolchain sees only linux files.

$chroot /compat/linux
chroot: /compat/linux: Operation not permitted

Hmm.  I've never used chroot.  I assume it needs jail support in the
kernel?  The man page is a bit vague about that.

Either way, I tend to think the linux_devtools port is missing some
important files:

$pwd
/usr/compat/linux

$find . | grep -c linux/errno
0

Regards
Andrew


More information about the freebsd-ports mailing list