LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices

Reply
 
Search this Thread
Old 07-28-2012, 06:34 PM   #1
stu1811
LQ Newbie
 
Registered: Jun 2009
Posts: 6

Rep: Reputation: 0
Problem compiling after installing glibc


My base system is FC17. I'm running LFS 7.1. After installing glic I'm trying to compile the dummy.c file (Section 5.8).

I put the verbose output at the bottom.
Code:
$LFS_TGT-gcc -B/tools/lib dummy.c
/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.6.2/../../../../i686-lfs-linux-gnu/bin/ld: cannot find crt1.o: No such file or directory
/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.6.2/../../../../i686-lfs-linux-gnu/bin/ld: cannot find crti.o: No such file or directory
/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.6.2/../../../../i686-lfs-linux-gnu/bin/ld: cannot find -lc
/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.6.2/../../../../i686-lfs-linux-gnu/bin/ld: cannot find crtn.o: No such file or directory
collect2: ld returned 1 exit status



Output from sanity checker :
Code:
bash, version 4.2.24(1)-release
/bin/sh -> /usr/bin/bash
Binutils: version 2.22.52.0.1-10.fc17 20120131
bison (GNU Bison) 2.5
/usr/bin/yacc -> /usr/bin/yacc
bzip2,  Version 1.0.6, 6-Sept-2010.
Coreutils:  8.15
diff (GNU diffutils) 3.2
find (GNU findutils) 4.5.10
GNU Awk 4.0.0
/usr/bin/awk -> /usr/bin/gawk
gcc (GCC) 4.7.0 20120507 (Red Hat 4.7.0-5)
(GNU libc) 2.15
grep (GNU grep) 2.12
gzip 1.4
Linux version 3.3.4-5.fc17.i686.PAE (mockbuild@x86-18.phx2.fedoraproject.org) (gcc version 4.7.0 20120504 (Red Hat 4.7.0-4) (GCC) ) #1 SMP Mon May 7 17:37:39 UTC 2012
m4 (GNU M4) 1.4.16
GNU Make 3.82
patch 2.6.1
Perl version='5.14.2';
GNU sed version 4.2.1
tar (GNU tar) 1.26
Texinfo: makeinfo (GNU texinfo) 4.13
xz (XZ Utils) 5.1.1alpha
gcc compilation OK

Verbose output
Code:
$LFS_TGT-gcc -v -B/tools/lib dummy.c
Reading specs from /mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.6.2/specs
COLLECT_GCC=i686-lfs-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/mnt/lfs/tools/bin/../libexec/gcc/i686-lfs-linux-gnu/4.6.2/lto-wrapper
Target: i686-lfs-linux-gnu
Configured with: ../gcc-4.6.2/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 --disable-libquadmath --disable-target-libiberty --disable-target-zlib --enable-languages=c --without-ppl --without-cloog --with-mpfr-include=/mnt/lfs/sources/gcc-build/../gcc-4.6.2/mpfr/src --with-mpfr-lib=/mnt/lfs/sources/gcc-build/mpfr/src/.libs
Thread model: single
gcc version 4.6.2 (GCC) 
COLLECT_GCC_OPTIONS='-v' '-B' '/tools/lib' '-mtune=generic' '-march=pentiumpro'
 /mnt/lfs/tools/bin/../libexec/gcc/i686-lfs-linux-gnu/4.6.2/cc1 -quiet -v -iprefix /mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.6.2/ -isystem /tools/include dummy.c -quiet -dumpbase dummy.c -mtune=generic -march=pentiumpro -auxbase dummy -version -o /tmp/cc0g6q7R.s
GNU C (GCC) version 4.6.2 (i686-lfs-linux-gnu)
	compiled by GNU C version 4.7.0 20120507 (Red Hat 4.7.0-5), GMP version 5.0.4, MPFR version 3.1.0, MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.6.2/../../../../i686-lfs-linux-gnu/sys-include"
