Discussion:
Issues cross-compiling hurd
(too old to reply)
Nathan Dehnel
2018-07-16 23:57:18 UTC
Permalink
I am trying to compile hurd with cross-hurd, and I get this compilation
error:

i586-pc-gnu-gcc -B/cross-tools/bin/ setup-thread.c -c -std=gnu11
-fgnu89-inline -O2 -Wall -Wundef -Wwrite-strings -fmerge-all-constants
-frounding-math -g -Wno-parentheses -Wstrict-prototypes
-Wold-style-definition -ftls-model=initial-exec -I../include
-I/mnt/store/Data/VM/crosshurd-32/cross-hurd/tmp/src/glibc.first_obj/mach
-I/mnt/store/Data/VM/crosshurd-32/cross-hurd/tmp/src/glibc.first_obj
-I../libpthread/sysdeps/mach/hurd/i386 -I../sysdeps/mach/hurd/i386
-I../libpthread/sysdeps/mach/hurd -I../libpthread/sysdeps/hurd
-I../libpthread/sysdeps/pthread -I../sysdeps/pthread
-I../sysdeps/mach/hurd -I../sysdeps/gnu -I../sysdeps/unix/bsd
-I../sysdeps/unix/inet -I../sysdeps/mach/i386
-I../libpthread/sysdeps/mach -I../sysdeps/mach -I../sysdeps/i386/i586
-I../sysdeps/i386/fpu -I../sysdeps/x86/fpu/include -I../sysdeps/x86/fpu
-I../libpthread/sysdeps/i386 -I../sysdeps/i386 -I../sysdeps/x86
-I../sysdeps/wordsize-32 -I../sysdeps/ieee754/ldbl-96
-I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32
-I../sysdeps/unix -I../sysdeps/posix -I../libpthread/sysdeps/posix
-I../sysdeps/ieee754 -I../sysdeps/generic -I../libpthread -I../hurd
-I/mnt/store/Data/VM/crosshurd-32/cross-hurd/tmp/src/glibc.first_obj/hurd/
-I../mach
-I/mnt/store/Data/VM/crosshurd-32/cross-hurd/tmp/src/glibc.first_obj/mach/
-I.. -I../libio -I. -nostdinc -isystem
/mnt/store/Data/VM/crosshurd-32/cross-hurd/tmp/cross-tools/bin/../lib/gcc/i586-pc-gnu/6.4.0/include
-isystem
/mnt/store/Data/VM/crosshurd-32/cross-hurd/tmp/cross-tools/bin/../lib/gcc/i586-pc-gnu/6.4.0/include-fixed
-isystem /tools/include -D_LIBC_REENTRANT -include
/mnt/store/Data/VM/crosshurd-32/cross-hurd/tmp/src/glibc.first_obj/libc-modules.h
-DMODULE_NAME=libc -include ../include/libc-symbols.h -o
/mnt/store/Data/VM/crosshurd-32/cross-hurd/tmp/src/glibc.first_obj/mach/setup-thread.o
-MD -MP -MF
/mnt/store/Data/VM/crosshurd-32/cross-hurd/tmp/src/glibc.first_obj/mach/setup-thread.o.dt
-MT
/mnt/store/Data/VM/crosshurd-32/cross-hurd/tmp/src/glibc.first_obj/mach/setup-thread.o
In file included from ../libpthread/sysdeps/pthread/libc-lockP.h:22:0,
from ../sysdeps/mach/libc-lock.h:227,
from ../include/link.h:46,
from ../include/dlfcn.h:4,
from ../sysdeps/generic/ldsodefs.h:32,
from ../sysdeps/i386/ldsodefs.h:39,
from ../sysdeps/gnu/ldsodefs.h:46,
from setup-thread.c:22:
../include/pthread.h:1:26: fatal error: pthread.h: No such file or directory
#include_next <pthread.h>
^
compilation terminated.

I tried running ./configure LIBS=-lpthread and setting LIBS += -lpthread in
configparms, but I'm not really sure what I'm doing. Any suggestions would
be appreciated.
Samuel Thibault
2018-07-19 00:59:24 UTC
Permalink
Hello,
Which source are you taking exactly?
Post by Nathan Dehnel
../include/pthread.h:1:26: fatal error: pthread.h: No such file or directory
 #include_next <pthread.h>
                          ^
compilation terminated.
I tried running ./configure LIBS=-lpthread and setting LIBS += -lpthread in
configparms, but I'm not really sure what I'm doing.
The issue is with the header, not the library, so it'd rather be a -I.
But libpthread is supposed to be provided by glibc itself actually, by
using the hurd libpthread repo and adding it as an add-on.

Samuel
Nathan Dehnel
2018-07-19 20:40:11 UTC
Permalink
Post by Samuel Thibault
Which source are you taking exactly?
I used the default sources set by cross-hurd in vars.sh:
https://github.com/flavioc/cross-hurd
Post by Samuel Thibault
The issue is with the header, not the library, so it'd rather be a -I.
It doesn't seem to work. Which directory do I include? /usr/include?
./glibc/libpthread/sysdeps/pthread/bits?
./glibc/libpthread/sysdeps/generic/? You're referring to
CFLAGS="-I/directory" ./configure, correct?
Post by Samuel Thibault
But libpthread is supposed to be provided by glibc itself actually, by
using the hurd libpthread repo and adding it as an add-on.
libpthread appears to be in the glibc directory, and is getting passed to
configure.
Post by Samuel Thibault
Hello,
Post by Nathan Dehnel
I am trying to compile hurd with cross-hurd, and I get this compilation
Which source are you taking exactly?
Post by Nathan Dehnel
../include/pthread.h:1:26: fatal error: pthread.h: No such file or
directory
Post by Nathan Dehnel
#include_next <pthread.h>
^
compilation terminated.
I tried running ./configure LIBS=-lpthread and setting LIBS += -lpthread
in
Post by Nathan Dehnel
configparms, but I'm not really sure what I'm doing.
The issue is with the header, not the library, so it'd rather be a -I.
But libpthread is supposed to be provided by glibc itself actually, by
using the hurd libpthread repo and adding it as an add-on.
Samuel
Loading...