LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-23-2010, 03:30 PM   #1
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
Compiled GCC, but the result "cannot find -lgcc_s"


Hi,

I want to use GCC 4.1.2 on a SLES 11.0 x86_64 system. SLES 11 comes with GCC 4.3, so I compiled 4.1.2 and `make install`'d myself. When trying to use it, I get:

Code:
 # /usr/local/bin/gcc-4.1 hello.c  
/usr/bin/ld: cannot find -lgcc_s
collect2: ld returned 1 exit status
hello.c is simply:
Code:
#include <stdio.h>
int main () {
  printf("hello world\n");
}
lgcc_s is libgcc_s.so.1 which is found in both /usr/local/lib/gcc/x86_64-suse-linux/lib64 and /usr/local/lib/gcc/x86_64-suse-linux/lib.

`/usr/local/bin/gcc-4.1 -static hello.c` works.
`/usr/local/bin/gcc-4.1 -L/usr/local/lib/gcc/x86_64-suse-linux/lib64 hello.c` works.
`/usr/bin/gcc-4.3 hello.c` works.

I created /etc/ld.so.conf.d/gcc-412.conf and added "/usr/local/lib/gcc/x86_64-suse-linux/lib64" and "/usr/local/lib/gcc/x86_64-suse-linux/lib" to it. I ran `ldconfig -v` and it does find them:
Code:
/usr/local/lib/gcc/x86_64-suse-linux/lib64:
        libgcc_s.so.1 -> libgcc_s.so.1
/usr/local/lib/gcc/x86_64-suse-linux/lib:
        libgcc_s.so.1 -> libgcc_s.so.1
However, I still get "cannot find -lgcc_s."

I did run the gcc test suites and there were only 12 unexpected failures or successes out of 55k, which the install page says is to be expected.

I ./configured gcc with
Quote:
Target: x86_64-suse-linux
Configured with: ../gcc-4.1.2/configure --enable-languages=c,c++ --enable-ssp --disable-libssp --disable-libgcj --disable-libmudflap --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --enable-version-specific-runtime-libs --program-suffix=-4.1 --enable-linux-futex --without-system-libunwind --build=x86_64-suse-linux --host=x86_64-suse-linux
-- basically, I took SLES' gcc-4.3 ./configure line and removed the prefix & path directives and changed the program suffix. Considering I don't know the use of half those options I'm trying again taking as many defaults as possible.

But I don't know what I am missing. How do I get it so that I don't have to use -L or -static to use my gcc-4.1?

Last edited by AlucardZero; 11-23-2010 at 03:32 PM.
 
Old 11-23-2010, 04:59 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Quote:
I ./configured gcc with
Looks suspicious : It's "two dots" when you have a build directory
outside the gcc-4.1.2/ source : $ ../gcc-4.1.2/configure -- -- .
I.e. gcc cannot be build without that external build folder.
Except that your "configure" line / options look strange, I don't think,
you can build 4.1.x using gcc-4.3 ?

Build method to be used : LFS, Linux from scratch, book 6.3.


But fortunately, it's not necessary to build it.
Packages from Suse 11.1 can be used : The "compat gcc41" ...
http://download.opensuse.org/distrib...s/suse/x86_64/
Required : cpp41 gcc41 libstdc++41-devel gcc41-c++ ( All -x86_64 ).
..

Last edited by knudfl; 11-23-2010 at 05:05 PM.
 
1 members found this post helpful.
Old 11-23-2010, 05:43 PM   #3
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Original Poster
Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
Quote:
Looks suspicious : It's "two dots"
Yes, sorry, I actually was in /tmp/gccbuild and did ../gcc-4.1.2/configure.
Quote:
I don't think, you can build 4.1.x using gcc-4.3 ?
.. really?
Quote:
Packages from Suse 11.1 can be used
Is mixing OpenSUSE and SLES smart? I suppose I can try it tomorrow.. I'll check for file conflicts before installing.
 
Old 11-24-2010, 03:11 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Quote:
Is mixing OpenSUSE and SLES smart? I suppose I can try it tomorrow..
I'll check for file conflicts before installing.
I did # rpm -Uvh cpp41 , etc. etc. on a SLED 11 - 32bit yesterday.
And gcc33 -v comes with the "usual reply".

How could there be any conflicts ? These compat compilers,
gcc33, gcc41 etc. are all used at the same time in Suse 11.1,
11.2, 11.3. (But I haven't tested gcc41 on SLED 11 before.)

I have used the Suse gcc33, gcc41 in Fedora 10-13, Mandriva, PCLinuxOS.
They always work.
..

Last edited by knudfl; 11-24-2010 at 05:40 PM.
 
  


Reply



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
Disk free result "df" differs from "du" ongi Linux - Server 4 04-01-2008 07:10 AM
initial build of gcc: "cannot find -lc" xlq Linux From Scratch 5 06-03-2007 08:40 AM
GCC compile error:cannot find -lgcc_s lilzz Linux - Newbie 5 08-18-2006 05:53 PM
Porting to Fedora gcc 4.0 -parsing backward slash("\") comma(",") code_blew Programming 1 04-26-2006 04:07 PM
Can't install "glibmm" library. "configure" script can't find "sigc++-2.0&q kornerr Linux - General 4 05-10-2005 02:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:11 PM.

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