This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
gcc executable for different OS revisions
- To: gcc at gcc dot gnu dot org
- Subject: gcc executable for different OS revisions
- From: Uros Bizjak <bizjak at rd dot iskraemeco dot si>
- Date: Fri, 26 Oct 2001 09:12:56 +0200
- Organization: Iskraemeco
Hello!
I have a specific problem with installation of gcc in a directory,
shared between machines with different OS revisions. This executable is
named gcc, and there lies a problem:
gcc, compiled and installed from SunOS 5.8, can only be used from
SunOS 5.8. Trying to call gcc from SunOS 5.5.1, I get:
omen1> uname -a
SunOS omen1 5.5.1 Generic_103640-32 sun4m sparc SUNW,SPARCstation-20
omen1> gcc-5.8
ld.so.1: gcc-5.8: fatal: relocation error: file gcc-5.8: symbol
bindtextdomain: referenced symbol not found
Killed
Trying to compile something on SunOS 5.8 with gcc, compiled and
installed on SunOS 5.5.1, I got:
omen3> uname -a
SunOS omen3 5.8 Generic_108528-10 sun4u sparc SUNW,Ultra-5_10
omen3> gcc-5.5.1 ...
...
In file included from
/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.2/include/wchar.h:22,
from IDL.h:32,
from util.h:36,
from ./lexer.l:31:
/usr/include/time.h:111: parse error before "pthread_attr_t"
/usr/include/time.h:113: parse error before '}' token
I would propose a solution for this situation. Perhaps it would be
fine to install gcc executable as
gcc.some_system_identification, for example gcc.sparc-sun-solaris2.5.1,
gcc.sparc-sun-solaris2.8, etc...,
and then link this executable from gcc script.
Thus, I have built two gcc executables: gcc-5.5.1 and gcc-2.8. I have
also written a gcc script (trivial, but attached to this message
anyway), which calls appropriate executable depending on result of
`uname -r`. This works quite well, and all machines can now access gcc
with a single command, and gcc could still be maintained in one shared
directory.
--
Uros.
#! /bin/sh
gcc-`uname -r`