public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Kai Ruottu <kai.ruottu@wippies.com>
To: cdinesh <dinesh.chuhan@gmail.com>
Cc: gcc-help@gcc.gnu.org
Subject: Re: gcc  compatibility
Date: Fri, 23 May 2008 15:18:00 -0000	[thread overview]
Message-ID: <48369768.2030008@wippies.com> (raw)
In-Reply-To: <17420841.post@talk.nabble.com>

cdinesh wrote:

> now Iam planning to copy system B libraries ( mainly glibc-2.5) to system A 
> at some location (i.e /usr/local/lib-2.5 ) and while building binary on
 > system B  and give -L /usr/local/lib-2.5

There are two linker options for seeing the shared libraries first in
some exceptional place :

1. at link-time : -rpath-link <directory>

2. at run-time  : -rpath <directory>

So one can control where the libraries are searched from first when
linking and where they are seached first at run-time.

Basically the installed shared libraries in '/lib' and '/usr/lib'
should enable any "sanily made" application to run! It is really
unsane to expect any application made for a newer system to run
on older systems meanwhile it is perfectly sane to expect all those
apps made for older systems to run on newer systems...

In your case all apps made for (usually also 'on') the older system
A, should work on the newer system B. But never vice versa :(

The GCCs coming with the Linux distros are called "native", they are
only for building apps from sources for the native system! All apps
will be distributed as sources, this is the goal in "open source".
If one needs to produce apps for "other systems", let these be
Sparc/Solarises, Windoze/Cygwin, Windoze/MinGW, other Linuces with
other CPU-architectures or only some other distro for just the same
CPU-architecture, then one should produce the apps via "crosscompiling",
the "native compiling" cannot do that....

If people or companies would pay for or even ask these "cross
toolchains" being delivered as install packages, then surely
they would be there. At least the Debian people have asked about
possibilities to produce apps for Windoze because the MinGW-target
tools have been with this distro for a while (some years)...

Currently people like to build these things themselves, from sources
of course (binutils and GCC, the target libraries are usually pre-made
and pre-tested)...

> 
> Is there any other processor ??
> 
> regards
> dinesh
> 
> 
> 
> Sven Eschenberg wrote:
>> Hi Dinesh,
>>
>> Well it is fairly normal to run into problems when trying to run a 
>> progam with old libs, if it was linked to newer ones.
>>
>> If there is a command line switch, it's rather related to ld (the 
>> linker) whose switches of course can be passed to gcc.
>>
>> To find out which switch might help and why exactly the old glibc's 
>> dynamic linker doesn't like the executeable from system B, you can try 
>> the following:
>>
>> set LD_DEBUG to all (export LD_DEBUG="all")
>>
>> Then run your program, and see if the linker spits out something where 
>> exactly the problem occurs (maybe you are lucky)
>>
>> One issue could be the .hash versus .gnu.hash section ... I don't know 
>> when this was changed. But as long as we do not know what the linker was 
>> trying to do, when it crashed, it will be hard to see, if the problem 
>> can be fixed by a commandline switch.
>>
>> Regards
>>
>> -Sven
>>
>> P.S.: To answer your previous gate.so question - It is a virtual shared 
>> object which maps the kernel's syscall interface into the proces' memory 
>> map ... I doubt this causes the linker to go nuts ...
>>
>>>  Thank you Sven for quick response
>>>   
>>>   
>>>>>  As you can see your program is linked against the NTPL version of
>>>>> glibc 
>>>>> on System A (running glibc 2.3) ... LinuxThreads support was dropped in 
>>>>> 2.4 AFAIK. Obviously the version compiled on System B is linked against 
>>>>> version 2.5 of glibc.
>>>>>       
>>> Correct both have different thread  versions
>>>
>>>   
>>>>> You could check the outputs of your two glibc version to check for 
>>>>> differences ... (Just run them), the output should somewhat look like
>>>>>       
>>> this:
>>> yaa , correct  but  is there any compile option  in gcc that can ignore
>>> glibc versions or ABI changes ??
>>>
>>>  Is there any problem in "linux-gate.so.1" ??
>>>
>>> thank you 
>>> dinesh
>>>  
>>>   
>>
> 

  reply	other threads:[~2008-05-23 10:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-22  3:38 cdinesh
2008-05-22  5:09 ` Sven Eschenberg
2008-05-22  7:18   ` cdinesh
2008-05-22  8:17     ` Sven Eschenberg
2008-05-23 10:01       ` cdinesh
2008-05-23 15:18         ` Kai Ruottu [this message]
2008-05-27  9:09 ` Harald Krammer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48369768.2030008@wippies.com \
    --to=kai.ruottu@wippies.com \
    --cc=dinesh.chuhan@gmail.com \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).