problem installing glibc headers

Dan Kegel dank@kegel.com
Thu Oct 28 16:38:00 GMT 2004


Marcus Blomenkamp wrote:
> Hi Daniel,
> 
> sorry to contact you directly, however i could not find an appropriate mailing 
> list for my issue, as they were either in closed state or spam-filled.

Use crossgcc@sources.redhat.com.

> Im currently working on a spin-off project based heavily on LFS, which you 
> probably know about. And in the process of restructuring and cleaning up how 
> to derive a new native toolchain i'm stuck.
> 
> One major goal is to construct fully self-contained software packages residing 
> in subdirectories of the usual LSB/GNU/whatever filesystem tree.
> 
> As far as i understood the process of creating cross and espacially native 
> toolchains, there are two basic approaches:
> 
> A)	0. install kernel headers for arch
> 	1. bootstrap basic C compiler without glibc headers
> 	2. compile glibc with bootstrapped C compiler
> 	3. compile normal C compiler linked against new glibc
> 
> B)	0. install kernel headers for arch
> 	1. install glibc header files
> 	2. bootstrap basic C compiler with glibc headers
> 	3. compile glibc with bootstrapped C compiler
> 	4. compile normal C compiler linked against new glibc

A) only works for gcc-2.95.3.
You need B) for gcc-3.2 and later.

> I spent hours and days on the first approach including all kinds
> of --with-newlib, --with,without-xxx sysroot and inhibit_libc patches and 
> hacks, most of the time due to adapting configure+make systems to my 
> non-standard (WRT to paths) build system, and i finally got the expected 
> output. But somehow it does smell fishy...
> 
> The second approach is the more appealing approach in my eyes. But in the 
> vital step of installing glibc header files i'm out of luck already. Maybe 
> you can help me on this challenge.
> 
> No matter what version of glibc (2.3.3, 2.3.3-lfs-5.1) or what combination of 
> configure switches (--disable-sanity-checks, --without-cvs etc) i use, i 
> still get the very same failure during 'make install-headers':
> 
> .././scripts/mkinstalldirs /home/marcus/tree/include/rpcsvc
> /usr/bin/install -c -m 644 
> rpcsvc/rquota.x /home/marcus/tree/include/rpcsvc/rquota.x
> .././scripts/mkinstalldirs /home/marcus/tree/include/rpcsvc
> /usr/bin/install -c -m 644 
> rpcsvc/key_prot.x /home/marcus/tree/include/rpcsvc/key_prot.x
> .././scripts/mkinstalldirs /home/marcus/tree/include/rpcsvc
> /usr/bin/install -c -m 644 
> rpcsvc/bootparam.h /home/marcus/tree/include/rpcsvc/bootparam.h
> make[2]: *** No rule to make target `rpcsvc/bootparam_prot.h', needed by 
> `/home/marcus/tree/include/rpcsvc/bootparam_prot.h'.  Stop.
> make[2]: Leaving directory `/tmp/glibc-2.3.3/sunrpc'
> make[1]: *** [sunrpc/install-headers] Error 2
> make[1]: Leaving directory `/tmp/glibc-2.3.3'
> make: *** [install-headers] Error 2
> 
> Do you have any clues?

Yes bootparam_prot.h is derived from bootparam_prot.x in sunrpc/Makefile.
Here are some interesting parts of that file:
--------------
rpcsvc = bootparam_prot.x nlm_prot.x rstat.x \
          yppasswd.x klm_prot.x rex.x sm_inter.x mount.x \
          rusers.x spray.x nfs_prot.x rquota.x key_prot.x
...
ifeq (no,$(cross-compiling))
# We can only build this library if we can run the rpcgen we build.
headers += $(rpcsvc:%.x=rpcsvc/%.h)
extra-libs := librpcsvc
extra-libs-others := librpcsvc # Make it in `others' pass, not `lib' pass.
librpcsvc-routines = $(rpcsvc:%.x=x%)
librpcsvc-inhibit-o = .os # Build no shared rpcsvc library.
omit-deps = $(librpcsvc-routines)
endif
...
# Generate the rpcsvc headers with rpcgen.
# We use a stamp file to avoid unnessary recompilation each time rpcgen is
# relinked.
$(rpcsvc:%.x=$(objpfx)rpcsvc/%.h): $(objpfx)rpcsvc/%.h: $(objpfx)rpcsvc/%.stmp
         @:
$(objpfx)rpcsvc/%.stmp: rpcsvc/%.x $(objpfx)rpcgen
         $(make-target-directory)
         -@rm -f ${@:stmp=T} $@
         $(rpcgen-cmd) -h $< -o ${@:stmp=T}
         $(move-if-change) $(@:stmp=T) $(@:stmp=h)
         touch $@
--------------

That should get you started.  Some black magic may be required.
- Dan


-- 
Trying to get a job as a c++ developer?  See http://kegel.com/academy/getting-hired.html

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com



More information about the crossgcc mailing list