LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-31-2012, 05:55 AM   #16
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641

# 11

Quote:
/usr/bin/ld: cannot find crti.o: No such file or directory
/usr/bin/ld: skipping incompatible /usr/lib64/libc.so when searching for -lc
/usr/bin/ld: cannot find -lc
/usr/bin/ld: cannot find crtn.o: No such file or directory
No internet : You will have to download glibc-devel, glibc-headers
from http://archives.fedoraproject.org/pu...14/Everything/
.. and then install the packages manually.

.
 
Old 03-31-2012, 12:16 PM   #17
mvairavan
Member
 
Registered: Feb 2011
Posts: 31

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by knudfl View Post
# 11



No internet : You will have to download glibc-devel, glibc-headers
from http://archives.fedoraproject.org/pu...14/Everything/
.. and then install the packages manually.

.
As i have said in Post #4, #13 and #15 where do i install these into??
The default rpm install would put it into the already existing system folders, which i dont want to mess with.
And i don even wanna do this with root (but fine since rpm install wont allow without root permission fine i will do it as root).

Can these packages be put into the new build directory which i am creating with gmp,mpfr,mpc (if needed binutils,linux headers API)?

Or the oly way is i have to do a default rpm install to the old system directories?

Note: I tried rpm install of glibc-devel with --prefix and relocate options, both dint work out.
 
Old 03-31-2012, 03:48 PM   #18
mvairavan
Member
 
Registered: Feb 2011
Posts: 31

Original Poster
Rep: Reputation: 0
i have used rpm2cpio to extract the rpm package and copied the files to new build directory(which i call as sys-root).

Now i have glibc-devel(both 32 and 64), glibc-headers, gmp-devel,mpfr-devel, gmp,mpfr,mpc in the new build directory

How do i specify in configure that these glibc-devel packages are in this folder rather /usr/lib ??

What i tried :

1) make the gcc using --with-sysroot option specifyin it to this directory, so that it can find the new glibc-devel files.
Now it showed some files inside the sys-rrot/include folder not found..

2) So i installed the linux headers API as mentioned in LFS chapter 6.7. This error solved.
Now it shows /usr/bin/ld not configured with sysroot

3) So i installed binutils into the sysroot folder with the options --with-gmp,with-mpfr,with-mpc,with-build-sysroot,with-sysroot

4)Now it shows,
cannot find /lib/libc.so.6
cannot find /lib/ld-linux.so.2

Both the files are not present, but there is one libc.so. So i created a symlink for libc.so.6.
This seems to be a big blunder as my shell is gone for a toss now. All my commands are showing an error stating
Invalid ELF Header - pointing to that symlink file. I have to exit and come back and its working fine now.

Where do i get libc.so.6 or ld-linux.so.2, should i install glibc for this? wont it come with gcc??

Please correct me if i was wrong in any of the step.
 
Old 03-31-2012, 03:53 PM   #19
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
# 17

Any rpm package can be unpacked to a folder in /home/<name>/ :

cd <??>/ && rpm2cpio <package>.rpm | cpio -idmv

Glibc-devel :
You will have to replace the link 'libc.so' with a new one pointing to 'libc.so.6'.

.
 
Old 03-31-2012, 03:59 PM   #20
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
# 18 : Glibc is your OS, and is always installed.

Please check the location of your glibc files, libc.so.6, ld-linux.so.2 etc.
with the command : rpm -ql glibc
 
Old 03-31-2012, 04:18 PM   #21
mvairavan
Member
 
Registered: Feb 2011
Posts: 31

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by knudfl View Post
# 18 : Glibc is your OS, and is always installed.

Please check the location of your glibc files, libc.so.6, ld-linux.so.2 etc.
with the command : rpm -ql glibc
Since all my other dependencies are new, why dont i install glibc as well into this?
Or else i will be left with a lower version of glibc but higher version of gcc, isn't that a prob?
 
Old 03-31-2012, 07:16 PM   #22
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,623

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
you are making a hell of a lot of work out of it
more than needs to be

you can manually DL a fedora 17 src.rpm and rebuild that and install it ANY where

but WHY a odd location ????
just rename it ( as you would NORMALLY DO )
gcc4.7

there is NO NEED to place it some odd place
in my /usr/bin i have
gcc3.4,gcc4.1 gcc4.3 and gcc4.5

and they are NOT in different folders

well the build packages are but linked to /usr/bin/gcc ( gcc is a LINK )

they are DESIGNED to be installed side by side

well i am unsubscribing from this so.......
 
