This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RE: ansi C compiler needed
- To: "'Jason B. Minoza'" <jbminoza at imgame dot com dot ph>,<gcc-help at gcc dot gnu dot org>
- Subject: RE: ansi C compiler needed
- From: "Rupert Wood" <me at rupey dot net>
- Date: Sat, 18 Aug 2001 12:24:25 +0100
Jason B. Minoza wrote:
> i'm trying to setup Apache server on a newly acquired HP box. during
> "configuration" of apache, it detected that the compiler installed
> is not ANSI compliant.
If I recall, HP provide Apache binaries for free download from their
support site (although by installing GCC and building it yourself you
get more configuration flexibility, guaranteed binary module
compatibility, etc.)
> I was trying to install GCC but i always get the following error
> during the "make":
> cc1: warning: "-g" not supported by the configuration of GCC
> what would be the simpliest way of installing gcc to make our
> compiler ANSI compliant.
This isn't an error: the make should continue and the resulting binary
will be OK. It won't, however, contain debug symbols which is what '-g'
triggers. On the other hand, Apache builds may be set to treat warnings
as errors by adding '-Werror' to the command line. In this case, you
could remove '-Werror' from the makefile and watch carefully for any
other warnings you might need to fix.
On the other hand, you could build and install GNU binutils. HP cripple
their bundled assembler by removing debug symbol support; gcc detects
this and triggers the warning you are seeing. The GNU assembler does
support debug symbols and once you've rebuilt gcc to target the GNU
assembler then it will accept '-g' happily.
You've got three choices:
1. build and install binutils to the same location as gcc, then
rebuild gcc. Start with a fresh build directory; it's safest not
to try and reconfigure your existing build.
2. build and install binutils to a different location, then rebuild
gcc from a fresh configure adding:
--with-gnu-as --with-as=/binutils/path/bin
to the configure line.
3. combine the binutils and gcc sources into a single tree then
configure and build both together. Either:
a, unpack binutils, then copy everything from the root gcc
directory over the root binutils directory
b, combine both trees to a third tree using hard links.
Create a new combined directory, then from an unpacked
binutils run:
find . -print | cpio -pdlm /combined/path
and from the unpacked gcc:
find . -print | cpio -pdlmu /combined/path
You can then perform a single configure, make bootstrap of the
combined source tree to build the GNU assembler and a copy of
GCC configured to use it.
Note that in any case you'll get a warning building binutils that the
linker (ld) isn't supported on this target. This isn't anything to worry
about; the HP bundled linker is fine.
(You may not actually need to rebuild GCC - that may be my imagination,
and the existing build of gcc could detect and support the GNU assembler
as-is. Rebuilding it won't do any harm though.)
Good luck,
Rup.