bug-hurd
[Top][All Lists]
Advanced

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

Re: [PATCH] Building the Hurd with gcc-4.0


From: Thomas Schwinge
Subject: Re: [PATCH] Building the Hurd with gcc-4.0
Date: Wed, 14 Sep 2005 21:44:45 +0200
User-agent: Mutt/1.5.9i

On Wed, Sep 07, 2005 at 09:51:48AM +0300, Ognyan Kulev wrote:
> Thomas Schwinge wrote:
> > The system stayed usable after installing the files, running
> > /hurd/ext2fs by hand didn't raise a segmentation fault.
> 
> OK, thanks.  I didn't invest much time in gcc 4.0 then but just switched
> to 3.3 :-)  And the only change I've made was something about argp - I
> was only interested in "make ext2fs".

I'm currently having a look at that issue.

I wanted to build ext2fs (and the needed Hurd libraries) without
optimizations, which currently fails (even when using gcc-3.3):
#v+
[...]
gcc-3.3 
-Wl,-rpath-link=.:../libdiskfs/:../libfshelp/:../libhurdbugaddr/:../libihash/:../libiohelp/:../libpager/:../libports/:../libshouldbeinlibc/:../libstore/:../libthreads/
 -std=gnu99 -Wall -g -O3 -pipe -O0 -g    -uargp_program_bug_address -o ext2fs \
              balloc.o dir.o ext2fs.o getblk.o hyper.o ialloc.o inode.o pager.o 
pokel.o truncate.o storeinfo.o msg.o \
      '-Wl,-(' ../libhurdbugaddr/libhurdbugaddr.so ../libdiskfs/libdiskfs.so 
../libpager/libpager.so ../libiohelp/libiohelp.so ../libfshelp/libfshelp.so 
../libstore/libstore.so ../libthreads/libthreads.so ../libports/libports.so 
../libihash/libihash.so ../libshouldbeinlibc/libshouldbeinlibc.so \
                 \
      '-Wl,-)'
balloc.o: In function `ext2_free_blocks':
../../hurd-0-branch.1.tmp/ext2fs/balloc.c:107: undefined reference to 
`clear_bit'
../../hurd-0-branch.1.tmp/ext2fs/balloc.c:116: undefined reference to 
`record_global_poke'
../../hurd-0-branch.1.tmp/ext2fs/balloc.c:118: undefined reference to 
`record_global_poke'
../../hurd-0-branch.1.tmp/ext2fs/balloc.c:128: undefined reference to 
`alloc_sync'
balloc.o: In function `ext2_new_block':
../../hurd-0-branch.1.tmp/ext2fs/balloc.c:188: undefined reference to `test_bit'
[...]
#v-

I came up the the below inlined patch to solve most of those; stolen
from libdiskfs.  ;-)
Is that fix reasonable?

One undefined reference still remained:
#v+
[...]
gcc-3.3 
-Wl,-rpath-link=.:../libdiskfs/:../libfshelp/:../libhurdbugaddr/:../libihash/:../libiohelp/:../libpager/:../libports/:../libshouldbeinlibc/:../libstore/:../libthreads/
 -std=gnu99 -Wall -g -O3 -pipe -O0 -g    -uargp_program_bug_address -o ext2fs \
              balloc.o dir.o ext2fs.o extern-inline.o getblk.o hyper.o ialloc.o 
inode.o pager.o pokel.o truncate.o storeinfo.o msg.o \
      '-Wl,-(' ../libhurdbugaddr/libhurdbugaddr.so ../libdiskfs/libdiskfs.so 
../libpager/libpager.so ../libiohelp/libiohelp.so ../libfshelp/libfshelp.so 
../libstore/libstore.so ../libthreads/libthreads.so ../libports/libports.so 
../libihash/libihash.so ../libshouldbeinlibc/libshouldbeinlibc.so \
                 \
      '-Wl,-)'
../libthreads/libthreads.so: undefined reference to `__hurd_threadvar_location'
collect2: ld returned 1 exit status
[...]
#v-

It seems to be caused by _pthread_self, which is defined in
libpthread/sysdeps/mach/hurd/pt-sysdep.h.  __hurd_threadvar_location is
defined in glibc's include/hurd/threadvar.h, which is included by
pt-sysdep.h.

I "fixed" that issue by rebuilding parts of the Hurd with optimizations.
Is there a real fix for that undefined reference?  Something like the
above one?


Regards,
 Thomas


ext2fs
2005-09-14  Thomas Schwinge  <schwinge@nic-nac-project.de>

        *  Makefile: Add extern-inline.c to SRCS.
        *  extern-inline.c: New file.


Wed Sep 14 19:26:08 CEST 2005  Thomas Schwinge <schwinge@nic-nac-project.de>
  * ext2fs/extern-inline.c
diff -rN -u old-hurd-0-branch.1.tmp/ext2fs/Makefile 
new-hurd-0-branch.1.tmp/ext2fs/Makefile
--- old-hurd-0-branch.1.tmp/ext2fs/Makefile     2005-09-14 21:39:09.394209344 
+0200
+++ new-hurd-0-branch.1.tmp/ext2fs/Makefile     2005-09-14 21:39:09.500193232 
+0200
@@ -20,7 +20,7 @@
 makemode := server
 
 target = ext2fs
-SRCS = balloc.c dir.c ext2fs.c getblk.c hyper.c ialloc.c \
+SRCS = balloc.c dir.c ext2fs.c extern-inline.c getblk.c hyper.c ialloc.c \
        inode.c pager.c pokel.c truncate.c storeinfo.c msg.c
 OBJS = $(SRCS:.c=.o)
 LCLHDRS = ext2fs.h ext2_fs.h ext2_fs_i.h bitmap.c
diff -rN -u old-hurd-0-branch.1.tmp/ext2fs/extern-inline.c 
new-hurd-0-branch.1.tmp/ext2fs/extern-inline.c
--- old-hurd-0-branch.1.tmp/ext2fs/extern-inline.c      1970-01-01 
01:00:00.000000000 +0100
+++ new-hurd-0-branch.1.tmp/ext2fs/extern-inline.c      2005-09-14 
21:39:09.502192928 +0200
@@ -0,0 +1,20 @@
+/* Run time callable functions for extern inlines.
+   Copyright (C) 2005 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2, or (at
+   your option) any later version.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#define EXT2FS_EI
+
+#include "ext2fs.h"





reply via email to

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