Old 03-31-2012, 11:23 PM   #23
mvairavan
Member
 
Registered: Feb 2011
Posts: 31

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by John VV View Post
you are making a hell of a lot of work out of it
more than needs to be

you can manually DL a fedora 17 src.rpm and rebuild that and install it ANY where

but WHY a odd location ????
just rename it ( as you would NORMALLY DO )
gcc4.7

there is NO NEED to place it some odd place
in my /usr/bin i have
gcc3.4,gcc4.1 gcc4.3 and gcc4.5

and they are NOT in different folders

well the build packages are but linked to /usr/bin/gcc ( gcc is a LINK )

they are DESIGNED to be installed side by side

well i am unsubscribing from this so.......
That was mean "Unsubscribing", anyways, thanks for your help john. I tried your method, it dint work either thats why i moved on to the above one.

Actually why not /usr/bin? Because i cannot!! I am working on cluster as a user, where i need my own compiler (newer one). I cannot ask the admin for a new one just because i need it. I tried using f17.src.rpm as well.

rpm -i <..>.rpm doesn't do anything. It shows kind of installing progress bar, but i could find out where it has turned it. We have even tried it as a root on test node, but no effects.

so what i did with that f17-src.rpm :
I extracted it using rpm2cpio, then there where two more tar files fast-jar and gcc, extracted them as well.
Did the contrib/download_prerequiestes which downloaded the mpc,mpfr,gmp.
Now did a gcc configure with just prefix, And i hit the same error (glibc-devel one)


/usr/bin/ld: cannot find crti.o: No such file or directory
/usr/bin/ld: skipping incompatible /usr/lib64/libc.so when searching for -lc
/usr/bin/ld: cannot find -lc
/usr/bin/ld: cannot find crtn.o: No such file or directory

What do i do now? Any method is fine for me, as long it works.

I have one doubt but I understand that gcc uses glibc, am i right? If so then just updating gcc with a still older glibc, is no good right?
 
Old 03-31-2012, 11:58 PM   #24
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,623

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
in post 23 we find out that you DO NOT have root access
everything so far HAS REQUIRED root access
that should have been in the first post

Have the system administrator manually install that on the ,we NOW find out a OFFLINE cluster .

as a normal user
Answer - you do not .
at least not anywhere near easy
you "might" be able to install the needed software in your $HOME folder but ...
have the system admin do it .
 
Old 04-01-2012, 12:37 AM   #25
mvairavan
Member
 
Registered: Feb 2011
Posts: 31

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by John VV View Post
in post 23 we find out that you DO NOT have root access
everything so far HAS REQUIRED root access
that should have been in the first post

Have the system administrator manually install that on the ,we NOW find out a OFFLINE cluster .

as a normal user
Answer - you do not .
at least not anywhere near easy
you "might" be able to install the needed software in your $HOME folder but ...
have the system admin do it .
I thought since i am compiling rather than installing through binary, root permission will not be a big issue. I am sorry if i was wrong.

Answer to the system admin installing is no - he simply turned it down and said he dont wanna mess around now.

And i have come this far without root permission, please dont say me i cannot do it now. It should be possible even if it takes some more extra time, i am willing to do it.

Lets start from #21
 
Old 04-01-2012, 12:54 AM   #26
mvairavan
Member
 
Registered: Feb 2011
Posts: 31

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by John VV View Post
in post 23 we find out that you DO NOT have root access
everything so far HAS REQUIRED root access
[b]
as a normal user
Answer - you do not .
at least not anywhere near easy
you "might" be able to install the needed software in your $HOME folder but ...
have the system admin do it .
Why do u say it cannot be done?
All i have to do is,

install glib-devel(32 & 64),glibc-headers,gmp-devel,mpfr-devel -- ( i have done this in a common folder)
install gmp,mpfr,mpc -- ( I have done this as well in the same folder as above)

then gcc - here i have the options to specify the location of gmp,mpfr,mpc but how do i specify the place where all the development libraries are installed?
I think if i figure out this, it will get compiled. (--with-sysroot creates more complication)
 
Old 04-01-2012, 03:33 AM   #27
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
John is right, if you don't want to use the methods suggested
in post #3, you can just rebuild the Fedora 17 src rpm.

Add option --program-suffix=47 to the configure line in the spec file,
and rpmbuild will create packages with /usr/bin/ gcc47 g++47

No need to make all the complicated actions. And a glibc / binutils different
from the default versions will just make it impossible to use your result.
( I guess.)

.