ignoring nonexistent directory "/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.6.2/../../../../i686-lfs-linux-gnu/include"
ignoring duplicate directory "/mnt/lfs/tools/bin/../lib/gcc/../../lib/gcc/i686-lfs-linux-gnu/4.6.2/include"
ignoring duplicate directory "/mnt/lfs/tools/bin/../lib/gcc/../../lib/gcc/i686-lfs-linux-gnu/4.6.2/include-fixed"
ignoring nonexistent directory "/mnt/lfs/tools/bin/../lib/gcc/../../lib/gcc/i686-lfs-linux-gnu/4.6.2/../../../../i686-lfs-linux-gnu/sys-include"
ignoring nonexistent directory "/mnt/lfs/tools/bin/../lib/gcc/../../lib/gcc/i686-lfs-linux-gnu/4.6.2/../../../../i686-lfs-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /tools/include
 /mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.6.2/include
 /mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.6.2/include-fixed
End of search list.
GNU C (GCC) version 4.6.2 (i686-lfs-linux-gnu)
	compiled by GNU C version 4.7.0 20120507 (Red Hat 4.7.0-5), GMP version 5.0.4, MPFR version 3.1.0, MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 17782e1058a53124b438301937e70960
COLLECT_GCC_OPTIONS='-v' '-B' '/tools/lib' '-mtune=generic' '-march=pentiumpro'
 /mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.6.2/../../../../i686-lfs-linux-gnu/bin/as --32 -o /tmp/cc8GcNqZ.o /tmp/cc0g6q7R.s
COMPILER_PATH=/tools/lib/:/mnt/lfs/tools/bin/../libexec/gcc/i686-lfs-linux-gnu/4.6.2/:/mnt/lfs/tools/bin/../libexec/gcc/:/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.6.2/../../../../i686-lfs-linux-gnu/bin/
LIBRARY_PATH=/tools/lib/:/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.6.2/:/mnt/lfs/tools/bin/../lib/gcc/:/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.6.2/../../../../i686-lfs-linux-gnu/lib/
COLLECT_GCC_OPTIONS='-v' '-B' '/tools/lib' '-mtune=generic' '-march=pentiumpro'
 /mnt/lfs/tools/bin/../libexec/gcc/i686-lfs-linux-gnu/4.6.2/collect2 --eh-frame-hdr -m elf_i386 -dynamic-linker /tools/lib/ld-linux.so.2 crt1.o crti.o /mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.6.2/crtbegin.o -L/tools/lib -L/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.6.2 -L/mnt/lfs/tools/bin/../lib/gcc -L/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.6.2/../../../../i686-lfs-linux-gnu/lib /tmp/cc8GcNqZ.o -lgcc -lc -lgcc /mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.6.2/crtend.o crtn.o
/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.6.2/../../../../i686-lfs-linux-gnu/bin/ld: cannot find crt1.o: No such file or directory
/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.6.2/../../../../i686-lfs-linux-gnu/bin/ld: cannot find crti.o: No such file or directory
/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.6.2/../../../../i686-lfs-linux-gnu/bin/ld: cannot find -lc
/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.6.2/../../../../i686-lfs-linux-gnu/bin/ld: cannot find crtn.o: No such file or directory
collect2: ld returned 1 exit status
 
Old 07-29-2012, 05:14 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
Although I don't see anything out of the ordinary when looking at your post I can only assume something went wrong during the SPECS part. This:
Code:
SPECS=`dirname $($LFS_TGT-gcc -print-libgcc-file-name)`/specs
$LFS_TGT-gcc -dumpspecs | sed -e 's@/lib\(64\)\?/ld@/tools&@g' -e "/^\*cpp:$/{n;s,$, -isystem /tools/include,}" > $SPECS 
echo "New specs file is: $SPECS"
unset SPECS
What is the output of the following command (as root):
Code:
updatedb ; locate *crt[1in]*
As mentioned in the book:
Quote:
If the output is not shown as above or there was no output at all, then something is wrong. Investigate and retrace the steps to find out where the problem is and correct it. This issue must be resolved before continuing on. Something may have gone wrong with the specs file amendment above. In this case, redo the specs file amendment, being careful to copy-and-paste the commands.
You don't mention it, but have you tried redoing the specs part?
 
