You are not logged in.

#26 2010-01-05 23:56:36

Anikom15
Banned
From: United States
Registered: 2009-04-30
Posts: 836
Website

Re: The Arch Hurd Project

You might get gnash to work!


Personally, I'd rather be back in Hobbiton.

Offline

#27 2010-01-06 01:43:37

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: The Arch Hurd Project

Anikom15 wrote:

You might get gnash to work!

A fully functional Gnash vs. a fully functional Hurd: The race is on!

Offline

#28 2010-01-06 02:19:17

Acecero
Member
Registered: 2008-06-21
Posts: 1,373

Re: The Arch Hurd Project

skottish wrote:
Anikom15 wrote:

You might get gnash to work!

A fully functional Gnash vs. a fully functional Hurd: The race is on!

I'm confident Hurd will win. big_smile

Offline

#29 2010-01-06 04:05:01

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,365
Website

Re: The Arch Hurd Project

Here is my attempt at a (still not working...) cross-compiler:  http://allanmcrae.com/packages/cross-i686-pc-gnu.tar.gz .   The build order are at the top of all the PKGBUILDs.   

The issue is with the first pass of glibc.  It is known not to work and so you need to force the build, but there are missing files that are quite essential for the rest of the cross compiling.  Specifically crt1.o which the cross-ld wants.  So...  the glibc build appears to be more broken than the known amount of broken!  That means compiling libpthreads and the next pass of gcc fails badly.

I will not be able to look into this further until the weekend (hint... hint... tongue)

Offline

#30 2010-01-06 04:33:36

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,365
Website

Re: The Arch Hurd Project

Someone should try glibc-2.7 with these patches: http://www.schwinge.homeip.net/~thomas/ … c-patches/ .  It is flagged as "known to work"...

Edit: or pull everything starting with "hurd-i386" from debian: http://patch-tracker.debian.org/package … exp1-0exp1

Edit: and remove "--without-tls" from the configure line.

Offline

#31 2010-01-06 07:39:46

Barrucadu
Member
From: York, England
Registered: 2008-03-30
Posts: 1,158
Website

Re: The Arch Hurd Project

I'll have a look after school smile

Or maybe even in school, I have a couple of free periods…

Last edited by Barrucadu (2010-01-06 07:49:54)

Offline

#32 2010-01-06 09:01:27

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,365
Website

Re: The Arch Hurd Project

Cool.  As a warning, patching glibc using all (31!!) hurd patches from Debian makes things worse...

Edit: as does applying the entire patch-set.

I guess trying glibc-2.7 with those patches is the way to go for building a cross compiler.  The key point is to have a file called crt1.o in /usr/lib/cross-i686-pc-gnu/lib.

Offline

#33 2010-01-06 09:21:55

flamelab
Member
From: Athens, Hellas (Greece)
Registered: 2007-12-26
Posts: 2,160

Re: The Arch Hurd Project

Trying a different one, like eglibc, like Debian does ? Would that help ?

Last edited by flamelab (2010-01-06 09:22:05)

Offline

#34 2010-01-06 12:35:22

thoughtcrime
Member
Registered: 2008-09-27
Posts: 156
Website

Re: The Arch Hurd Project

Very interesting project indeed big_smile


- blog (about arch and other stuff): http://thoughtyblog.wordpress.com/
- x86_64 user

Offline

#35 2010-01-06 14:38:43

Barrucadu
Member
From: York, England
Registered: 2008-03-30
Posts: 1,158
Website

Re: The Arch Hurd Project

Woo, school finished early due to the snow!

*starts makepkging*

Offline

#36 2010-01-06 22:49:48

Barrucadu
Member
From: York, England
Registered: 2008-03-30
Posts: 1,158
Website

Re: The Arch Hurd Project

I've got glibc 2.7 to build with those patches, but it's missing stubs-32.h and without that libpthread won't compile. Google isn't being much help here.

edit: moving my local copy of stubs-64.h to /usr/lib/cross-i686-pc-gnu/include/gnu/stubs-32.h makes it compile; not sure if it'll work properly though. If it appears in the package after the second pass of glibc I'll rebuild libpthread and gcc just to be safe.

edit 2: Oh, no, it didn't work. It just died later in the compilation process and I didn't notice.

Last edited by Barrucadu (2010-01-06 23:14:53)

Offline

#37 2010-01-07 00:05:58

bobdob
Member
Registered: 2008-06-13
Posts: 138

Re: The Arch Hurd Project