Last edited by knudfl; 04-01-2012 at 03:35 AM.
 
Old 04-01-2012, 04:40 AM   #28
mvairavan
Member
 
Registered: Feb 2011
Posts: 31

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by knudfl View Post
John is right, if you don't want to use the methods suggested
in post #3, you can just rebuild the Fedora 17 src rpm.

Add option --program-suffix=47 to the configure line in the spec file,
and rpmbuild will create packages with /usr/bin/ gcc47 g++47

No need to make all the complicated actions. And a glibc / binutils different
from the default versions will just make it impossible to use your result.
( I guess.)

.
ok i downloaded the rpm, extracted it. Edited the spec file reflecting --program-suffix=-4.7 in the gcc configuration line.

and then i do a `rpmbuild gcc.spec`. It shows,


error: Failed build dependencies:
glibc-static is needed by gcc-4.7.0-1.fc14.x86_64
dejagnu is needed by gcc-4.7.0-1.fc14.x86_64
sharutils is needed by gcc-4.7.0-1.fc14.x86_64
systemtap-sdt-devel >= 1.3 is needed by gcc-4.7.0-1.fc14.x86_64
/usr/share/java/eclipse-ecj.jar is needed by gcc-4.7.0-1.fc14.x86_64
gcc-java is needed by gcc-4.7.0-1.fc14.x86_64
elfutils-devel >= 0.147 is needed by gcc-4.7.0-1.fc14.x86_64
elfutils-libelf-devel >= 0.147 is needed by gcc-4.7.0-1.fc14.x86_64
gcc-gnat >= 3.1 is needed by gcc-4.7.0-1.fc14.x86_64
libgnat >= 3.1 is needed by gcc-4.7.0-1.fc14.x86_64
ppl-devel >= 0.10 is needed by gcc-4.7.0-1.fc14.x86_64
cloog-ppl-devel >= 0.15 is needed by gcc-4.7.0-1.fc14.x86_64
graphviz is needed by gcc-4.7.0-1.fc14.x86_64
libmpc-devel >= 0.8.1 is needed by gcc-4.7.0-1.fc14.x86_64
 
Old 04-01-2012, 05:05 AM   #29
mvairavan
Member
 
Registered: Feb 2011
Posts: 31

Original Poster
Rep: Reputation: 0
Solved, solved, solved, solved...

Post number #12 was just spot on.
It took some hours to persuade some ppl for connecting to net and doing a,

su -
yum install glibc-devel.i686 glibc-devel.x86_64 gmp-devel mpfr-devel


This installed some more dependency packages like glibc-headers, glibc-common, etc.

After that as a normal user, I have added the mpc,mpfr,gmp directories inside the gcc source folder.
Then a pretty much straight forward configuration with no extra options other than prefix and program-suffix did the trick.
And after setting the LD_RUN_PATH and LD_LIBRARY_PATH, i got my rather different Hello Winner! program printed out. So the actual gcc is still in my $HOME and its still a non root installation.

Wow!!!

Thanks JohnVV and knufdl.

Note: Answer to post #28 would add to my learning curve, so please answer if u can.
 
Old 04-01-2012, 05:40 AM   #30
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
# 18

Start with removing ada and java ( fortran ) from option --enable-languages=
in the spec file.


Then these lines will not appear in the "Failed build dependencies" text :
/usr/share/java/eclipse-ecj.jar is needed by gcc-4.7.0-1.fc14.x86_64
gcc-java is needed by gcc-4.7.0-1.fc14.x86_64
gcc-gnat >= 3.1 is needed by gcc-4.7.0-1.fc14.x86_64
libgnat >= 3.1 is needed by gcc-4.7.0-1.fc14.x86_64

Install the other packages with yum : # yum install \
glibc-static dejagnu graphviz elfutils-devel elfutils-libelf-devel \
systemtap-sdt-devel ppl-devel cloog-ppl-devel libmpc-devel

.
 
  


Reply


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Assistance in compiling an old version of gcc with a newer one Ztif Linux - Newbie 2 07-01-2011 12:01 PM
Compiling a module separately without compiling entire kernel kushalkoolwal Linux - Kernel 8 08-06-2008 01:45 AM
one more error building GCC - related with the newer version of Glibc?? lfs63 Linux From Scratch 1 02-17-2008 09:20 AM
install or upgrade newer or older gcc version saistain Linux - Software 1 10-19-2007 10:26 PM
Newer version of glibc means i cant install gcc coop Red Hat 0 09-21-2003 01:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:50 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration