tags:

views:

100

answers:

5

hi how can i install gcc on a system that have not any c compiler? this system is a linux base firewall and have not any c compiler.

A: 

If it's a debian based distribution, you can use

sudo apt-get install gcc

Note: maybe you must change "gcc" by a specific version of the debian package.

Topera
+1  A: 

It depends on the distribution, if it's based on debian or some other of the big ones you can install gcc through apt-get or similar tool.

If it's a more basic system you need to compile gcc yourself on another computer and copy it over. It will be easiest if you have another computer with the same architecture (i386, arm or x86_64 for example).

I think that you might want to compile it statically also, so that you don't have dependencies on external libraries.

Alexander Kjäll
this linux system based on EFW (endian fire wall)
haw3d
I would maybe also say that i would look over the reasons you have for installing gcc on your firewall, it sounds like a bad idea from start. So only try to go down this path if you have a really good reason to do it.
Alexander Kjäll
+2  A: 

I guess you a have an appliance running Linux and shell-access, but neither a package manager nor a compiler is installed.

So, you need to cross-compile gcc and the whole toolchain (at least binutils) - this is quite simple, because the ./configure scripts of gcc, binutils, gdb etc. support cross-compiling with the --target= option. So all you have to do is to find out the target architecure (uname helps) and then download, unpack the gcc sources on a linux-host and run ./configure --target=$YOUR_TARGET.

With this, you now can build a cross-compiler gcc - this still runs on your host, but produces binaries for your target (firewall appliances).

This may already be sufficient for you, a typical desktop PC is much faster than a typical appliance, so it may make sense to compile everything you need on the Desktop PC with the cross-compiler and cross-binutils.

But if you really wish to do so, you can now also use your cross-compiler to compile a gcc running on your target (set this as --host= option) and compiling for your target (set this as --target option).

You can find details about allowed host/targets and examples in the gcc documentation: http://gcc.gnu.org/install/specific.html.

IanH
A: 

How do you plan to get all the source code needed for GCC loaded onto your machine? Could you mount the ISO image onto this machine and install from there?

Jayan
A: 

Since you are using Endian Firewall, see "Building a development box" at the following link:

http://alumnus.caltech.edu/~igormt/endian/tips.html

Justin