help-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cross-compiling glibc/hurd on FreeBSD


From: Farid Hajji
Subject: Re: cross-compiling glibc/hurd on FreeBSD
Date: Fri, 17 Nov 2000 19:24:05 +0100

Hi Arkadi!

>   I realized that my suggestion was somewhat bogous, as I looked
>   on sources and find that __hurd_fail (and pointed this too) is
>   extern inline. For me 'nm libc.so' said:
> 
> 0003b6a8 t __hurd_fail
> 
>   No __thread_stack_pointer symbol present.
>   I don't remmember what was CFLAGS when I compiled GLibC.

>    GNU C does not inline any functions when not optimizing.  It is not
> clear whether it is better to inline or not, in this case, but we found
> that a correct implementation when not optimizing was difficult.  So we
> did the easy thing, and turned it off.
That did the trick. I had first manually followed the script you sent me
(mk-hurd-cross), so I had set CFLAGS to "-march=i586 -g" while compiling
glibc. recreating the build directory and setting CFLAGS to
"-march=i586 -O2 -fomit-frame-pointer" worked flawlessly.

I just cross-compiled glibc, gnumach and the Hurd on FreeBSD with
the target i586-pc-gnu (Yuhuu!). I must still test the resulting
binaries though...

>   Probably gcc cannot inline this function without -O or because of other
>   reasons. Maybe -Winline helps.
Using -O was enough for gcc to inline the functions.

Summary (what a show!):
-----------------------

* built and installed cross binutils-2.10 for target i586-pc-gnu
* built first part of cross gcc-core-2.95.2 for target i586-pc-gnu
  (stopped as expected while building libgcc2)
* built and installed header files of gnumach with partial i586-pc-gnu-gcc
  (gmake -k)
* built and installed cross mig:
   gmake breaks first, a symlink is needed:
      cd /usr/local/i586-pc-gnu/include/mach
      ln -s i386 machine
   then restarted gmake, followed by gmake install
* built and installed hurd header files with partial i586-pc-gnu-gcc
* built and installed glibc headers install_root=/usr/local/i586-pc-gnu,
  fixed features.h, touched stubs.h
* resumed build of cross-gcc, installed cross-gcc.
* resumed build of glibc (WITH -O flag!)
  [I actually had to remove and recreate the glibc build directory
  and reconfigure glibc the same way as before.]
  -> The build of glibc.build/intl chokes on 'sed -f po2test.sed',
     effectively creating an empty intl/msgs.h header.
     Reason: FreeBSD's sed is not compatible with GNU sed 3.02
     Symptoms: po2test.sed chokes as was advertised in glibc docs.
               configure seems to freeze while checking version of sed.
               Workaround was to hit C-d here.
     Despite what glibc docs say, GNU sed 3.02 _is_mandatory_ here,
     because else 'gmake install' is full of illegal sed commands.
  -> downloaded and installed GNU sed 3.02 and restarted configure,
     build and gmake install of glibc. OK.
* installed glibc without problems now.

Now trying to cross-compile gnumach and the hurd with the newly installed
i586-pc-gnu compile chain and cross glibc:

* recreatd gnumach build directory from scratch.
  ../gnumach/configure --build=i386-unknown-freebsdelf --host=i586-pc-gnu \
      --enable-floppy --enable-ide --enable-aic7xxx --enable-ul
* gmake of gnumach breaks while trying to call "cd linux && make all"
  with error messages:
     "Makefile", line 40: Need an operator
     [... a lot more lines like these ...]
  -> Reason: FreeBSD's make and GNU make (called gmake here) are not
             compatible. It should have been "cd linux && gmake all"
             instead of "cd linux && make all".
             The problem is with i386/Makefile which sets MAKE to
             make and not gmake (even if my environment is set to gmake!).
  -> Workaround: manually changed gnumach.build/i386/Makefile accordingly,
                 replacing make with gmake.
                 then restart gmake
* installing compiled kernel somewhere:
    created a hurd stage area under /mnt/hurd,
    copied /usr/local/i586-pc-gnu/{include,lib} to /mnt/hurd/{include,lib}
    in gnumach.build: gmake install-kernel prefix=/mnt/hurd

Now for the Hurd itself. Will it compile cleanly now?

* Important preliminary step needed here:
    ln -s -f /usr/local/i586-pc-gnu/lib/libc.so.0.2 \
             /usr/local/i586-pc-gnu/lib/libc.so
* Problem: hurd/Makeconf _adds_ to CFLAGS "-Wall -g -O3", effectively
           defeating my CFLAGS of "-march=i586 -O2 -fomit-frame-pointer".
  Workaround: manually edit hurd/Makeconf (Yuck!) and remove that CFLAGS
              extending line.
* recreated hurd.build and reconfigured from scratch:
     used --prefix=/mnt/hurd
     (same as staging area)
* build the Hurd with simple gmake,
* installed with gmake install prefix=/mnt/hurd

Final setup:

* cp build/hurd/debian/servers.boot /mnt/hurd/boot
  [should /mnt/hurd/boot/gnumach and /mnt/hurd/boot/serverboot be
   gzipped?]
* set up /mnt/hurd/boot/grub/menu.lst accordingly.

Again, thank you for your help!

-Farid.

-- 
Farid Hajji -- Unix Systems and Network Admin | Phone: +49-2131-67-555
Broicherdorfstr. 83, D-41564 Kaarst, Germany  | farid.hajji@ob.kamp.net
- - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - -
Murphy's Law fails only when you try to demonstrate it, and thus succeeds.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]