I have been try to make this work as well.
Does it fail with "ld: can not find libcrt.a".
If so remove the reference from "/usr/lib/cross-i686-pc-gnu/lib/libc.a", I just added "sed -i 's/libcrt.a //' $pkgdir/usr/lib/cross-i686-pc-gnu/lib/libc.a" to the bottom for the glibc PKGBUILD.
But still it fails later complaining that the c compiler cannot create executables. Which lead me to notice that gcc-pass1 can't either, and now I'm back where i started almost.

Offline

#38 2010-01-07 10:01:05

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,365
Website

Re: The Arch Hurd Project

Barrucadu wrote:

I've got glibc 2.7 to build with those patches, but it's missing stubs-32.h and without that libpthread won't compile. Google isn't being much help here.

edit: moving my local copy of stubs-64.h to /usr/lib/cross-i686-pc-gnu/include/gnu/stubs-32.h makes it compile; not sure if it'll work properly though. If it appears in the package after the second pass of glibc I'll rebuild libpthread and gcc just to be safe.

edit 2: Oh, no, it didn't work. It just died later in the compilation process and I didn't notice.

Just touching that file should be fine...  using the 64bit version in place of the 32bit one is probably not a good thing!

Offline

#39 2010-01-07 10:51:12

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,365
Website

Re: The Arch Hurd Project

bobdob wrote:

I have been try to make this work as well.
Does it fail with "ld: can not find libcrt.a".
If so remove the reference from "/usr/lib/cross-i686-pc-gnu/lib/libc.a", I just added "sed -i 's/libcrt.a //' $pkgdir/usr/lib/cross-i686-pc-gnu/lib/libc.a" to the bottom for the glibc PKGBUILD.
But still it fails later complaining that the c compiler cannot create executables. Which lead me to notice that gcc-pass1 can't either, and now I'm back where i started almost.

Correct.  gcc (pass 1) will not be able to create executables until the needed libraries from glibc are installed.  That is why the first gcc build is very minimal and should have been hopefully enough to build enough of glibc to finish the process.

Looking at the know to work package versions, perhaps we should downgrade binutils to 2.19 along with glibc to 2.7 with all those patches.  I will try that tomorrow.

Offline

#40 2010-01-07 21:52:40

Barrucadu
Member
From: York, England
Registered: 2008-03-30
Posts: 1,158
Website

Re: The Arch Hurd Project

I'm still not able to get libpthread to compile after glibc pass one.

Last edited by Barrucadu (2010-01-07 21:52:53)

Offline

#41 2010-01-07 22:26:16

bobdob
Member
Registered: 2008-06-13
Posts: 138

Re: The Arch Hurd Project

Barrucadu wrote:

I'm still not able to get libpthread to compile after glibc pass one.

Same.
I just tried with binutils 2.19 and glibc 2.7 and I still can't get it to work. With glibc 2.7 it compiles crt1.o which 2.11 and 2.10 didn't, but it still can't build libpthread.

Offline

#42 2010-01-07 22:36:43

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,365
Website

Re: The Arch Hurd Project

Can someone please post the PKGBUILD for glibc-2.7 with those patches?  I am going to look at this today but I am also feeling lazy...

Offline

#43 2010-01-07 23:06:11

Barrucadu
Member
From: York, England
Registered: 2008-03-30
Posts: 1,158
Website

Re: The Arch Hurd Project

# Maintainer: Allan McRae <allan@archlinux.org>

# cross toolchain build order: binutils, gcc (pass 1), gnumach-headers, mig, hurd-headers,
#                              glibc (pass 1), libpthread, gcc (pass 2), glibc (pass 2)

_target=i686-pc-gnu
_sysroot=/usr/lib/cross-${_target}
_pass=1   # 1 or 2