1 members found this post helpful.
Old 07-29-2012, 02:23 PM   #3
stu1811
LQ Newbie
 
Registered: Jun 2009
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by druuna View Post
Although I don't see anything out of the ordinary when looking at your post I can only assume something went wrong during the SPECS part. This:
Code:
SPECS=`dirname $($LFS_TGT-gcc -print-libgcc-file-name)`/specs
$LFS_TGT-gcc -dumpspecs | sed -e 's@/lib\(64\)\?/ld@/tools&@g' -e "/^\*cpp:$/{n;s,$, -isystem /tools/include,}" > $SPECS 
echo "New specs file is: $SPECS"
unset SPECS
What is the output of the following command (as root):
Code:
updatedb ; locate *crt[1in]*
Code:
updatedb ; locate *crt[1in]*
/usr/lib/Mcrt1.o
/usr/lib/Scrt1.o
/usr/lib/crt1.o
/usr/lib/crti.o
/usr/lib/crtn.o
/usr/lib/gcrt1.o
Quote:
Originally Posted by druuna View Post
As mentioned in the book: You don't mention it, but have you tried redoing the specs part?
Ah ha! Upon closer inspection it's trying to put the specs file in /specs which it does not have permission to do. I'll look into why it's trying to do that and report back.

Last edited by stu1811; 07-29-2012 at 02:24 PM.
 
Old 07-29-2012, 02:56 PM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
Quote:
Originally Posted by stu1811 View Post
Code:
updatedb ; locate *crt[1in]*
/usr/lib/Mcrt1.o
/usr/lib/Scrt1.o
/usr/lib/crt1.o
/usr/lib/crti.o
/usr/lib/crtn.o
/usr/lib/gcrt1.o
This doesn't look correct. Those files should be available from 2 different locations. /usr/lib and (from the top of my head) /tools/lib.

Something definitely went wrong! It is not clear if the specs part is responsible or that an error was made before that.

You mention something about permissions: You have been doing chapters 4.3. Adding the LFS User and all that come after it as user lfs? I do hope so....
 
1 members found this post helpful.
Old 08-01-2012, 10:20 PM   #5
stu1811
LQ Newbie
 
Registered: Jun 2009
Posts: 6

Original Poster
Rep: Reputation: 0
Yes I added the LFS user and a seperate partition for /mnt/lfs.

