Relocateable GCC!!!!

Gurus,

This might be a piece of cake for you guys! But I have been ransacking the web (and my brain - no hardwork there!) to see if I could get my hands around a relocateable version of GCC - why so??

  1. from compile problems I am facing, it is evident my current gcc version is clearly not updated
  2. I am not a root user - so I am going to have to install this in my personal directory (I did put the request out to my UNIX admin, and it has been lying there for the last 2 weeks - I will be clearly in trouble if this was to get delayed any further!)

Question - could you help me locate and install gcc in a directory I could specify???

Truly appreciate any help you could provide!!!

  • G

---------- Post updated at 08:45 PM ---------- Previous update was at 08:43 PM ----------

Sorry - forgot to mention - OS is AIX 5.3.

What do you mean by "relocateable version of GCC"? Generate relocatable code?

You know how when you run the rpm to install the package - you could use the "--relocate" flag to install in a directory other than where the package currently points - THAT IS, IF THE PACKAGE ALLOWS IT, right??? i.e. if it is relocateable (can be seen by running the "rpm -qip " command on the package).

All rpms I have found through the web are "not relocatable".

Do you know of any RPM or software out there that will help me install GCC in a directory I could specify?

Thanks!
Leon

try one of these. don't know if it's relocatable or not.

Index of /aixtoolbox/RPMS/ppc/gcc

Frank,

Thanks much for the link! However, I tried a version for 5.3 and it seems to be ir-relocateable too -

> rpm -qip gcc-4.2.0-2.aix5.3.ppc.rpm
Name : gcc Relocations: (not relocateable)
Version : 4.2.0 Vendor: (none)
Release : 2 Build Date: Mon Feb 18 11:39:00 GMT 2008
Install date: (not installed) Build Host: gibi.coopibm.frec.bull.fr
Group : Development/Tools Source RPM: gcc-4.2.0-2.src.rpm
Size : 10421611 License: GPL
Summary : GNU Compiler Collection
Description :
The gcc package includes the gcc GNU compiler for compiling C code.

I am losing hope. HELPPPPPP!!!! THIS SHIP IS SINKING!!!!!!

  • G

Hi,

as far as I am aware of, there is no gcc package out there that can be relocated and would work on AIX. Apart from that, even if it would be you would have to install it as root user as it would have to do all the linking ... so this looks like you have no other choice than to wait ...

Kind regards
zxmaus

sounds like you or your manager needs to give the admin a call if it is that important.

ok - but I always thought, it is especially convenient in Unix to have softwares versions installed in personal directories - and have the environment determine which version is used. not true??? if it's true, then is gcc an exception???

Can you not compile up your own version of gcc from sources ? Its pretty simple (If the O/S is supported), and you can then specify the install dir.

That sounds like what I have been asking for - can I get the source for gcc that I can install in a directory of my choice??

Thanks!

G

yes you can. download the source and build it. make sure use the --prefix configure option. also - it is not the norm to install software like a heavy weight compiler in a users home directory.

GCC, the GNU Compiler Collection - GNU Project - Free Software Foundation (FSF)

here is the option I used on my Solaris box. keep in mind you will have to setup your paths correctly when building and running the programs.

$ gcc -v
Reading specs from /usr/local/gcc-3.4.5/lib/gcc/sparc-sun-solaris2.9/3.4.5/specs
Configured with: ../gcc-3.4.5/configure --prefix=/usr/local/gcc-3.4.5 --with-as=/usr/local/bin/as --with-ld=/usr/local/bin/ld
Thread model: posix
gcc version 3.4.5

I mentioned it before - relocatable or not - you need root to install anything on the systems ...

BTW - why don't you just compile your code on any other system that does have gcc installed? With cross compiler options, you could even compile code for AIX on say a solaris box.

Regards
zxmaus

I believe that is why he is interested in compiling up GCC with a different prefix configured - in that event he does not have to be root or have root access to create a working gcc executable.

Ok - I did get the admin to upgrade the gcc version to 4.2 eventually. Thanks for your help so far!!!

However, if you guys wouldn't mind helping me out, I am having a problem with Apache installation that is using the new gcc compiler - here is the error -

  1. Configure works well (maybe not as the next step fails)
  2. Make fails with the following error -
collect2: library libgcc_s not found
make: 1254-004 The error code from the last command is 1.

Stop.
make: 1254-004 The error code from the last command is 1.

Stop.
make: 1254-004 The error code from the last command is 1.

Stop.
make: 1254-004 The error code from the last command is 1.

Stop.

Thanks as always!

  • G

try this. I am not sure if LD_LIBRARY_PATH is needed when using gcc on AIX. Set it to be safe. also make sure your version of gcc is first in $PATH.

export LIBPATH=/path/to/your/gcc/build/lib:$LIBPATH
export LD_LIBRARY_PATH=/path/to/your/gcc/build/lib:$LD_LIBRARY_PATH
./configure ...
make

Thanks frank! Although, I get the same error again -

collect2: library libgcc_s not found
make: 1254-004 The error code from the last command is 1.NT=Garamond]

---------- Post updated at 03:49 PM ---------- Previous update was at 03:45 PM ----------

When I look for all instances of gcc on the system, here is what I see -

/opt/freeware/bin/gcc
/opt/freeware/info/gccint.info.gz
/opt/freeware/info/gcc.info.gz
/opt/freeware/info/gccinstall.info.gz
/opt/freeware/lib/gcc
/opt/freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.2.0/libgcc.a
/opt/freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.2.0/libgcc_eh.a
/opt/freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.2.0/ppc64/libgcc.a
/opt/freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.2.0/ppc64/libgcc_eh.a
/opt/freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.2.0/pthread/libgcc.a
/opt/freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.2.0/pthread/libgcc_eh.a
/opt/freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.2.0/pthread/ppc64/libgcc.a
/opt/freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.2.0/pthread/ppc64/libgcc_eh.a

I put /opt/freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.2.0/ in front of my current LIBPATH and LD_LLIBRARY_PATH (LD_LIBRARY_PATH was not set - perhaps not used by AIX).
Here is the configure I am using -

./configure --enable-so --enable-mods-shared=most --prefix=/my/installation/dir/for/apache

What could be wrong here?

  • G