pkgname=cross-${_target}-glibc
pkgver=2.7
pkgrel=1
pkgdesc="Hurd cross-toolchain GNU C Library"
arch=('i686' 'x86_64')
url="http://www.gnu.org/software/libc"
license=('GPL' 'LGPL')
groups=('base')
depends=("cross-${_target}-gnumach-headers" "cross-${_target}-hurd-headers")
makedepends=("cross-${_target}-gcc")
source=(http://ftp.gnu.org/gnu/glibc/glibc-$pkgver.tar.gz
        'http://www.schwinge.homeip.net/~thomas/tmp/glibc-patches/0003-2007-09-13-H.J.-Lu-hongjiu.lu-intel.com.patch'
    'http://www.schwinge.homeip.net/~thomas/tmp/glibc-patches/0005-Hurd-specific-kernel-features.h.patch'
    'http://www.schwinge.homeip.net/~thomas/tmp/glibc-patches/0007-2007-10-05-version-of-stat.patch'
    'http://www.schwinge.homeip.net/~thomas/tmp/glibc-patches/0008-r2425-of-debian-patches-hurd-i386-local-atomic-no-mu.patch'
    'http://www.schwinge.homeip.net/~thomas/tmp/glibc-patches/0010-r2425-of-debian-patches-hurd-i386-local-gscope.diff.patch'
    'http://www.schwinge.homeip.net/~thomas/tmp/glibc-patches/0012-r2425-of-debian-patches-hurd-i386-local-no-strerror_.patch'
    'http://www.schwinge.homeip.net/~thomas/tmp/glibc-patches/0013-r2626-of-debian-patches-hurd-i386-local-tls-support.patch'
    'http://www.schwinge.homeip.net/~thomas/tmp/glibc-patches/0014-r2591-of-debian-patches-hurd-i386-local-tls.diff.patch'
    'http://www.schwinge.homeip.net/~thomas/tmp/glibc-patches/0015-r2630-of-debian-patches-hurd-i386-submitted-libc_onc.patch'
    'http://www.schwinge.homeip.net/~thomas/tmp/glibc-patches/0016-Include-stdint.h.patch'
    'http://www.schwinge.homeip.net/~thomas/tmp/glibc-patches/0017-r2598-of-debian-patches-any-local-stdio-lock.diff.patch'
    'http://www.schwinge.homeip.net/~thomas/tmp/glibc-patches/0018-r2650-of-debian-patches-hurd-i386-submitted-strtoul.patch'
    'http://www.schwinge.homeip.net/~thomas/tmp/glibc-patches/0019-2007-11-12-Aurelien-Jarno-aurelien-aurel32.net-Tho.patch'
    'http://www.schwinge.homeip.net/~thomas/tmp/glibc-patches/0020-r2656-of-debian-patches-any-submitted-sched_h.diff.patch'
    'http://www.schwinge.homeip.net/~thomas/tmp/glibc-patches/0022-2007-11-18-Roland-McGrath-roland-frob.com.patch'
    'http://www.schwinge.homeip.net/~thomas/tmp/glibc-patches/0024-2007-03-18-Joseph-Myers-joseph-codesourcery.com.patch')
md5sums=('0b4bc75fb7413bbd7e43c0a0e7c672b6' '57771280464dd2c65f00c9e44caff348'\
         'c641b520a27a7de357517a8884bafb87' '89749b31945a6c162c14cb1792c81072'\
         '7102cce3402901683ab46b2928ca6b0e' '6e4a9bc45a2bf4b523636f3c149eba61'\
         '594a6f80e0cc5039111a63b64e9b679d' 'b75581aa00d307f5db2f52d0aac67f8a'\
         '5127dbf88a50f9d9b540db79410f59c7' 'efe7110f7d53428867fb61e9047cac5a'\
         '4e70d096b96840316664f3d70695ff6d' 'd176f3e3acd9b7b13912c131292c7f3e'\
         'f40ad29d3199d2c5326a976cb29cd7aa' '4d90a58ef34de9419c1f4c41411f041d'\
         'cf5e65ad5613df95de0eb3f5a18eb451' 'd898733da52a4c10b9c84507050fadbc'\
         'a685bad5672201d65171f566241832d0')