My computer was screwy when I sat down so I decided to start over. I forgot that the first time I tried I can into a problem compiling gcc.
Code:
gcc -c   -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition -Wc++-compat   -DHAVE_CONFIG_H -I. -I. -I../../gcc-4.6.2/gcc -I../../gcc-4.6.2/gcc/. -I../../gcc-4.6.2/gcc/../include -I../../gcc-4.6.2/gcc/../libcpp/include -I/mnt/lfs/sources/gcc-build/./gmp -I/mnt/lfs/sources/gcc-4.6.2/gmp -I/mnt/lfs/sources/gcc-build/../gcc-4.6.2/mpfr/src -I/mnt/lfs/sources/gcc-4.6.2/mpc/src  -I../../gcc-4.6.2/gcc/../libdecnumber -I../../gcc-4.6.2/gcc/../libdecnumber/dpd -I../libdecnumber    ../../gcc-4.6.2/gcc/haifa-sched.c -o haifa-sched.o
gtype-desc.c:8893:18: error: subscripted value is neither array nor pointer nor vector
gtype-desc.c:9012:36: error: subscripted value is neither array nor pointer nor vector
gtype-desc.c:9096:31: error: subscripted value is neither array nor pointer nor vector
gtype-desc.c:9117:31: error: subscripted value is neither array nor pointer nor vector
gtype-desc.c:9124:31: error: subscripted value is neither array nor pointer nor vector
gtype-desc.c:9131:31: error: subscripted value is neither array nor pointer nor vector
make[2]: *** [gtype-desc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
rm gcc.pod
make[2]: Leaving directory `/mnt/lfs/sources/gcc-build/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory `/mnt/lfs/sources/gcc-build'
make: *** [all] Error 2
I used this fix.


I'm happy to report the test now passes.
 
Old 08-01-2012, 10:29 PM   #6
stu1811
LQ Newbie
 
Registered: Jun 2009
Posts: 6

Original Poster
Rep: Reputation: 0
Yes I added the LFS user and a seperate partition for /mnt/lfs.

My computer was screwy when I sat down so I decided to start over. I forgot that the first time I tried I can into a problem compiling gcc.
Code:
gcc -c   -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition -Wc++-compat   -DHAVE_CONFIG_H -I. -I. -I../../gcc-4.6.2/gcc -I../../gcc-4.6.2/gcc/. -I../../gcc-4.6.2/gcc/../include -I../../gcc-4.6.2/gcc/../libcpp/include -I/mnt/lfs/sources/gcc-build/./gmp -I/mnt/lfs/sources/gcc-4.6.2/gmp -I/mnt/lfs/sources/gcc-build/../gcc-4.6.2/mpfr/src -I/mnt/lfs/sources/gcc-4.6.2/mpc/src  -I../../gcc-4.6.2/gcc/../libdecnumber -I../../gcc-4.6.2/gcc/../libdecnumber/dpd -I../libdecnumber    ../../gcc-4.6.2/gcc/haifa-sched.c -o haifa-sched.o
gtype-desc.c:8893:18: error: subscripted value is neither array nor pointer nor vector
gtype-desc.c:9012:36: error: subscripted value is neither array nor pointer nor vector
gtype-desc.c:9096:31: error: subscripted value is neither array nor pointer nor vector
gtype-desc.c:9117:31: error: subscripted value is neither array nor pointer nor vector
gtype-desc.c:9124:31: error: subscripted value is neither array nor pointer nor vector
gtype-desc.c:9131:31: error: subscripted value is neither array nor pointer nor vector
make[2]: *** [gtype-desc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
rm gcc.pod
make[2]: Leaving directory `/mnt/lfs/sources/gcc-build/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory `/mnt/lfs/sources/gcc-build'
make: *** [all] Error 2
I used this fix.


After redoing all the steps I'm happy to report the test now passes.

Last edited by stu1811; 08-01-2012 at 10:32 PM.
 
Old 11-09-2012, 04:32 PM   #7
Lakhan Kumar
LQ Newbie
 
Registered: Nov 2012
Posts: 22

Rep: Reputation: Disabled
I am new with linux here, so please ignore if i am doing any foolish mistake.
I am having same problem. After installing glibc for LFS 7.2, it doesn't compiles the dummy.c program. Have retraced all steps, done with all the patches, still the problem persists. Please guide me how you tackled with it. Shall be very thankful.
 
Old 11-10-2012, 02:00 AM   #8
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
Quote:
Originally Posted by Lakhan Kumar View Post
I am new with linux here, so please ignore if i am doing any foolish mistake.
I am having same problem. After installing glibc for LFS 7.2, it doesn't compiles the dummy.c program. Have retraced all steps, done with all the patches, still the problem persists. Please guide me how you tackled with it. Shall be very thankful.
This thread you posted in is a solved thread that deals with LFS version 7.1.

Please start a new thread and include the following:

1) LFS version and chapter you are stuck,
2) If you are still doing chapter 5 also post the output of the version-check.sh and the host you are using,
3) The command you have problems with,
4) The output / errors that are generated.

BTW: Welcome to LQ!

