On 16/04/10 18:15, Andrew Benton wrote:
>
> make LD_LIBRARY_PATH=$(pwd)/$(uname -m)-unknown-linux-gnu/libgcc/
> works for me on x86_64 (I've not tried it on a 32 bit build yet).
>
Building on i686 failed at the first pass of glibc like so:
i686-lfs-linux-gnu-gcc ../sysdeps/i386/fpu/s_frexp.S -c -D__NO_MATH_INLINES
-D__LIBC_INTERNAL_MATH_INLINES -I../include
-I/mnt/lfs/sources/libc-build/math -I/mnt/lfs/sources/libc-build
-I../sysdeps/i386/elf -I../nptl/sysdeps/unix/sysv/linux/i386/i686
-I../sysdeps/unix/sysv/linux/i386/i686 -I../nptl/sysdeps/unix/sysv/linux/i386
-I../sysdeps/unix/sysv/linux/i386 -I../nptl/sysdeps/unix/sysv/linux
-I../nptl/sysdeps/pthread -I../sysdeps/pthread -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../nptl/sysdeps/unix/sysv
-I../sysdeps/unix/sysv -I../sysdeps/unix/i386 -I../nptl/sysdeps/unix
-I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/i386/i686/fpu
-I../nptl/sysdeps/i386/i686 -I../sysdeps/i386/i686 -I../sysdeps/i386/i486
-I../nptl/sysdeps/i386/i486 -I../sysdeps/i386/fpu -I../nptl/sysdeps/i386
-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 -I../nptl -I.. -I../libio
-I. -nostdinc -isystem
/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.5.0/include -isystem
/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.5.0/include-fixed -isystem
/tools/include -D_LIBC_REENTRANT -include ../include/libc-symbols.h
-DPIC -DSHARED -DASSEMBLER -DGAS_SYNTAX -g -Wa,--noexecstack -o
/mnt/lfs/sources/libc-build/math/s_frexp.os -MD -MP -MF
/mnt/lfs/sources/libc-build/math/s_frexp.os.dt -MT
/mnt/lfs/sources/libc-build/math/s_frexp.os
./sysdeps/i386/fpu/s_frexp.S: Assembler messages:
./sysdeps/i386/fpu/s_frexp.S:66: Error: invalid identifier for ".ifdef"
./sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized
character is `1'
./sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized
character is `1'
./sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized
character is `1'
./sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized
character is `.'
./sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized
character is `1'
./sysdeps/i386/fpu/s_frexp.S:66: Error: expected comma after name `' in .size
directive
./sysdeps/i386/fpu/s_frexp.S:66: Error: ".endif" without ".if"
./sysdeps/i386/fpu/s_frexp.S:66: Error: junk `.get_pc_thunk.dx' after expression
make[2]: *** [/mnt/lfs/sources/libc-build/math/s_frexp.os] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/mnt/lfs/sources/glibc-2.11.1/math'
make[1]: *** [math/subdir_lib] Error 2
make[1]: Leaving directory `/mnt/lfs/sources/glibc-2.11.1'
make: *** [all] Error 2
Googling on that suggests that the error is related to setting the -march CFLAG
whilst using
a cross. compiler. Google led me to this patch which solved the problem:
diff -Naur glibc-2.11.1-orig/nptl/sysdeps/pthread/pt-initfini.c
glibc-2.11.1/nptl/sysdeps/pthread/pt-initfini.c
--- glibc-2.11.1-orig/nptl/sysdeps/pthread/pt-initfini.c 2009-12-08
20:10:20.000000000 +0000
+++ glibc-2.11.1/nptl/sysdeps/pthread/pt-initfini.c 2010-04-17
02:24:02.000000000 +0100
@@ -45,6 +45,11 @@
/* Embed an #include to pull in the alignment and .end directives. */
asm ("\n#include \"defs.h\"");
+asm ("\n#if defined __i686 && defined __ASSEMBLER__");
+asm ("\n#undef __i686");
+asm ("\n#define __i686 __i686");
+asm ("\n#endif");
+
/* The initial common code ends here. */
asm ("\n/*...@header_ends*/");
diff -Naur glibc-2.11.1-orig/sysdeps/unix/sysv/linux/i386/sysdep.h
glibc-2.11.1/sysdeps/unix/sysv/linux/i386/sysdep.h
--- glibc-2.11.1-orig/sysdeps/unix/sysv/linux/i386/sysdep.h 2009-12-08
20:10:20.000000000 +0000
+++ glibc-2.11.1/sysdeps/unix/sysv/linux/i386/sysdep.h 2010-04-17
02:24:02.000000000 +0100
@@ -29,6 +29,10 @@
#include <dl-sysdep.h>
#include <tls.h>
+#if defined __i686 && defined __ASSEMBLER__
+#undef __i686
+#define __i686 __i686
+#endif
/* For Linux we can use the system call table in the header file
/usr/include/asm/unistd.h
Andy
--
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page