build() {
  cd $srcdir/glibc-$pkgver/

  patch -p1 < $srcdir/0003-2007-09-13-H.J.-Lu-hongjiu.lu-intel.com.patch || return 1
  patch -p1 < $srcdir/0005-Hurd-specific-kernel-features.h.patch || return 1
  patch -p1 < $srcdir/0007-2007-10-05-version-of-stat.patch || return 1
  patch -p1 < $srcdir/0008-r2425-of-debian-patches-hurd-i386-local-atomic-no-mu.patch || return 1
  patch -p1 < $srcdir/0010-r2425-of-debian-patches-hurd-i386-local-gscope.diff.patch || return 1
  patch -p1 < $srcdir/0012-r2425-of-debian-patches-hurd-i386-local-no-strerror_.patch || return 1
  patch -p1 < $srcdir/0013-r2626-of-debian-patches-hurd-i386-local-tls-support.patch || return 1
  patch -p1 < $srcdir/0014-r2591-of-debian-patches-hurd-i386-local-tls.diff.patch || return 1
  patch -p1 < $srcdir/0015-r2630-of-debian-patches-hurd-i386-submitted-libc_onc.patch || return 1
  patch -p1 < $srcdir/0016-Include-stdint.h.patch || return 1
  patch -p1 < $srcdir/0017-r2598-of-debian-patches-any-local-stdio-lock.diff.patch || return 1
  patch -p1 < $srcdir/0018-r2650-of-debian-patches-hurd-i386-submitted-strtoul.patch || return 1
  patch -p1 < $srcdir/0019-2007-11-12-Aurelien-Jarno-aurelien-aurel32.net-Tho.patch || return 1
  patch -p1 < $srcdir/0020-r2656-of-debian-patches-any-submitted-sched_h.diff.patch || return 1
  patch -p1 < $srcdir/0022-2007-11-18-Roland-McGrath-roland-frob.com.patch || return 1
  patch -p1 < $srcdir/0024-2007-03-18-Joseph-Myers-joseph-codesourcery.com.patch || return 1

  mkdir build
  cd build

  ../configure --prefix= \
    --build=$CHOST --host=${_target} --target=${_target} \
    --without-cvs --disable-profile \
    --with-headers=${_sysroot}/include --without-tls

  if [ ${_pass} -eq 1 ]; then
    # build errors are expected as gcc and libpthread are not complete/installed
    # force finishing make
    make -k || echo
    make -k install_root=$pkgdir/${_sysroot} install || echo
  else
    make
    make install_root=$pkgdir/${_sysroot} install
  fi
}

Last edited by Barrucadu (2010-01-07 23:07:33)

Offline

#44 2010-01-08 00:03:25

bobdob
Member
Registered: 2008-06-13
Posts: 138

Re: The Arch Hurd Project

This one uses the debian patches, but it fails fairly quickly, so its more just a reference.

# Maintainer: Allan McRae <allan@archlinux.org>

# cross toolchain build order: binutils, gcc (pass 1), gnumach-headers, mig, hurd-headers,
#                              glibc (pass 1), libpthread, gcc (pass 2), glibc (pass 2)

_target=i686-pc-gnu
_sysroot=/usr/lib/cross-${_target}
_pass=1   # 1 or 2