Last edited by druuna; 11-10-2012 at 01:51 PM. Reason: typo
 
1 members found this post helpful.
Old 12-10-2012, 08:47 AM   #9
joneschrisan
LQ Newbie
 
Registered: Dec 2012
Distribution: Debian
Posts: 7

Rep: Reputation: Disabled
Hi, I have the same error message as the original poster when trying to compile test of dummy.c at the end of chapter 5.7.1 "Installation of Glibc"

I did notice druuna's post about "the SPECS part", but this isnt in the book untill chapter 6.10 "Adjusting the Toolchain"

Do I have to do the SPECS part before I start cause the book didn't tell me to do that yet and I can't continue untill I've got this sorted.

LFS Version: 7.2
Base System: debian wheezy

Version Check:
bash, version 4.2.36(1)-release
/bin/sh -> /bin/bash
Binutils: coreutils) 8.13
bison (GNU Bison) 2.5
/usr/bin/yacc -> /usr/bin/bison.yacc
bzip2, Version 1.0.6, 6-Sept-2010.
Coreutils: 8.13
diff (GNU diffutils) 3.2
find (GNU findutils) 4.4.2
GNU Awk 4.0.1
/usr/bin/awk -> /usr/bin/gawk
gcc (Debian 4.7.2-4) 4.7.2
ldd (Debian EGLIBC 2.13-37) 2.13
grep (GNU grep) 2.12
gzip 1.5
Linux version 3.2.0-4-486 (debian-kernel@lists.debian.org) (gcc version 4.6.3 (Debian 4.6.3-12) ) #1 Debian 3.2.32-1
m4 (GNU M4) 1.4.16
GNU Make 3.81
patch 2.6.1
Perl version='5.14.2';
GNU sed version 4.2.1
tar (GNU tar) 1.26
Texinfo: makeinfo (GNU texinfo) 4.13
xz (XZ Utils) 5.1.0alpha
gcc compilation OK

Last edited by joneschrisan; 12-10-2012 at 09:01 AM.
 
Old 12-10-2012, 09:54 AM   #10
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
@joneschrisan; Have a look at post #8......... LFS 7.1 and 7.2 are _not_ the same.
 
Old 12-16-2012, 10:30 PM   #11
engineer
Member
 
Registered: Oct 2007
Distribution: LFS
Posts: 58

Rep: Reputation: 0
I know this thread is solved, but I would like to just add/confirm that I was having this issue of errors on the 'make' command, just as stu1811 was having above:

Quote:
gtype-desc.c:8893:18: error: subscripted value is neither array nor pointer nor vector
gtype-desc.c:9012:36: error: subscripted value is neither array nor pointer nor vector
gtype-desc.c:9096:31: error: subscripted value is neither array nor pointer nor vector
gtype-desc.c:9117:31: error: subscripted value is neither array nor pointer nor vector
gtype-desc.c:9124:31: error: subscripted value is neither array nor pointer nor vector
gtype-desc.c:9131:31: error: subscripted value is neither array nor pointer nor vector
The fix quoted above here worked for me as well.

LFS 7.1, base system: Fedora 17 32 bit. Chapter 5.5, GCC Pass 1.
 
  


Reply

Tags
glibc, lfs


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiling and installing glibc [/lib/tls/libc.so.6] knareshkumar Programming 6 04-23-2013 09:58 AM
Problem compiling glibc 2.12.1 abhiklall Linux From Scratch 2 04-12-2011 02:01 PM
problem installing glibc-2.3.2-4.80.i686, glibc-common-2.3.2-4.80.8.i386.rpm martianpackets Red Hat 8 05-01-2009 03:22 PM
Compiling/Installing GTK+ and glibc massacrezero Linux - Newbie 5 05-07-2003 08:01 PM
Problem compiling glibc v2.3.1 agrocott Linux - Software 2 01-30-2003 12:14 PM


All times are GMT -5. The time now is 02:52 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration