LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   LFS 6.5 -- Binutils-2.19.1 - Pass 2 gives error: cannot run C compiled programs (https://www.linuxquestions.org/questions/linux-from-scratch-13/lfs-6-5-binutils-2-19-1-pass-2-gives-error-cannot-run-c-compiled-programs-772242/)

kamleshk1 11-29-2009 06:13 AM

LFS 6.5 -- Binutils-2.19.1 - Pass 2 gives error: cannot run C compiled programs
 
Hi,

Trying to build LFS on my Desktop PC(AMD Athlon processor, Asus Motherboard)
I'm using Mandrake Linux
I have tried 3 times but every time I get struck at binutils Pass 2

The validation of the toolchain works as expected, following is the output:
lfs:/mnt/lfs/sources/glibc-build$ echo 'main(){}' > dummy.c
lfs:/mnt/lfs/sources/glibc-build$ $LFS_TGT-gcc -B/tools/lib dummy.c
lfs:/mnt/lfs/sources/glibc-build$ readelf -l a.out | grep ': /tools'
[Requesting program interpreter: /tools/lib/ld-linux.so.2]
lfs:/mnt/lfs/sources/glibc-build$ rm -v dummy.c a.out
removed `dummy.c'
removed `a.out'
lfs:/mnt/lfs/sources/glibc-build$

However in the next step which is the Binutils-2.19.1 - Pass 2 when I run the commmand

lfs:/mnt/lfs/sources/binutils-build$ CC="$LFS_TGT-gcc -B/tools/lib/" \
AR=$LFS_TGT-ar RANLIB=$LFS_TGT-ranlib \
../binutils-2.19.1/configure --prefix=/tools \
--disable-nls --with-lib-path=/tools/lib

gives me error, following is a part of the config.log file

/****************************************************************/
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by configure, which was
generated by GNU Autoconf 2.59. Invocation command line was

$ ../binutils-2.19.1/configure --prefix=/tools --disable-nls --with-lib-path=/tools/lib

## --------- ##
## Platform. ##
## --------- ##

hostname = localhost
uname -m = i686
uname -r = 2.6.3-4mdk
uname -s = Linux
uname -v = #1 Tue Mar 2 07:26:13 CET 2004

/usr/bin/uname -p = unknown
/bin/uname -X = unknown

/bin/arch = i686
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown

PATH: /tools/bin
PATH: /bin
PATH: /usr/bin


## ----------- ##
## Core tests. ##
## ----------- ##

configure:1549: checking build system type
configure:1567: result: i686-pc-linux-gnu
configure:1602: checking host system type
configure:1616: result: i686-pc-linux-gnu
configure:1624: checking target system type
configure:1638: result: i686-pc-linux-gnu
configure:1682: checking for a BSD-compatible install
configure:1748: result: /usr/bin/install -c
configure:1759: checking whether ln works
configure:1781: result: yes
configure:1785: checking whether ln -s works
configure:1789: result: yes
configure:2983: checking for gcc
configure:3009: result: i686-lfs-linux-gnu-gcc -B/tools/lib/
configure:3255: checking for C compiler version
configure:3258: i686-lfs-linux-gnu-gcc -B/tools/lib/ --version </dev/null >&5
i686-lfs-linux-gnu-gcc (GCC) 4.4.1
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:3261: $? = 0
configure:3263: i686-lfs-linux-gnu-gcc -B/tools/lib/ -v </dev/null >&5
Reading specs from /mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.4.1/specs
Target: i686-lfs-linux-gnu
Configured with: ../gcc-4.4.1/configure --target=i686-lfs-linux-gnu --prefix=/tools --disable-nls --disable-shared --disable-multilib --disable-decimal-float --disable-threads --disable-libmudflap --disable-libssp --disable-libgomp --enable-languages=c
Thread model: single
gcc version 4.4.1 (GCC)
configure:3266: $? = 0
configure:3268: i686-lfs-linux-gnu-gcc -B/tools/lib/ -V </dev/null >&5
i686-lfs-linux-gnu-gcc: '-V' must come at the start of the command line
configure:3271: $? = 1
configure:3294: checking for C compiler default output file name
configure:3297: i686-lfs-linux-gnu-gcc -B/tools/lib/ conftest.c >&5
configure:3300: $? = 0
configure:3348: result: a.out
configure:3353: checking whether the C compiler works
configure:3359: ./a.out
FATAL: kernel too old
configure:3362: $? = 1
configure:3369: error: in `/mnt/lfs/sources/binutils-build':
configure:3373: error: cannot run C compiled programs.

If you meant to cross compile, use `--host'.
See `config.log' for more details.


Thanks in Advance, for any help, hints, suggestions

Kamlesh Kumar..

druuna 11-29-2009 07:34 AM

Hi,

I guess your host (Mandrake Linux) doesn't meet the iv. Host System Requirements. Especially the part about the kernel.

Hope this helps.

kamleshk1 12-03-2009 01:39 AM

First of all Thanks for the reply
secondly Sorry for the delay from my side, after looking at your reply I started searching for higher version of Linux kernel and found Ubuntu whose kernel version is 2.6.31 (I assume 2.6.31 is development version and not the stable version, will that lead to any problem as I couldn't get 2.6.30)
After installation the command uname -a gave the following output
Linux kamlesh-desktop 2.6.31-14-generic #48-Ubuntu SMP Fri Oct 16 14:04:26 UTC 2009 i686 GNU/Linux
But After using Ubuntu for LFS i'm getting error in section 5.7.1. Installation of Glibc "make" command, however this was working fine with the previous Mandrake linux.

Part of the config.log from glibc-build folder is as shown below:

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by GNU C Library configure (see version.h), which was
generated by GNU Autoconf 2.63. Invocation command line was

$ ../glibc-2.10.1/configure --prefix=/tools --host=i686-lfs-linux-gnu --build=i686-pc-linux-gnu --disable-profile --enable-add-ons --enable-kernel=2.6.18 --with-headers=/tools/include libc_cv_forced_unwind=yes libc_cv_c_cleanup=yes

## --------- ##
## Platform. ##
## --------- ##

hostname = kamlesh-desktop
uname -m = i686
uname -r = 2.6.31-14-generic
uname -s = Linux
uname -v = #48-Ubuntu SMP Fri Oct 16 14:04:26 UTC 2009

/usr/bin/uname -p = unknown
/bin/uname -X = unknown

/bin/arch = unknown
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown

PATH: /tools/bin
PATH: /bin
PATH: /usr/bin


## ----------- ##
## Core tests. ##
## ----------- ##

configure:2022: checking for i686-lfs-linux-gnu-gcc
configure:2038: found /tools/bin/i686-lfs-linux-gnu-gcc
configure:2049: result: i686-lfs-linux-gnu-gcc
configure:2321: checking for C compiler version
configure:2329: i686-lfs-linux-gnu-gcc --version >&5
i686-lfs-linux-gnu-gcc (GCC) 4.4.1
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:2333: $? = 0
configure:2340: i686-lfs-linux-gnu-gcc -v >&5
Using built-in specs.
Target: i686-lfs-linux-gnu
Configured with: ../gcc-4.4.1/configure --target=i686-lfs-linux-gnu --prefix=/tools --disable-nls --disable-shared --disable-multilib --disable-decimal-float --disable-threads --disable-libmudflap --disable-libssp --disable-libgomp --enable-languages=c
Thread model: single
gcc version 4.4.1 (GCC)
configure:2344: $? = 0
configure:2351: i686-lfs-linux-gnu-gcc -V >&5
i686-lfs-linux-gnu-gcc: '-V' option must have argument
configure:2355: $? = 1
configure:2359: checking for suffix of object files
configure:2385: i686-lfs-linux-gnu-gcc -c conftest.c >&5
configure:2389: $? = 0
configure:2414: result: o
configure:2418: checking whether we are using the GNU C compiler
configure:2447: i686-lfs-linux-gnu-gcc -c conftest.c >&5
configure:2454: $? = 0
configure:2471: result: yes
configure:2480: checking whether i686-lfs-linux-gnu-gcc accepts -g
configure:2510: i686-lfs-linux-gnu-gcc -c -g conftest.c >&5
configure:2517: $? = 0
configure:2618: result: yes
configure:2635: checking for i686-lfs-linux-gnu-gcc option to accept ISO C89
configure:2709: i686-lfs-linux-gnu-gcc -c -g -O2 conftest.c >&5
conftest.c:9:19: error: stdio.h: No such file or directory
conftest.c:10:23: error: sys/types.h: No such file or directory
conftest.c:11:22: error: sys/stat.h: No such file or directory
conftest.c:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
conftest.c:48: error: expected declaration specifiers or '...' before 'FILE'

configure:2716: $? = 1
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "GNU C Library"
| #define PACKAGE_TARNAME "c-library"
| #define PACKAGE_VERSION "(see version.h)"
| #define PACKAGE_STRING "GNU C Library (see version.h)"
| #define PACKAGE_BUGREPORT "glibc"
| /* end confdefs.h. */
| #include <stdarg.h>
| #include <stdio.h>
| #include <sys/types.h>
| #include <sys/stat.h>
| /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
| struct buf { int x; };
| FILE * (*rcsopen) (struct buf *, struct stat *, int);
| static char *e (p, i)
| char **p;
| int i;
| {
| return p[i];
| }
| static char *f (char * (*g) (char **, int), char **p, ...)
| {
| char *s;
| va_list v;
| va_start (v,p);
| s = g (p, va_arg (v,int));
| va_end (v);
| return s;
| }
|
| /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
| function prototypes and stuff, but not '\xHH' hex character constants.
| These don't provoke an error unfortunately, instead are silently treated
| as 'x'. The following induces an error, until -std is added to get
| proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
| array size at least. It's necessary to write '\x00'==0 to get something
| that's true only with -std. */
| int osf4_cc_array ['\x00' == 0 ? 1 : -1];
|
| /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
| inside strings and character constants. */
| #define FOO(x) 'x'
| int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
|
| int test (int i, double x);
| struct s1 {int (*f) (int a);};
| struct s2 {int (*f) (double a);};
| int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
| int argc;
| char **argv;
| int
| main ()
| {
| return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
| ;
| return 0;
| }
configure:2709: i686-lfs-linux-gnu-gcc -qlanglvl=extc89 -c -g -O2 conftest.c >&5
i686-lfs-linux-gnu-gcc: unrecognized option '-qlanglvl=extc89'
conftest.c:9:19: error: stdio.h: No such file or directory
conftest.c:10:23: error: sys/types.h: No such file or directory
conftest.c:11:22: error: sys/stat.h: No such file or directory
conftest.c:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
conftest.c:48: error: expected declaration specifiers or '...' before 'FILE'
configure:2716: $? = 1
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "GNU C Library"
| #define PACKAGE_TARNAME "c-library"
| #define PACKAGE_VERSION "(see version.h)"
| #define PACKAGE_STRING "GNU C Library (see version.h)"
| #define PACKAGE_BUGREPORT "glibc"
| /* end confdefs.h. */
| #include <stdarg.h>
| #include <stdio.h>
| #include <sys/types.h>
| #include <sys/stat.h>
| /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
| struct buf { int x; };
| FILE * (*rcsopen) (struct buf *, struct stat *, int);
| static char *e (p, i)
| char **p;
| int i;
| {
| return p[i];
| }
| static char *f (char * (*g) (char **, int), char **p, ...)
| {
| char *s;
| va_list v;
| va_start (v,p);
| s = g (p, va_arg (v,int));
| va_end (v);
| return s;
| }
|
| /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
| function prototypes and stuff, but not '\xHH' hex character constants.
| These don't provoke an error unfortunately, instead are silently treated
| as 'x'. The following induces an error, until -std is added to get
| proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
| array size at least. It's necessary to write '\x00'==0 to get something
| that's true only with -std. */
| int osf4_cc_array ['\x00' == 0 ? 1 : -1];
|
| /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
| inside strings and character constants. */
| #define FOO(x) 'x'
| int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
|
| int test (int i, double x);
| struct s1 {int (*f) (int a);};
| struct s2 {int (*f) (double a);};
| int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
| int argc;
| char **argv;
| int
| main ()
| {
| return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
| ;
| return 0;
| }
configure:2709: i686-lfs-linux-gnu-gcc -qlanglvl=ansi -c -g -O2 conftest.c >&5
i686-lfs-linux-gnu-gcc: unrecognized option '-qlanglvl=ansi'
conftest.c:9:19: error: stdio.h: No such file or directory
conftest.c:10:23: error: sys/types.h: No such file or directory
conftest.c:11:22: error: sys/stat.h: No such file or directory
conftest.c:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
conftest.c:48: error: expected declaration specifiers or '...' before 'FILE'
configure:2716: $? = 1
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "GNU C Library"
| #define PACKAGE_TARNAME "c-library"
| #define PACKAGE_VERSION "(see version.h)"
| #define PACKAGE_STRING "GNU C Library (see version.h)"
| #define PACKAGE_BUGREPORT "glibc"
| /* end confdefs.h. */
| #include <stdarg.h>
| #include <stdio.h>
| #include <sys/types.h>
| #include <sys/stat.h>
| /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
| struct buf { int x; };
| FILE * (*rcsopen) (struct buf *, struct stat *, int);
| static char *e (p, i)
| char **p;
| int i;
| {
| return p[i];
| }
| static char *f (char * (*g) (char **, int), char **p, ...)
| {
| char *s;
| va_list v;
| va_start (v,p);
| s = g (p, va_arg (v,int));
| va_end (v);
| return s;
| }
|
| /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
| function prototypes and stuff, but not '\xHH' hex character constants.
| These don't provoke an error unfortunately, instead are silently treated
| as 'x'. The following induces an error, until -std is added to get
| proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
| array size at least. It's necessary to write '\x00'==0 to get something
| that's true only with -std. */
| int osf4_cc_array ['\x00' == 0 ? 1 : -1];
|
| /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
| inside strings and character constants. */
| #define FOO(x) 'x'
| int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
|
| int test (int i, double x);
| struct s1 {int (*f) (int a);};
| struct s2 {int (*f) (double a);};
| int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
| int argc;
| char **argv;
| int
| main ()
| {
| return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
| ;
| return 0;
| }
configure:2709: i686-lfs-linux-gnu-gcc -std -c -g -O2 conftest.c >&5
cc1: error: unrecognized command line option "-std"
configure:2716: $? = 1
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "GNU C Library"
| #define PACKAGE_TARNAME "c-library"
| #define PACKAGE_VERSION "(see version.h)"
| #define PACKAGE_STRING "GNU C Library (see version.h)"
| #define PACKAGE_BUGREPORT "glibc"
| /* end confdefs.h. */
| #include <stdarg.h>
| #include <stdio.h>
| #include <sys/types.h>
| #include <sys/stat.h>
| /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
| struct buf { int x; };
| FILE * (*rcsopen) (struct buf *, struct stat *, int);
| static char *e (p, i)
| char **p;
| int i;
| {
| return p[i];
| }
| static char *f (char * (*g) (char **, int), char **p, ...)
| {
| char *s;
| va_list v;
| va_start (v,p);
| s = g (p, va_arg (v,int));
| va_end (v);
| return s;
| }
|
| /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
| function prototypes and stuff, but not '\xHH' hex character constants.
| These don't provoke an error unfortunately, instead are silently treated
| as 'x'. The following induces an error, until -std is added to get
| proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
| array size at least. It's necessary to write '\x00'==0 to get something
| that's true only with -std. */
| int osf4_cc_array ['\x00' == 0 ? 1 : -1];
|
| /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
| inside strings and character constants. */
| #define FOO(x) 'x'
| int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
|
| int test (int i, double x);
| struct s1 {int (*f) (int a);};
| struct s2 {int (*f) (double a);};
| int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
| int argc;
| char **argv;
| int
| main ()
| {
| return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
| ;
| return 0;
| }
configure:2709: i686-lfs-linux-gnu-gcc -Ae -c -g -O2 conftest.c >&5
<command-line>: error: missing '(' after predicate
conftest.c:9:19: error: stdio.h: No such file or directory
conftest.c:10:23: error: sys/types.h: No such file or directory
conftest.c:11:22: error: sys/stat.h: No such file or directory
conftest.c:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
conftest.c:48: error: expected declaration specifiers or '...' before 'FILE'
configure:2716: $? = 1
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "GNU C Library"
| #define PACKAGE_TARNAME "c-library"
| #define PACKAGE_VERSION "(see version.h)"
| #define PACKAGE_STRING "GNU C Library (see version.h)"
| #define PACKAGE_BUGREPORT "glibc"
| /* end confdefs.h. */
| #include <stdarg.h>
| #include <stdio.h>
| #include <sys/types.h>
| #include <sys/stat.h>
| /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
| struct buf { int x; };
| FILE * (*rcsopen) (struct buf *, struct stat *, int);
| static char *e (p, i)
| char **p;
| int i;
| {
| return p[i];
| }
| static char *f (char * (*g) (char **, int), char **p, ...)
| {
| char *s;
| va_list v;
| va_start (v,p);
| s = g (p, va_arg (v,int));
| va_end (v);
| return s;
| }
|
| /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
| function prototypes and stuff, but not '\xHH' hex character constants.
| These don't provoke an error unfortunately, instead are silently treated
| as 'x'. The following induces an error, until -std is added to get
| proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
| array size at least. It's necessary to write '\x00'==0 to get something
| that's true only with -std. */
| int osf4_cc_array ['\x00' == 0 ? 1 : -1];
|
| /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
| inside strings and character constants. */
| #define FOO(x) 'x'
| int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
|
| int test (int i, double x);
| struct s1 {int (*f) (int a);};
| struct s2 {int (*f) (double a);};
| int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
| int argc;
| char **argv;
| int
| main ()
| {
| return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
| ;
| return 0;
| }
configure:2709: i686-lfs-linux-gnu-gcc -Aa -D_HPUX_SOURCE -c -g -O2 conftest.c >&5
<command-line>: error: missing '(' after predicate
conftest.c:9:19: error: stdio.h: No such file or directory
conftest.c:10:23: error: sys/types.h: No such file or directory
conftest.c:11:22: error: sys/stat.h: No such file or directory
conftest.c:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
conftest.c:48: error: expected declaration specifiers or '...' before 'FILE'
configure:2716: $? = 1
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "GNU C Library"
| #define PACKAGE_TARNAME "c-library"
| #define PACKAGE_VERSION "(see version.h)"
| #define PACKAGE_STRING "GNU C Library (see version.h)"
| #define PACKAGE_BUGREPORT "glibc"
| /* end confdefs.h. */
| #include <stdarg.h>
| #include <stdio.h>
| #include <sys/types.h>
| #include <sys/stat.h>
| /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
| struct buf { int x; };
| FILE * (*rcsopen) (struct buf *, struct stat *, int);
| static char *e (p, i)
| char **p;
| int i;
| {
| return p[i];
| }
| static char *f (char * (*g) (char **, int), char **p, ...)
| {
| char *s;
| va_list v;
| va_start (v,p);
| s = g (p, va_arg (v,int));
| va_end (v);
| return s;
| }
|
| /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
| function prototypes and stuff, but not '\xHH' hex character constants.
| These don't provoke an error unfortunately, instead are silently treated
| as 'x'. The following induces an error, until -std is added to get
| proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
| array size at least. It's necessary to write '\x00'==0 to get something
| that's true only with -std. */
| int osf4_cc_array ['\x00' == 0 ? 1 : -1];
|
| /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
| inside strings and character constants. */
| #define FOO(x) 'x'
| int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
|
| int test (int i, double x);
| struct s1 {int (*f) (int a);};
| struct s2 {int (*f) (double a);};
| int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
| int argc;
| char **argv;
| int
| main ()
| {
| return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
| ;
| return 0;
| }
configure:2709: i686-lfs-linux-gnu-gcc -Xc -D__EXTENSIONS__ -c -g -O2 conftest.c >&5
i686-lfs-linux-gnu-gcc: unrecognized option '-Xc'
conftest.c:9:19: error: stdio.h: No such file or directory
conftest.c:10:23: error: sys/types.h: No such file or directory
conftest.c:11:22: error: sys/stat.h: No such file or directory
conftest.c:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
conftest.c:48: error: expected declaration specifiers or '...' before 'FILE'
configure:2716: $? = 1
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "GNU C Library"
| #define PACKAGE_TARNAME "c-library"
| #define PACKAGE_VERSION "(see version.h)"
| #define PACKAGE_STRING "GNU C Library (see version.h)"
| #define PACKAGE_BUGREPORT "glibc"
| /* end confdefs.h. */
| #include <stdarg.h>
| #include <stdio.h>
| #include <sys/types.h>
| #include <sys/stat.h>
| /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
| struct buf { int x; };
| FILE * (*rcsopen) (struct buf *, struct stat *, int);
| static char *e (p, i)
| char **p;
| int i;
| {
| return p[i];
| }
| static char *f (char * (*g) (char **, int), char **p, ...)
| {
| char *s;
| va_list v;
| va_start (v,p);
| s = g (p, va_arg (v,int));
| va_end (v);
| return s;
| }
|
| /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
| function prototypes and stuff, but not '\xHH' hex character constants.
| These don't provoke an error unfortunately, instead are silently treated
| as 'x'. The following induces an error, until -std is added to get
| proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
| array size at least. It's necessary to write '\x00'==0 to get something
| that's true only with -std. */
| int osf4_cc_array ['\x00' == 0 ? 1 : -1];
|
| /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
| inside strings and character constants. */
| #define FOO(x) 'x'
| int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
|
| int test (int i, double x);
| struct s1 {int (*f) (int a);};
| struct s2 {int (*f) (double a);};
| int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
| int argc;
| char **argv;
| int
| main ()
| {
| return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
| ;
| return 0;
| }
configure:2742: result: unsupported
configure:2762: checking for gcc
configure:2778: found /usr/bin/gcc
configure:2789: result: gcc
configure:2807: checking how to run the C preprocessor
configure:2847: i686-lfs-linux-gnu-gcc -E conftest.c
configure:2854: $? = 0
configure:2885: i686-lfs-linux-gnu-gcc -E conftest.c
conftest.c:8:28: error: ac_nonexistent.h: No such file or directory
configure:2892: $? = 1
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "GNU C Library"
| #define PACKAGE_TARNAME "c-library"
| #define PACKAGE_VERSION "(see version.h)"
| #define PACKAGE_STRING "GNU C Library (see version.h)"
| #define PACKAGE_BUGREPORT "glibc"
| /* end confdefs.h. */
| #include <ac_nonexistent.h>
configure:2925: result: i686-lfs-linux-gnu-gcc -E
configure:2954: i686-lfs-linux-gnu-gcc -E conftest.c
configure:2961: $? = 0
configure:2992: i686-lfs-linux-gnu-gcc -E conftest.c
conftest.c:8:28: error: ac_nonexistent.h: No such file or directory
configure:2999: $? = 1
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "GNU C Library"
| #define PACKAGE_TARNAME "c-library"
| #define PACKAGE_VERSION "(see version.h)"
| #define PACKAGE_STRING "GNU C Library (see version.h)"
| #define PACKAGE_BUGREPORT "glibc"
| /* end confdefs.h. */
| #include <ac_nonexistent.h>
configure:3053: checking for i686-lfs-linux-gnu-g++
configure:3083: result: no
configure:3053: checking for i686-lfs-linux-gnu-c++
configure:3083: result: no
configure:3053: checking for i686-lfs-linux-gnu-gpp
configure:3083: result: no
configure:3053: checking for i686-lfs-linux-gnu-aCC
configure:3083: result: no
configure:3053: checking for i686-lfs-linux-gnu-CC
configure:3083: result: no
configure:3053: checking for i686-lfs-linux-gnu-cxx
configure:3083: result: no
configure:3053: checking for i686-lfs-linux-gnu-cc++
configure:3083: result: no
configure:3053: checking for i686-lfs-linux-gnu-cl.exe
configure:3083: result: no
configure:3053: checking for i686-lfs-linux-gnu-FCC
configure:3083: result: no
configure:3053: checking for i686-lfs-linux-gnu-KCC
configure:3083: result: no
configure:3053: checking for i686-lfs-linux-gnu-RCC
configure:3083: result: no
configure:3053: checking for i686-lfs-linux-gnu-xlC_r
configure:3083: result: no
configure:3053: checking for i686-lfs-linux-gnu-xlC
configure:3083: result: no
configure:3097: checking for g++
configure:3127: result: no
configure:3097: checking for c++
configure:3127: result: no
configure:3097: checking for gpp
configure:3127: result: no
configure:3097: checking for aCC
configure:3127: result: no
configure:3097: checking for CC
configure:3127: result: no
configure:3097: checking for cxx
configure:3127: result: no
configure:3097: checking for cc++
configure:3127: result: no
configure:3097: checking for cl.exe
configure:3127: result: no
configure:3097: checking for FCC
configure:3127: result: no
configure:3097: checking for KCC
configure:3127: result: no
configure:3097: checking for RCC
configure:3127: result: no
configure:3097: checking for xlC_r
configure:3127: result: no
configure:3097: checking for xlC
configure:3127: result: no
configure:3151: checking for C++ compiler version
configure:3159: g++ --version >&5
../glibc-2.10.1/configure: line 3161: g++: command not found
configure:3163: $? = 127
configure:3170: g++ -v >&5
../glibc-2.10.1/configure: line 3172: g++: command not found
configure:3174: $? = 127
configure:3181: g++ -V >&5
../glibc-2.10.1/configure: line 3183: g++: command not found
configure:3185: $? = 127
configure:3188: checking whether we are using the GNU C++ compiler
configure:3217: g++ -c conftest.cpp >&5
../glibc-2.10.1/configure: line 3219: g++: command not found
configure:3224: $? = 127
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "GNU C Library"
| #define PACKAGE_TARNAME "c-library"
| #define PACKAGE_VERSION "(see version.h)"
| #define PACKAGE_STRING "GNU C Library (see version.h)"
| #define PACKAGE_BUGREPORT "glibc"
| /* end confdefs.h. */
|
| int
| main ()
| {
| #ifndef __GNUC__
| choke me
| #endif
|
| ;
| return 0;
| }
configure:3241: result: no
configure:3250: checking whether g++ accepts -g
configure:3280: g++ -c -g conftest.cpp >&5
../glibc-2.10.1/configure: line 3282: g++: command not found
configure:3287: $? = 127
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "GNU C Library"
| #define PACKAGE_TARNAME "c-library"
| #define PACKAGE_VERSION "(see version.h)"
| #define PACKAGE_STRING "GNU C Library (see version.h)"
| #define PACKAGE_BUGREPORT "glibc"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:3319: g++ -c conftest.cpp >&5
../glibc-2.10.1/configure: line 3321: g++: command not found
configure:3326: $? = 127
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "GNU C Library"
| #define PACKAGE_TARNAME "c-library"
| #define PACKAGE_VERSION "(see version.h)"
| #define PACKAGE_STRING "GNU C Library (see version.h)"
| #define PACKAGE_BUGREPORT "glibc"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:3359: g++ -c -g conftest.cpp >&5
../glibc-2.10.1/configure: line 3361: g++: command not found
configure:3366: $? = 127
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "GNU C Library"
| #define PACKAGE_TARNAME "c-library"
| #define PACKAGE_VERSION "(see version.h)"
| #define PACKAGE_STRING "GNU C Library (see version.h)"
| #define PACKAGE_BUGREPORT "glibc"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:3388: result: no
configure:3853: checking build system type
configure:3871: result: i686-pc-linux-gnu
configure:3893: checking host system type
configure:3908: result: i686-lfs-linux-gnu
configure:4090: running configure fragment for add-on nptl
configure:4226: checking sysdep dirs
configure:4462: result: sysdeps/generic/elf sysdeps/generic
configure:4541: checking for a BSD-compatible install
configure:4609: result: /usr/bin/install -c
configure:4624: checking whether ln -s works
configure:4628: result: yes
configure:4752: checking whether /mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.4.1/../../../../i686-lfs-linux-gnu/bin/as is GNU as
configure:4766: result: yes
configure:4771: checking whether /mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.4.1/../../../../i686-lfs-linux-gnu/bin/ld is GNU ld
configure:4785: result: yes
configure:4795: checking for /mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.4.1/../../../../i686-lfs-linux-gnu/bin/as
configure:4822: result: /mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.4.1/../../../../i686-lfs-linux-gnu/bin/as
configure:4837: checking version of /mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.4.1/../../../../i686-lfs-linux-gnu/bin/as
configure:4847: result: 2.19.1, ok
configure:4858: checking for /mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.4.1/../../../../i686-lfs-linux-gnu/bin/ld
configure:4885: result: /mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.4.1/../../../../i686-lfs-linux-gnu/bin/ld
configure:4900: checking version of /mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.4.1/../../../../i686-lfs-linux-gnu/bin/ld
configure:4910: result: 2.19.1, ok
configure:4925: checking for pwd
configure:4943: found /bin/pwd
configure:4956: result: /bin/pwd
configure:4976: checking for i686-lfs-linux-gnu-gcc
configure:5003: result: i686-lfs-linux-gnu-gcc
configure:5018: checking version of i686-lfs-linux-gnu-gcc
configure:5028: result: 4.4.1, ok
configure:5039: checking for gnumake
configure:5069: result: no
configure:5039: checking for gmake
configure:5069: result: no
configure:5039: checking for make
configure:5055: found /usr/bin/make
configure:5066: result: make
configure:5081: checking version of make
configure:5091: result: 3.81, ok
configure:5103: checking for gnumsgfmt
configure:5133: result: no
configure:5103: checking for gmsgfmt
configure:5133: result: no
configure:5103: checking for msgfmt
configure:5133: result: no
configure:5166: checking for makeinfo
configure:5196: result: no
configure:5229: checking for sed
configure:5245: found /bin/sed
configure:5256: result: sed
configure:5271: checking version of sed
configure:5281: result: 4.2.1, ok
configure:5293: checking for autoconf
configure:5323: result: no
configure:5367: WARNING:
*** These auxiliary programs are missing or incompatible versions: msgfmt makeinfo autoconf
*** some features will be disabled.
*** Check the INSTALL file for required versions.
../glibc-2.10.1/configure: line 5385: g++: command not found
configure:5396: checking whether ranlib is necessary
configure:5417: result: no
configure:5430: checking LD_LIBRARY_PATH variable
configure:5440: result: ok
configure:5454: checking whether GCC supports -static-libgcc
configure:5465: result: -static-libgcc
configure:5471: checking for bash
configure:5489: found /bin/bash
configure:5502: result: /bin/bash
configure:5577: checking for gawk
configure:5607: result: no


One more question should I change the i486 to i686 in the below commands
But i686 folder of glibc-2.10.1 does not have lowlevellock.S.orig file in it
cp -v nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S{,.orig}
sed -e 's/FUTEX_WAIT\( | FUTEX_CLOCK_REALTIME, reg\)/FUTEX_WAIT_BITSET\1/' \
<nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S.orig \
>nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S


Thanks in Advance
Kamlesh Kumar..

druuna 12-03-2009 01:56 AM

Hi,

You need to make sure that your host system is up to specs. Why not download the LFS LiveCD and use that one as host (it was created just for that). It also makes sure that your current linux distro will stay functional (not sure what your level of experience is and how much you can "break" things).

Quote:

One more question should I change the i486 to i686 in the below commands
But i686 folder of glibc-2.10.1 does not have lowlevellock.S.orig file in it
cp -v nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S{,.orig}
sed -e 's/FUTEX_WAIT\( | FUTEX_CLOCK_REALTIME, reg\)/FUTEX_WAIT_BITSET\1/' \
<nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S.orig \
>nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
Do _not_ change anything in the LFS book unless explicitly stated by the LFS folks!

BTW: Current stable kernel is 2.6.32 (kernel.org), I don't know which kernel is presently used by Mandrake/Ubuntu (your first post mentions Mandrake, the output of the uname command in post #3 is Ubuntu.......).

Hope this helps.

exvor 12-06-2009 06:11 PM

Quote:

One more question should I change the i486 to i686 in the below commands
But i686 folder of glibc-2.10.1 does not have lowlevellock.S.orig file in it
cp -v nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S{,.orig}
sed -e 's/FUTEX_WAIT\( | FUTEX_CLOCK_REALTIME, reg\)/FUTEX_WAIT_BITSET\1/' \
<nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S.orig \
>nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
This is from a older verion of the LFS book the great 6.1.1 that says
Quote:

This package is known to have issues when its default optimization flags (including the -march and -mcpu options) are changed.
This is why you set it to the lowest most widely accepted march flag i486 also there is no noticeable increase in performance from i486 to i686. Sometimes I think the lfs guys forget some of the previous stuff they learned :P. But then again they pretty much stick to what the devs of the software say and that's a good thing.

kamleshk1 12-22-2009 11:56 AM

Thanks Druuna and Exvor
Druuna as U said I downloaded the LFS live CD (which had version 6.3 in it).
And finally I have built my first Linux From Scratch, Its Up and running, that implies I'm very very happy..
As I already had a windows OS on my PC I had a little trouble configuring the grub, but thanks to the link provided by mrrangerman in the following thread
http://www.linuxquestions.org/questi...nstall-608188/

One again Thanks Guys, God Bless All, Merry Christmas..

druuna 12-22-2009 12:03 PM

:)

Glad I could help!

lakmilis 11-16-2010 08:57 AM

well old thread but still valid.
 
Hi there... I have the same problem as above.. however, I am and have been using the livecd from start (6.3.260! not 230) 386 arch and well for me too, it ended up like that. I got the same error , yet on the 6.7 requirements (I'm running a 6.7 build and downloaded the appropriate packages).

The only 2 things I can imagine or which haven't been to the letter are:

1. I downloaded the latest kernel 2.6.36 (whereas 6.7 asks for any 2.6.35.X)

2. I did mess up the SPECS argument first time around but reran it, and the test afterwards went fine.

However my SPECS output was: /mnt/lfs/tools/bin/../lib/gcc/i686(bla bla)-gnu/4.5.1/specs

Else.. hmm, ye don't know. the livecd has the exact version of the kernel in requirements and the livecd gcc version is 4.1.2 as required as well. Sigh.

Can someone at least give tips for troubleshooting so I do not have to write everything again. I am doing this in a vm, and am not copying pasting anything and have one up to this stage 3 times now (due to twice being a bit unlucky with the vm).

VMWare btw, but shouldn't matter right now I think.


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