pkgname=cross-${_target}-glibc
pkgver=2.7
pkgrel=1
pkgdesc="Hurd cross-toolchain GNU C Library"
arch=('i686' 'x86_64')
url="http://www.gnu.org/software/libc"
license=('GPL' 'LGPL')
groups=('base')
depends=("cross-${_target}-gnumach-headers" "cross-${_target}-hurd-headers")
makedepends=("cross-${_target}-gcc")
source=(http://ftp.gnu.org/gnu/glibc/glibc-$pkgver.tar.bz2
        http://patch-tracker.debian.org/patch/series/dl/eglibc/2.11~0exp1-0exp1/hurd-i386/local-dl-dynamic-weak.diff
        http://patch-tracker.debian.org/patch/series/dl/eglibc/2.11~0exp1-0exp1/hurd-i386/local-enable-ldconfig.diff
        http://patch-tracker.debian.org/patch/series/dl/eglibc/2.11~0exp1-0exp1/hurd-i386/local-mlock.diff
        http://patch-tracker.debian.org/patch/series/dl/eglibc/2.11~0exp1-0exp1/hurd-i386/local-tls.diff
        http://patch-tracker.debian.org/patch/series/dl/eglibc/2.11~0exp1-0exp1/hurd-i386/local-tls-support.diff
        http://patch-tracker.debian.org/patch/series/dl/eglibc/2.11~0exp1-0exp1/hurd-i386/local-gcc-4.1-init-first.diff
        http://patch-tracker.debian.org/patch/series/dl/eglibc/2.11~0exp1-0exp1/hurd-i386/submitted-ioctl-decode-argument.diff
        http://patch-tracker.debian.org/patch/series/dl/eglibc/2.11~0exp1-0exp1/hurd-i386/submitted-libc_once.diff
        http://patch-tracker.debian.org/patch/series/dl/eglibc/2.11~0exp1-0exp1/hurd-i386/submitted-ptr-mangle.diff 
        http://patch-tracker.debian.org/patch/series/dl/eglibc/2.11~0exp1-0exp1/hurd-i386/submitted-stat.diff
        http://patch-tracker.debian.org/patch/series/dl/eglibc/2.11~0exp1-0exp1/hurd-i386/submitted-strtoul.diff
        http://patch-tracker.debian.org/patch/series/dl/eglibc/2.11~0exp1-0exp1/hurd-i386/submitted-sysvshm.diff
        http://patch-tracker.debian.org/patch/series/dl/eglibc/2.11~0exp1-0exp1/hurd-i386/submitted-ioctl-unsigned-size_t.diff
        http://patch-tracker.debian.org/patch/series/dl/eglibc/2.11~0exp1-0exp1/hurd-i386/submitted-ECANCELED.diff
        http://patch-tracker.debian.org/patch/series/dl/eglibc/2.11~0exp1-0exp1/hurd-i386/submitted-IPV6_PKTINFO.diff
        http://patch-tracker.debian.org/patch/series/dl/eglibc/2.11~0exp1-0exp1/hurd-i386/submitted-extern_inline.diff
        http://patch-tracker.debian.org/patch/series/dl/eglibc/2.11~0exp1-0exp1/hurd-i386/submitted-critical-sections.diff
        http://patch-tracker.debian.org/patch/series/dl/eglibc/2.11~0exp1-0exp1/hurd-i386/submitted-dup2-fix.diff
        http://patch-tracker.debian.org/patch/series/dl/eglibc/2.11~0exp1-0exp1/hurd-i386/local-pthread_posix-option.diff
        http://patch-tracker.debian.org/patch/series/dl/eglibc/2.11~0exp1-0exp1/hurd-i386/local-check_native.diff
        http://patch-tracker.debian.org/patch/series/dl/eglibc/2.11~0exp1-0exp1/hurd-i386/submitted-dl-sysdep.diff
        http://patch-tracker.debian.org/patch/series/dl/eglibc/2.11~0exp1-0exp1/hurd-i386/submitted-itimer-lock.diff
        http://patch-tracker.debian.org/patch/series/dl/eglibc/2.11~0exp1-0exp1/hurd-i386/local-pthread_types.diff
        http://patch-tracker.debian.org/patch/series/dl/eglibc/2.11~0exp1-0exp1/hurd-i386/local-_dl_random.diff
        http://patch-tracker.debian.org/patch/series/dl/eglibc/2.11~0exp1-0exp1/hurd-i386/local-unwind-resume.diff
        http://patch-tracker.debian.org/patch/series/dl/eglibc/2.11~0exp1-0exp1/hurd-i386/submitted-null-pathname.diff
        http://patch-tracker.debian.org/patch/series/dl/eglibc/2.11~0exp1-0exp1/hurd-i386/submitted-sbrk.diff
        http://patch-tracker.debian.org/patch/series/dl/eglibc/2.11~0exp1-0exp1/hurd-i386/local-thread-cancel.diff
        http://patch-tracker.debian.org/patch/series/dl/eglibc/2.11~0exp1-0exp1/hurd-i386/submitted-readlinkat.diff
        http://patch-tracker.debian.org/patch/series/dl/eglibc/2.11~0exp1-0exp1/hurd-i386/submitted-SOL_IP.patch
        http://patch-tracker.debian.org/patch/series/dl/eglibc/2.11~0exp1-0exp1/hurd-i386/local-bigmem.diff
        http://patch-tracker.debian.org/patch/series/dl/eglibc/2.11~0exp1-0exp1/hurd-i386/local-disable-ioctls.diff)

md5sums=(#'2c990f97e9ff9fb1c3c85fe826e991b9'
         '065c5952b439deba40083ccd67bcc8f7'
         'f56d571613b1fc93d1ff427cc793444a'
         '1a7d7307d805e1964ef2f8ffe51906c1'
         '139d74c68e9b8c31f263ac7b442b63ec'
         'f1d45b49fd3a2c6f5be2ac7b78e30d15'
         'fb4624a3eedfe88622e8c878056491f0'
         'be6eb77fc81ed3116392b0c194bdf0fe'
         'a9405f6901922f08d717d78efaeee6ec'
         'd4ba4848e8c0a37914fbbb1acb1e121f'
         '02f40f285529fb105922a88a73551b6d'
         '8d0a6017bf347e1bdcd7e4f3eaf86a4f'
         '4c1f7825eb78a25e913e8612c311f3f4'
         '5113db4a028dcb4a9d42b271bf8c1898'
         '9e7b4448f6471ccd3435c0c89cbe2d43'
         '50b28e1b2a21eabb3d0df7b9a8eb8324'
         '71f789cbb3d6610a262a984b940b98fe'
         '590b71a52df8553c2d6fad8d0270fa20'
         '1c428c154463b610b26648f7563feb5c'
         '40e626669aefa4642d801109fc022024'
         'b5201a76879080dc5d738cab97214bed'
         'db596d4539d9598f8a5d390dc5c6e781'
         'e3ae72d58fd3ec6447fe5f48c84829f7'
         'd1c93cfbe7ad6a1a63e09bab3cdccdc7'
         'b6f7fee93aa4e350bc2a90f1b0b95d3a'
         '8b6c75ff647cdd0d3d5a023dd8652744'
         '5a45b2861bf6c39b50be1149d14a58c4'
         '069946fd414c60e0ae08f16efe4b1f59'
         '87cc8871fe2183baebae95ff5cd69b3f'
         'd02a7b8851e0ecbe4993e0c0942d2bef'
         'bb64bd6d21e5ec05007bbd71f257e52e'
         'f8dbbaf7f2d7da91d8c17820e0056c2e'
         '0c1e22753988cc9779f9d861e4dc25c1'
         '147f7ff378c7818f41c1c965a49217e5')

build() {
  cd $srcdir/glibc-$pkgver

  # patch from debian
  patch -Np1 -i $srcdir/local-dl-dynamic-weak.diff || return 1;
  patch -Np1 -i $srcdir/local-enable-ldconfig.diff || return 1;
  patch -Np1 -i $srcdir/local-mlock.diff || return 1;
  patch -Np1 -i $srcdir/local-tls.diff || return 1;
  # Doesn't apply
  # patch -Np1 -i $srcdir/local-tls-support.diff || return 1;
  patch -Np1 -i $srcdir/local-gcc-4.1-init-first.diff || return 1;
  patch -Np1 -i $srcdir/submitted-ioctl-decode-argument.diff || return 1;
  # Doesn't apply
  # patch -Np1 -i $srcdir/submitted-libc_once.diff || return 1;
  patch -Np1 -i $srcdir/submitted-ptr-mangle.diff || return 1;
  patch -Np1 -i $srcdir/submitted-stat.diff || return 1;
  patch -Np1 -i $srcdir/submitted-strtoul.diff || return 1;
  patch -Np1 -i $srcdir/submitted-sysvshm.diff || return 1;
  patch -Np1 -i $srcdir/submitted-ioctl-unsigned-size_t.diff || return 1;
  patch -Np1 -i $srcdir/submitted-ECANCELED.diff || return 1;
  patch -Np1 -i $srcdir/submitted-IPV6_PKTINFO.diff || return 1;
  # Doesn't apply
  # patch -Np1 -i $srcdir/submitted-extern_inline.diff || return 1;
  patch -Np1 -i $srcdir/submitted-critical-sections.diff || return 1;
  patch -Np1 -i $srcdir/submitted-dup2-fix.diff || return 1;
  patch -Np1 -i $srcdir/local-pthread_posix-option.diff || return 1;
  patch -Np1 -i $srcdir/local-check_native.diff || return 1;
  patch -Np1 -i $srcdir/submitted-dl-sysdep.diff || return 1;
  patch -Np1 -i $srcdir/submitted-itimer-lock.diff || return 1;
  patch -Np1 -i $srcdir/local-pthread_types.diff || return 1;
  patch -Np1 -i $srcdir/local-_dl_random.diff || return 1;
  patch -Np1 -i $srcdir/local-unwind-resume.diff || return 1;
  patch -Np1 -i $srcdir/submitted-null-pathname.diff || return 1;
  patch -Np1 -i $srcdir/submitted-sbrk.diff || return 1;
  patch -Np1 -i $srcdir/local-thread-cancel.diff || return 1;
  patch -Np1 -i $srcdir/submitted-readlinkat.diff || return 1;
  patch -Np1 -i $srcdir/submitted-SOL_IP.patch || return 1;
  patch -Np1 -i $srcdir/local-bigmem.diff || return 1;
  patch -Np1 -i $srcdir/local-disable-ioctls.diff || return 1;

  mkdir build && cd build

  ../configure --prefix= \
    --build=$CHOST --host=${_target} --target=${_target} \
    --without-cvs --disable-profile \
    --with-headers=${_sysroot}/include \

  if [ ${_pass} -eq 1 ]; then
    # build errors are expected as gcc and libpthread are not complete/installed
    # force finishing make
    make -k || echo
    make -k install_root=$pkgdir/${_sysroot} install || echo
    sed -i 's/libcrt.a //' $pkgdir/${_sysroot}/lib/libc.a
  else
    make
    make install_root=$pkgdir/${_sysroot} install
  fi
}

For me glibc 2.7 with or without the other patches doesn't seem to make much difference.

Offline

#45 2010-01-08 07:46:11

Barrucadu
Member
From: York, England
Registered: 2008-03-30
Posts: 1,158
Website

Re: The Arch Hurd Project

I would imagine it fails more quickly because those patches are for eglibc 2.11, not glibc 2.7

Last edited by Barrucadu (2010-01-08 07:49:16)

Offline

#46 2010-01-08 08:01:30

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,365
Website

Re: The Arch Hurd Project

WOO!

allan@arch ~/tmp/hello
> ~/hurd/bin/i586-pc-gnu-gcc -o hello hello.c 

allan@arch ~/tmp/hello
> file ./hello
./hello: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Hurd 0.0.0, not stripped

I will see if I can do the same thing in PKGBUILD format now...  update soon!

Edit: it appears the whole issue was the cross build process using the wrong ld at various stages.  I will just create a script to install a cross compiler somewhere on your system that is not in your path and we can use this.  Why make things more complicated than they are...

Offline

#47 2010-01-08 14:05:14

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,365
Website

Re: The Arch Hurd Project

Here we go...    http://allanmcrae.com/scripts/crosshurd.sh .  Set ROOT and HOST at the top of the script as appropriate.

TODO
  - try updated gcc (running now with gcc-4.4.2)
  - build for i686 target (requires using CFLAGS, see note in gcc_pass1).
  - newer binutils (need to patch glibc to detect).
  - newer glibc....


Edit: I noticed a couple of errors in the script, but it is late and I need sleep.  Expect a new version tomorrow.

Offline

#48 2010-01-08 14:56:24

bobdob
Member
Registered: 2008-06-13
Posts: 138

Re: The Arch Hurd Project

I think I might have just built a working glibc2.7

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

int main ()
{
    printf ("hello world\n");
    return 0;
}
$ i686-pc-gnu-gcc -o hello hello.c 
In file included from /usr/lib/cross-i686-pc-gnu/include/features.h:354,
                 from /usr/lib/cross-i686-pc-gnu/include/stdio.h:28,
                 from hello.c:1:
/usr/lib/cross-i686-pc-gnu/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory
$ sudo touch /usr/lib/cross-i686-pc-gnu/include/gnu/stubs-32.h
$ i686-pc-gnu-gcc -o hello hello.c
$ file hello
hello: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Hurd 0.0.0, not stripped

Here is the PKGBUILD I use. I copied the BUILD_CC, CC, AR, and RANLIB from clfs and added LD.

# Maintainer: Allan McRae <allan@archlinux.org>

# cross toolchain build order: binutils, gcc (pass 1), gnumach-headers, mig, hurd-headers,
#                              glibc (pass 1), libpthread, gcc (pass 2), glibc (pass 2)

_target=i686-pc-gnu
_sysroot=/usr/lib/cross-${_target}
_pass=1   # 1 or 2

pkgname=cross-${_target}-glibc
pkgver=2.7
pkgrel=1
pkgdesc="Hurd cross-toolchain GNU C Library"
arch=('i686' 'x86_64')
url="http://www.gnu.org/software/libc"
license=('GPL' 'LGPL')
groups=('base')
depends=("cross-${_target}-gnumach-headers" "cross-${_target}-hurd-headers")
makedepends=("cross-${_target}-gcc")
source=(http://ftp.gnu.org/gnu/glibc/glibc-$pkgver.tar.bz2
        http://www.schwinge.homeip.net/~thomas/tmp/glibc-patches/0003-2007-09-13-H.J.-Lu-hongjiu.lu-intel.com.patch
        http://www.schwinge.homeip.net/~thomas/tmp/glibc-patches/0005-Hurd-specific-kernel-features.h.patch
        http://www.schwinge.homeip.net/~thomas/tmp/glibc-patches/0007-2007-10-05-version-of-stat.patch
        http://www.schwinge.homeip.net/~thomas/tmp/glibc-patches/0008-r2425-of-debian-patches-hurd-i386-local-atomic-no-mu.patch
        http://www.schwinge.homeip.net/~thomas/tmp/glibc-patches/0009-2007-07-22-version-of-init-first.c_vs._GCC_4.1.patch
        http://www.schwinge.homeip.net/~thomas/tmp/glibc-patches/0010-r2425-of-debian-patches-hurd-i386-local-gscope.diff.patch
        http://www.schwinge.homeip.net/~thomas/tmp/glibc-patches/0011-2007-02-08-version-of-resolv_res_send.c.patch.patch
        http://www.schwinge.homeip.net/~thomas/tmp/glibc-patches/0012-r2425-of-debian-patches-hurd-i386-local-no-strerror_.patch
        http://www.schwinge.homeip.net/~thomas/tmp/glibc-patches/0013-r2626-of-debian-patches-hurd-i386-local-tls-support.patch
        http://www.schwinge.homeip.net/~thomas/tmp/glibc-patches/0014-r2591-of-debian-patches-hurd-i386-local-tls.diff.patch
        http://www.schwinge.homeip.net/~thomas/tmp/glibc-patches/0015-r2630-of-debian-patches-hurd-i386-submitted-libc_onc.patch
        http://www.schwinge.homeip.net/~thomas/tmp/glibc-patches/0016-Include-stdint.h.patch
        http://www.schwinge.homeip.net/~thomas/tmp/glibc-patches/0017-r2598-of-debian-patches-any-local-stdio-lock.diff.patch
        http://www.schwinge.homeip.net/~thomas/tmp/glibc-patches/0018-r2650-of-debian-patches-hurd-i386-submitted-strtoul.patch
        http://www.schwinge.homeip.net/~thomas/tmp/glibc-patches/0019-2007-11-12-Aurelien-Jarno-aurelien-aurel32.net-Tho.patch
        http://www.schwinge.homeip.net/~thomas/tmp/glibc-patches/0020-r2656-of-debian-patches-any-submitted-sched_h.diff.patch
        http://www.schwinge.homeip.net/~thomas/tmp/glibc-patches/0022-2007-11-18-Roland-McGrath-roland-frob.com.patch
        http://www.schwinge.homeip.net/~thomas/tmp/glibc-patches/0024-2007-03-18-Joseph-Myers-joseph-codesourcery.com.patch)
md5sums=('065c5952b439deba40083ccd67bcc8f7'
         '57771280464dd2c65f00c9e44caff348'
         'c641b520a27a7de357517a8884bafb87'
         '89749b31945a6c162c14cb1792c81072'
         '7102cce3402901683ab46b2928ca6b0e'
         '680a775484ec811a9eb52b2c5f43c5ca'
         '6e4a9bc45a2bf4b523636f3c149eba61'
         'cc273d14e314522a8ba3017859c6e089'
         '594a6f80e0cc5039111a63b64e9b679d'
         'b75581aa00d307f5db2f52d0aac67f8a'
         '5127dbf88a50f9d9b540db79410f59c7'
         'efe7110f7d53428867fb61e9047cac5a'
         '4e70d096b96840316664f3d70695ff6d'
         'd176f3e3acd9b7b13912c131292c7f3e'
         'f40ad29d3199d2c5326a976cb29cd7aa'
         '4d90a58ef34de9419c1f4c41411f041d'
         'cf5e65ad5613df95de0eb3f5a18eb451'
         'd898733da52a4c10b9c84507050fadbc'
         'a685bad5672201d65171f566241832d0')

build() {
  cd $srcdir/glibc-$pkgver

  # Patches, doesn't apply 09 11
  for i in 03 05 07 08 10 12 13 14 15 16 17 18 19 20 22 24; do
    patch -Np1 -i $srcdir/00$i* || return 1
  done

  mkdir build && cd build

  BUILD_CC="gcc" CC="${_target}-gcc" LD="${_target}-ld" \
  AR="${_target}-ar" RANLIB="${_target}-ranlib" \
  ../configure --prefix= \
    --build=$CHOST --host=${_target} --target=${_target} \
    --without-cvs --disable-profile \
    --with-headers=${_sysroot}/include \

  if [ ${_pass} -eq 1 ]; then
    # build errors are expected as gcc and libpthread are not complete/installed
    # force finishing make
    make -k || echo
    make -k install_root=$pkgdir/${_sysroot} install || echo
    sed -i 's/libcrt.a //' $pkgdir/${_sysroot}/lib/libc.a
  else
    make
    make install_root=$pkgdir/${_sysroot} install
  fi
}

Now to see if libpthreads builds

Edit: Just built cross-i686-pc-gnu-libpthread and it worked.

Edit2: But gcc pass 2 doesn't hmm

Last edited by bobdob (2010-01-08 15:26:47)

Offline

#49 2010-01-08 16:18:35

Barrucadu
Member
From: York, England
Registered: 2008-03-30
Posts: 1,158
Website

Re: The Arch Hurd Project

Excellent, I'll start playing with the script immediately.

Last edited by Barrucadu (2010-01-08 18:42:06)

Offline

#50 2010-01-08 16:40:06

Pierre
Developer
From: Bonn
Registered: 2004-07-05
Posts: 1,964
Website

Re: The Arch Hurd Project

Wouldn't it be easier to bootsrap from e.g. Debian? Build some initial packages, install them into a chroot etc..

Offline

Board footer

Powered by FluxBB