LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   gcc 3.4.0 and glibc (https://www.linuxquestions.org/questions/linux-from-scratch-13/gcc-3-4-0-and-glibc-174513/)

ralam 04-25-2004 07:20 PM

gcc 3.4.0 and glibc
 
In Chapter 5, when compiling glibc 2.3.3 with the just bootstrapped gcc 3.4.0 and linux headers 2.6.5, I get this error:
make -C elf subdir_lib
make[2]: Entering directory `/mnt/linux/sources/untarred/glibc-2.3.3-20031202/elf'
gcc -B/tools/bin/ dl-runtime.c -c -std=gnu99 -O2 -Wall -Winline -Wstrict-prototypes -Wwrite-strings -g -mpreferred-stack-boundary=2 -fexceptions -fasynchronous-unwind-tables -I../include -I. -I/mnt/linux/sources/untarred/glibc-build/elf -I.. -I../libio -I/mnt/linux/sources/untarred/glibc-build -I../sysdeps/i386/elf -I../linuxthreads/sysdeps/unix/sysv/linux/i386 -I../linuxthreads/sysdeps/unix/sysv/linux -I../linuxthreads/sysdeps/pthread -I../sysdeps/pthread -I../linuxthreads/sysdeps/unix/sysv -I../linuxthreads/sysdeps/unix -I../linuxthreads/sysdeps/i386/i686 -I../linuxthreads/sysdeps/i386 -I../sysdeps/unix/sysv/linux/i386 -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../sysdeps/unix/sysv/i386 -I../sysdeps/unix/sysv -I../sysdeps/unix/i386 -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/i386/i686/fpu -I../sysdeps/i386/i686 -I../sysdeps/i386/i486 -I../sysdeps/i386/fpu -I../sysdeps/i386 -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/ldbl-96 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic -nostdinc -isystem /mnt/linux/tools/bin/../lib/gcc/i686-pc-linux-gnu/3.4.0/include -isystem /tools/include -D_LIBC_REENTRANT -include ../include/libc-symbols.h -o /mnt/linux/sources/untarred/glibc-build/elf/dl-runtime.o -MD -MP -MF /mnt/linux/sources/untarred/glibc-build/elf/dl-runtime.o.dt
dl-runtime.c:56: error: conflicting types for 'fixup'
../sysdeps/i386/dl-machine.h:158: error: previous declaration of 'fixup' was here
dl-runtime.c:56: error: conflicting types for 'fixup'
../sysdeps/i386/dl-machine.h:158: error: previous declaration of 'fixup' was here
dl-runtime.c:141: error: conflicting types for 'profile_fixup'
../sysdeps/i386/dl-machine.h:161: error: previous declaration of 'profile_fixup' was here
dl-runtime.c:141: error: conflicting types for 'profile_fixup'
../sysdeps/i386/dl-machine.h:161: error: previous declaration of 'profile_fixup' was here
../sysdeps/i386/dl-machine.h:158: warning: 'fixup' declared `static' but never defined
../sysdeps/i386/dl-machine.h:161: warning: 'profile_fixup' declared `static' but never defined
make[2]: *** [/mnt/linux/sources/untarred/glibc-build/elf/dl-runtime.o] Error 1
make[2]: Leaving directory `/mnt/linux/sources/untarred/glibc-2.3.3-20031202/elf'
make[1]: *** [elf/subdir_lib] Error 2
make[1]: Leaving directory `/mnt/linux/sources/untarred/glibc-2.3.3-20031202'
make: *** [all] Error 2
I have no overriding environment variables like CFLAGS and CXXFLAGS set. How do I solve this error?

apeiro 05-01-2004 05:45 PM

Try this...

Code:

diff -u -r1.124 -r1.125
--- libc/sysdeps/i386/dl-machine.h      2004/03/05 10:14:49    1.124
+++ libc/sysdeps/i386/dl-machine.h      2004/03/09 07:42:29    1.125
@@ -154,11 +154,14 @@
    destroys the passed register information.  */
 /* GKM FIXME: Fix trampoline to pass bounds so we can do
    without the `__unbounded' qualifier.  */
-static ElfW(Addr) fixup (struct link_map *__unbounded l, ElfW(Word) reloc_offset)
-    __attribute__ ((regparm (2), unused));
+#define ARCH_FIXUP_ATTRIBUTE __attribute__ ((regparm (3), unused))
+
+static ElfW(Addr) fixup (struct link_map *__unbounded l,
+                        ElfW(Word) reloc_offset)
+    ARCH_FIXUP_ATTRIBUTE;
 static ElfW(Addr) profile_fixup (struct link_map *l, ElfW(Word) reloc_offset,
                                ElfW(Addr) retaddr)
-    __attribute__ ((regparm (3), unused));
+    ARCH_FIXUP_ATTRIBUTE;
 # endif

 /* This code is used in dl-runtime.c to call the `fixup' function
===================================================================
--- /home/dank/downloads/glibc-2.3.2/elf/dl-runtime.c  Fri Feb  7 11:41:12 2003
+++ glibc-2.3.2/elf/dl-runtime.c        Thu Apr  8 22:24:26 2004
@@ -36,6 +36,12 @@
 # define VERSYMIDX(sym)        (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGIDX (sym))
 #endif

+/* The fixup functions might have need special attributes.  If none
+  are provided define the macro as empty.  */
+#ifndef ARCH_FIXUP_ATTRIBUTE
+# define ARCH_FIXUP_ATTRIBUTE
+#endif
+

 /* This function is called through a special trampoline from the PLT the
    first time each PLT entry is called.  We must perform the relocation
@@ -45,7 +51,7 @@
    function.  */

 #ifndef ELF_MACHINE_NO_PLT
-static ElfW(Addr) __attribute_used__
+static ElfW(Addr) __attribute_used__ ARCH_FIXUP_ATTRIBUTE
 fixup (
 # ifdef ELF_MACHINE_RUNTIME_FIXUP_ARGS
        ELF_MACHINE_RUNTIME_FIXUP_ARGS,
@@ -132,7 +138,7 @@

 #if !defined PROF && !defined ELF_MACHINE_NO_PLT && !__BOUNDED_POINTERS__

-static ElfW(Addr) __attribute_used__
+static ElfW(Addr) __attribute_used__ ARCH_FIXUP_ATTRIBUTE
 profile_fixup (
 #ifdef ELF_MACHINE_RUNTIME_FIXUP_ARGS
        ELF_MACHINE_RUNTIME_FIXUP_ARGS,


apeiro 05-01-2004 06:34 PM

Note you may also need to use the -fno-unit-at-a-time compiler flag. I did.

Code:

make CFLAGS+="-fno-unit-at-a-time"

ralam 05-02-2004 06:03 PM

Ok, I solved the problem by using a more recent version of glibc (2.3.4)

cmcginty 05-04-2004 10:53 PM

Hey, exactly where did you get Glibc 2.3.4. I'm looking all over for this and can't seem to find it.

cmcginty 05-05-2004 02:11 AM

I am assuming you got it from the glbic CVS on sources.redhat.com. I haven't used CVS very much unfortunately. The version.h file says the current version is 2.3.3, yet looking at the Versions.def file there is a marker for 2.3.4. How can I get a list of tags in the libc module, or find out what date was the official 2.3.4 code?

Andrew Benton 05-05-2004 04:49 AM

This is the "all the packages" page for Bleeding Edge Linux From Scratch. Scroll to the bottom of the page and read note 2

cmcginty 05-05-2004 06:16 PM

Thanks, I didn't know there was a BE-LFS project. If I'm right, I think the page you were reffering to is this:

http://belfs.linux-phreak.net/chapter03/packages.html

Andrew Benton 05-06-2004 12:19 PM

Yes, sorry, I didn't realize I'd forgotten to post the link. How stupid of me. My apologies.


All times are GMT -5. The time now is 12:42 PM.