public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* compiling gcc
@ 2001-01-11  9:38 ryan p bobko
  2001-01-11 10:38 ` Alexandre Oliva
  0 siblings, 1 reply; 13+ messages in thread
From: ryan p bobko @ 2001-01-11  9:38 UTC (permalink / raw)
  To: gcc-help

Hi. 
I'm trying to compile gcc 2.95.2 from source, and it sems to work correctly.
However, when I try to compile other things using a "configure" script, my
system type can no longer be guessed by "config.guess." How can I make that
automatic again?

By the way, this is an intel Redhat 6.2 installation.

Thanks,
ry

-- 
Those who would give up essential Liberty to purchase a little temporary
safety deserve neither liberty nor safety.
	-- Ben Franklin

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: compiling gcc
  2001-01-11  9:38 compiling gcc ryan p bobko
@ 2001-01-11 10:38 ` Alexandre Oliva
  0 siblings, 0 replies; 13+ messages in thread
From: Alexandre Oliva @ 2001-01-11 10:38 UTC (permalink / raw)
  To: ryan p bobko; +Cc: gcc-help

On Jan 11, 2001, ryan p bobko <ryan@ostrich-emulators.cx> wrote:

> How can I make that automatic again?

ln -s /path/to/gcc /usr/bin/cc

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Compiling gcc.
  2012-02-24  5:30 Compiling gcc Me Myself and I
  2012-02-24  9:05 ` Jonathan Wakely
@ 2012-02-24 10:42 ` Bryce McKinlay
  1 sibling, 0 replies; 13+ messages in thread
From: Bryce McKinlay @ 2012-02-24 10:42 UTC (permalink / raw)
  To: Me Myself and I; +Cc: gcc-help, java, mingw-users

On Fri, Feb 24, 2012 at 5:30 AM, Me Myself and I
<stargate7thsymbol@live.co.uk> wrote:

> I have
>
> gcc-core-4.6.2.tar
>
> Operating under a unix-esque environment.  Coincidentally, I have
>
> gcc-java-4.6.2.tar
>
> as subdirectories inside the former, which I am told will compile along with the former
> automatically, with no further input.

You may also need to configure with "--enable-languages=java". I'm not
sure if Java support is built by default these days.

> What do I do to get the gcc-core-4.6.2.tar compiled, built and compiling?

Have you considered installing a binary package rather than trying to
build gcc/gcj from source? Most Linux distributions do include gcj (or
"gcc-java") packages, and you'll probably find this easier to get
started with.

Bryce

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Compiling gcc.
  2012-02-24  5:30 Compiling gcc Me Myself and I
@ 2012-02-24  9:05 ` Jonathan Wakely
  2012-02-24 10:42 ` Bryce McKinlay
  1 sibling, 0 replies; 13+ messages in thread
From: Jonathan Wakely @ 2012-02-24  9:05 UTC (permalink / raw)
  To: Me Myself and I; +Cc: gcc-help, java

Again, please don't cross-post to subscription-only lists, it breaks
Reply-to-all.

On 24 February 2012 05:30, Me Myself and I wrote:
>
> I have
>
> gcc-core-4.6.2.tar
>
> Operating under a unix-esque environment.  Coincidentally, I have
>
> gcc-java-4.6.2.tar
>
> as subdirectories inside the former, which I am told will compile along with the former
> automatically, with no further input.

You should have unpacked the archives into the same directory, so you
have libjava directory under the top-level gcc-4.6.2 directory.  You
do not want two levels of gcc-4.6.2, i.e. gcc-4.6.2/gcc-4.6.2/libjava

> What do I do to get the gcc-core-4.6.2.tar compiled, built and compiling?

Read the links I sent you!

http://gcc.gnu.org/wiki/InstallingGCC for an overview

http://gcc.gnu.org/install/ for the full instructions.

If you're trying to build a cross-compiler for Windows, you already
posted rmathew's instructions, which seem like a good start.

Have you even tried to follow those instructions, or are you just
starting yet another thread with the same questions?

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Compiling gcc.
@ 2012-02-24  5:30 Me Myself and I
  2012-02-24  9:05 ` Jonathan Wakely
  2012-02-24 10:42 ` Bryce McKinlay
  0 siblings, 2 replies; 13+ messages in thread
From: Me Myself and I @ 2012-02-24  5:30 UTC (permalink / raw)
  To: gcc-help, java, mingw-users


I have 

gcc-core-4.6.2.tar

Operating under a unix-esque environment.  Coincidentally, I have

gcc-java-4.6.2.tar

as subdirectories inside the former, which I am told will compile along with the former
automatically, with no further input.

What do I do to get the gcc-core-4.6.2.tar compiled, built and compiling?

 		 	   		  

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Compiling GCC
  2007-01-31 11:26       ` Andrew Haley
@ 2007-01-31 12:53         ` Kai Ruottu
  0 siblings, 0 replies; 13+ messages in thread
From: Kai Ruottu @ 2007-01-31 12:53 UTC (permalink / raw)
  To: Andrew Haley; +Cc: Paulo J. Matos, gcc-help

Andrew Haley kirjoitti:
> Kai Ruottu writes:
>  > Paulo J. Matos wrote:
>  > > Probably this is due to the fact that in Gentoo intel core duo follow
>  > > the amd64 branch, since they are 64 bit processors...
>  > 
>  > Maybe your Gentoo is a "custom" Linux with unstandard conventions?
>
> Oh.  My.  God.  That is so truly screwed I don't know where to begin.
> No wonder gcc was confused!
>   
The first thing could be Paulo coming familiar with Gentoo, to 
investigate what its
'/lib' and '/usr/lib' have now, where those default 64-bit libs are, 
where the 32-bit libs
used with '-m32' are, where the GCC-version specific stuff should go, 
into two dirs:
'/usr/lib64/gcc/$target/$gcc-version' and 
'/usr/libexec/gcc/$target/$gcc-version', or
only into one ''/usr/lib/gcc/$target/$gcc-version'?  What is the Gentoo 
"standard" in
these things?

The '*lib' versus '*lib64' issue could be easy to solve by editing the
'gcc-4.1.1/gcc/config/i386/t-linux64', the rows now there :

MULTILIB_OPTIONS = m64/m32
MULTILIB_DIRNAMES = 64 32
MULTILIB_OSDIRNAMES = ../lib64 ../lib

by changing the last to be :

MULTILIB_OSDIRNAMES = ../lib ../lib32

in the Ubuntu case....  How "screwed" the Gentoo is, is hard to say.  
Things like where
the 'dynamic linker' is, can be totally "unstandard" :-)  Here is a clip 
from a 'objdump -l'
done for a SuSE Linux/x86_64 executable :

Elf file type is EXEC (Executable file)
Entry point 0x400740
There are 9 program headers, starting at offset 64

Program Headers:
  Type           Offset             VirtAddr           PhysAddr
                 FileSiz            MemSiz              Flags  Align
  PHDR           0x0000000000000040 0x0000000000400040 0x0000000000400040
                 0x00000000000001f8 0x00000000000001f8  R E    8
  INTERP         0x0000000000000238 0x0000000000400238 0x0000000000400238
                 0x000000000000001c 0x000000000000001c  R      1
      [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]

As the last row tells the 'dynamic linker'  will be searched from 
'/lib64', not from '/lib' !

I would assume the Gentoo and Ubuntu people to provide separate target 
templates
and config files for GCC, for 'x86_64-gentoo-linux' and 
'x86_64-ubuntu-linux'  hosts/targets,
if their Linux/x86_64's aren't like "the others"...  Anyway there should 
be patches or patched
GCC sources for Gentoo and Ubuntu where their stuff will be delivered.

In any case this difference in the (shared) library places would cause 
quite interesting issue
in "binary compatability" between the Linux/x86_64 distros....  For 
instance if the
'/lib/ld-linux-x86-64.so.2' and '/lib/libc.so.6'would be needed by some 
64-bit executables
but the  runtime system wouldn't have the first and the second would be 
a 32-bit one....
 
> Andrew.
>
>
>   

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Compiling GCC
  2007-01-31 10:52   ` Paulo J. Matos
  2007-01-31 11:04     ` Andrew Haley
  2007-01-31 11:21     ` Kai Ruottu
@ 2007-01-31 11:38     ` Kai Ruottu
  2 siblings, 0 replies; 13+ messages in thread
From: Kai Ruottu @ 2007-01-31 11:38 UTC (permalink / raw)
  To: Paulo J. Matos; +Cc: gcc-help

Paulo J. Matos wrote:
> Working gcc-4.1.1 compiler built by gentoo and working is:
> $ gcc -v
> Using built-in specs.
> Target: x86_64-pc-linux-gnu
> Configured with:
> /var/tmp/portage/gcc-4.1.1-r1/work/gcc-4.1.1/configure --prefix=/usr
> --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.1.1
> --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/include
 Also the '/usr/lib64/gcc/....'  could be the default in those current 
64-bit
Linuces, the '/usr/lib/gcc' then being the one in 32-bit Linuces....

 In cross-compilers on 32-bit hosts the '/usr/lib/gcc/...' then would be the
default, if configured using '--prefix=/usr'.  So this is $host 
specific, not
$target specific, a 'powerpc-linux-gnu' targeted GCC on x86_64 host
could have the '/usr/lib64/gcc/powerpc-linux-gnu/' in use for its GCC-
version specific stuff...

 Maybe there is no "standard" for this, GCC only assumes that existing :-(

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Compiling GCC
  2007-01-31 11:21     ` Kai Ruottu
@ 2007-01-31 11:26       ` Andrew Haley
  2007-01-31 12:53         ` Kai Ruottu
  0 siblings, 1 reply; 13+ messages in thread
From: Andrew Haley @ 2007-01-31 11:26 UTC (permalink / raw)
  To: Kai Ruottu; +Cc: Paulo J. Matos, gcc-help

Kai Ruottu writes:
 > Paulo J. Matos wrote:
 > > Probably this is due to the fact that in Gentoo intel core duo follow
 > > the amd64 branch, since they are 64 bit processors...
 > >
 > > checking whether the C compiler works... configure: error: cannot run
 > > C compiled programs.
 > > /home/pmatos/gcc411-build/./gcc/xgcc
 > > -B/home/pmatos/gcc411-build/./gcc/ -B
 > > /home/pmatos/gcc-bin/x86_64-unknown-linux-gnu/bin/
 > > -B/home/pmatos/gcc-bin/x86_64-unknown-linux-gnu/lib/ -isystem
 > > /home/pmatos/gcc-bin/x86_64-unknown-linux-gnu/include -isystem /hom
 > > e/pmatos/gcc-bin/x86_64-unknown-linux-gnu/sys-include  -m32 -o
 > > conftest -O2 -g -O2    conftest.c  >&5
 > > /usr/bin/ld: skipping incompatible /usr/lib/../lib/libc.so when
 > > searching for -lc
 > > /usr/bin/ld: skipping incompatible /usr/lib/../lib/libc.a when 
 > > searching for -lc
 > > /usr/bin/ld: warning: i386:x86-64 architecture of input file
 > > `/usr/lib/../lib/crt1.o' is incompatible with i386 output
 > With '-m32' the 32-bit libraries in '/usr/lib' will be used !  The 
 > '/usr/lib64' has
 > the 64-bit x86_64 libraries!
 > 
 > Maybe your Gentoo is a "custom" Linux with unstandard conventions?
 > 
 > The Ubuntu Linux/x86_64 is this kind of "custom" Linux where the
 > 64-bit libs are in '*lib' and the 32-bit libs in '*lib32'.  The
 > Fedora, SuSE etc. then use the convention which the GCC sources
 > assume a Linux/x86_64, or any other 64-bit Linux using
 > ('mips64-linux-gnu', 'ppc64-linux-gnu', 'sparc64-linux-gnu',.....)

Oh.  My.  God.  That is so truly screwed I don't know where to begin.
No wonder gcc was confused!

Andrew.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Compiling GCC
  2007-01-31 10:52   ` Paulo J. Matos
  2007-01-31 11:04     ` Andrew Haley
@ 2007-01-31 11:21     ` Kai Ruottu
  2007-01-31 11:26       ` Andrew Haley
  2007-01-31 11:38     ` Kai Ruottu
  2 siblings, 1 reply; 13+ messages in thread
From: Kai Ruottu @ 2007-01-31 11:21 UTC (permalink / raw)
  To: Paulo J. Matos; +Cc: gcc-help

Paulo J. Matos wrote:
> Probably this is due to the fact that in Gentoo intel core duo follow
> the amd64 branch, since they are 64 bit processors...
>
> checking whether the C compiler works... configure: error: cannot run
> C compiled programs.
> /home/pmatos/gcc411-build/./gcc/xgcc
> -B/home/pmatos/gcc411-build/./gcc/ -B
> /home/pmatos/gcc-bin/x86_64-unknown-linux-gnu/bin/
> -B/home/pmatos/gcc-bin/x86_64-unknown-linux-gnu/lib/ -isystem
> /home/pmatos/gcc-bin/x86_64-unknown-linux-gnu/include -isystem /hom
> e/pmatos/gcc-bin/x86_64-unknown-linux-gnu/sys-include  -m32 -o
> conftest -O2 -g -O2    conftest.c  >&5
> /usr/bin/ld: skipping incompatible /usr/lib/../lib/libc.so when
> searching for -lc
> /usr/bin/ld: skipping incompatible /usr/lib/../lib/libc.a when 
> searching for -lc
> /usr/bin/ld: warning: i386:x86-64 architecture of input file
> `/usr/lib/../lib/crt1.o' is incompatible with i386 output
With '-m32' the 32-bit libraries in '/usr/lib' will be used !  The 
'/usr/lib64' has
the 64-bit x86_64 libraries!

Maybe your Gentoo is a "custom" Linux with unstandard conventions?

The Ubuntu Linux/x86_64 is this kind of "custom" Linux where the 64-bit
libs are in '*lib' and the 32-bit libs in '*lib32'.  The Fedora, SuSE 
etc. then
use the convention which the GCC sources assume a Linux/x86_64, or any
other 64-bit Linux using ('mips64-linux-gnu', 'ppc64-linux-gnu',
'sparc64-linux-gnu',.....)

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Compiling GCC
  2007-01-31 10:52   ` Paulo J. Matos
@ 2007-01-31 11:04     ` Andrew Haley
  2007-01-31 11:21     ` Kai Ruottu
  2007-01-31 11:38     ` Kai Ruottu
  2 siblings, 0 replies; 13+ messages in thread
From: Andrew Haley @ 2007-01-31 11:04 UTC (permalink / raw)
  To: Paulo J. Matos; +Cc: gcc-help

Paulo J. Matos writes:
 > On 1/31/07, Andrew Haley <aph@redhat.com> wrote:
 > > Paulo J. Matos writes:
 > >  > Hello all,
 > >  >
 > >  > I'm trying to compile gcc in my home dir, just to make some tests but
 > >  > I've having some errors during compilation. Compilation is being
 > >  > performed in an intel duo core. This is what I do:
 > >  > ~/ tar -xvjf gcc-4.1.1.tar.bz2
 > >  > ~/ mkdir gcc-build
 > >  > ~/ cd gcc-build
 > >  > ~/ ../gcc-4.1.1/configure --prefix=/home/pmatos/gcc-bin
 > >  > --program-prefix=dr- --with-gnu-as --with-as=/usr/bin/as --with-gnu-ld
 > >  > --with-ld=/usr/bin/ld --host=x86_64-pc-linux-gnu
 > >  > --build=x86_64-pc-linux-gnu --disable-altivec --enable-nls
 > >  > --without-included-gettext --with-system-zlib --disable-checking
 > >  > --disable-werror --enable-secureplt --disable-libunwind-exceptions
 > >  > --enable-multilib --disable-libmudflap --disable-libssp
 > >  > --disable-libgcj --enable-shared --enable-threads=posix
 > >  > --enable-__cxa_atexit --enable-clocale=gnu
 > >  > (Note: some of these flags were copied from the Gentoo build, since I
 > >  > really didn't know what to use, the dr- prefix is just something so
 > >  > that the final binary doesn't shadow my production gcc)
 > >
 > > The build system thinks you're building a cross-compiler.  This is bad.
 > >
 > 
 > Why do you say that? Why do you say that the system thinks I'm
 > building a crosscompiler?
 > Probably this is due to the fact that in Gentoo intel core duo follow
 > the amd64 branch, since they are 64 bit processors...
 > 
 > > You need to get rid of some of the configure arguments.
 > >
 > >  ~/ ../gcc-4.1.1/configure --prefix=/home/pmatos/gcc-bin
 > >  --disable-altivec --enable-nls
 > >  --without-included-gettext --with-system-zlib
 > >  --disable-werror --enable-secureplt --disable-libunwind-exceptions
 > >  --enable-multilib --disable-libmudflap --disable-libssp
 > >  --disable-libgcj --enable-shared --enable-threads=posix
 > >  --enable-__cxa_atexit --enable-clocale=gnu
 > >
 > > ought to do it.
 > >
 > 
 > Exactly the same error:
 > checking for x86_64-unknown-linux-gnu-gcc...
 > /home/pmatos/gcc411-build/./gcc/xgcc
 > -B/home/pmatos/gcc411-build/./gcc/
 > -B/home/pmatos/gcc-bin/x86_64-unknown-linux-gnu/bin/
 > -B/home/pmatos/gcc-bin/x86_64-unknown-linux-gnu/lib/ -isystem
 > /home/pmatos/gcc-bin/x86_64-unknown-linux-gnu/include -isystem
 > /home/pmatos/gcc-bin/x86_64-unknown-linux-gnu/sys-include  -m32
 > checking for C compiler default output file name... a.out
 > checking whether the C compiler works... configure: error: cannot run
 > C compiled programs.

The problem might be that you don't have the target libs installed for
a multilib build.  Try --disable-multilib.

Andrew.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Compiling GCC
  2007-01-31 10:37 ` Andrew Haley
@ 2007-01-31 10:52   ` Paulo J. Matos
  2007-01-31 11:04     ` Andrew Haley
                       ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Paulo J. Matos @ 2007-01-31 10:52 UTC (permalink / raw)
  To: Andrew Haley; +Cc: gcc-help

On 1/31/07, Andrew Haley <aph@redhat.com> wrote:
> Paulo J. Matos writes:
>  > Hello all,
>  >
>  > I'm trying to compile gcc in my home dir, just to make some tests but
>  > I've having some errors during compilation. Compilation is being
>  > performed in an intel duo core. This is what I do:
>  > ~/ tar -xvjf gcc-4.1.1.tar.bz2
>  > ~/ mkdir gcc-build
>  > ~/ cd gcc-build
>  > ~/ ../gcc-4.1.1/configure --prefix=/home/pmatos/gcc-bin
>  > --program-prefix=dr- --with-gnu-as --with-as=/usr/bin/as --with-gnu-ld
>  > --with-ld=/usr/bin/ld --host=x86_64-pc-linux-gnu
>  > --build=x86_64-pc-linux-gnu --disable-altivec --enable-nls
>  > --without-included-gettext --with-system-zlib --disable-checking
>  > --disable-werror --enable-secureplt --disable-libunwind-exceptions
>  > --enable-multilib --disable-libmudflap --disable-libssp
>  > --disable-libgcj --enable-shared --enable-threads=posix
>  > --enable-__cxa_atexit --enable-clocale=gnu
>  > (Note: some of these flags were copied from the Gentoo build, since I
>  > really didn't know what to use, the dr- prefix is just something so
>  > that the final binary doesn't shadow my production gcc)
>
> The build system thinks you're building a cross-compiler.  This is bad.
>

Why do you say that? Why do you say that the system thinks I'm
building a crosscompiler?
Probably this is due to the fact that in Gentoo intel core duo follow
the amd64 branch, since they are 64 bit processors...

> You need to get rid of some of the configure arguments.
>
>  ~/ ../gcc-4.1.1/configure --prefix=/home/pmatos/gcc-bin
>  --disable-altivec --enable-nls
>  --without-included-gettext --with-system-zlib
>  --disable-werror --enable-secureplt --disable-libunwind-exceptions
>  --enable-multilib --disable-libmudflap --disable-libssp
>  --disable-libgcj --enable-shared --enable-threads=posix
>  --enable-__cxa_atexit --enable-clocale=gnu
>
> ought to do it.
>

Exactly the same error:
checking for x86_64-unknown-linux-gnu-gcc...
/home/pmatos/gcc411-build/./gcc/xgcc
-B/home/pmatos/gcc411-build/./gcc/
-B/home/pmatos/gcc-bin/x86_64-unknown-linux-gnu/bin/
-B/home/pmatos/gcc-bin/x86_64-unknown-linux-gnu/lib/ -isystem
/home/pmatos/gcc-bin/x86_64-unknown-linux-gnu/include -isystem
/home/pmatos/gcc-bin/x86_64-unknown-linux-gnu/sys-include  -m32
checking for C compiler default output file name... a.out
checking whether the C compiler works... configure: error: cannot run
C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
make[1]: *** [configure-target-libstdc++-v3] Error 1
make[1]: Leaving directory `/home/pmatos/gcc411-build'
make: *** [all] Error 2

In config.log:
configure:2406: /home/pmatos/gcc411-build/./gcc/xgcc
-B/home/pmatos/gcc411-build/./gcc/ -B
/home/pmatos/gcc-bin/x86_64-unknown-linux-gnu/bin/
-B/home/pmatos/gcc-bin/x86_64-unknown-l
inux-gnu/lib/ -isystem
/home/pmatos/gcc-bin/x86_64-unknown-linux-gnu/include -isystem /hom
e/pmatos/gcc-bin/x86_64-unknown-linux-gnu/sys-include  -m32 -o
conftest -O2 -g -O2    conf
test.c  >&5
/usr/bin/ld: skipping incompatible /usr/lib/../lib/libc.so when
searching for -lc
/usr/bin/ld: skipping incompatible /usr/lib/../lib/libc.a when searching for -lc
/usr/bin/ld: warning: i386:x86-64 architecture of input file
`/usr/lib/../lib/crt1.o' is i
ncompatible with i386 output
/usr/bin/ld: warning: i386:x86-64 architecture of input file
`/usr/lib/../lib/crti.o' is i
ncompatible with i386 output
/usr/bin/ld: warning: i386:x86-64 architecture of input file
`/usr/lib/../lib/crtn.o' is i
ncompatible with i386 output
configure:2409: $? = 0
configure:2443: checking for C compiler default output file name
configure:2446: /home/pmatos/gcc411-build/./gcc/xgcc
-B/home/pmatos/gcc411-build/./gcc/ -B
/home/pmatos/gcc-bin/x86_64-unknown-linux-gnu/bin/
-B/home/pmatos/gcc-bin/x86_64-unknown-l
inux-gnu/lib/ -isystem
/home/pmatos/gcc-bin/x86_64-unknown-linux-gnu/include -isystem /hom
e/pmatos/gcc-bin/x86_64-unknown-linux-gnu/sys-include  -m32 -O2 -g -O2
   conftest.c  >&5
/usr/bin/ld: skipping incompatible /usr/lib/../lib/libc.so when
searching for -lc
/usr/bin/ld: skipping incompatible /usr/lib/../lib/libc.a when searching for -lc
/usr/bin/ld: warning: i386:x86-64 architecture of input file
`/usr/lib/../lib/crt1.o' is i
ncompatible with i386 output
/usr/bin/ld: warning: i386:x86-64 architecture of input file
`/usr/lib/../lib/crti.o' is i
ncompatible with i386 output
/usr/bin/ld: warning: i386:x86-64 architecture of input file
`/usr/lib/../lib/crtn.o' is i
ncompatible with i386 output
configure:2449: $? = 0
configure:2495: result: a.out
configure:2500: checking whether the C compiler works
configure:2506: ./a.out
../../../../gcc-4.1.1/libstdc++-v3/configure: line 2507:  6624
Segmentation fault      ./$
ac_file
configure:2509: $? = 139
configure:2518: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.

> Andrew.
>


Working gcc-4.1.1 compiler built by gentoo and working is:
$ gcc -v
Using built-in specs.
Target: x86_64-pc-linux-gnu
Configured with:
/var/tmp/portage/gcc-4.1.1-r1/work/gcc-4.1.1/configure --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.1.1
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.1.1
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.1.1/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.1.1/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/include/g++-v4
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu
--disable-altivec --enable-nls --without-included-gettext
--with-system-zlib --disable-checking --disable-werror
--enable-secureplt --disable-libunwind-exceptions --enable-multilib
--disable-libmudflap --disable-libssp --disable-libgcj
--enable-languages=c,c++,fortran --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
Thread model: posix
gcc version 4.1.1 (Gentoo 4.1.1-r1)


-- 
Paulo Jorge Matos - pocm at soton.ac.uk
http://www.personal.soton.ac.uk/pocm
PhD Student @ ECS
University of Southampton, UK

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Compiling GCC
  2007-01-31 10:27 Compiling GCC Paulo J. Matos
@ 2007-01-31 10:37 ` Andrew Haley
  2007-01-31 10:52   ` Paulo J. Matos
  0 siblings, 1 reply; 13+ messages in thread
From: Andrew Haley @ 2007-01-31 10:37 UTC (permalink / raw)
  To: Paulo J. Matos; +Cc: gcc-help

Paulo J. Matos writes:
 > Hello all,
 > 
 > I'm trying to compile gcc in my home dir, just to make some tests but
 > I've having some errors during compilation. Compilation is being
 > performed in an intel duo core. This is what I do:
 > ~/ tar -xvjf gcc-4.1.1.tar.bz2
 > ~/ mkdir gcc-build
 > ~/ cd gcc-build
 > ~/ ../gcc-4.1.1/configure --prefix=/home/pmatos/gcc-bin
 > --program-prefix=dr- --with-gnu-as --with-as=/usr/bin/as --with-gnu-ld
 > --with-ld=/usr/bin/ld --host=x86_64-pc-linux-gnu
 > --build=x86_64-pc-linux-gnu --disable-altivec --enable-nls
 > --without-included-gettext --with-system-zlib --disable-checking
 > --disable-werror --enable-secureplt --disable-libunwind-exceptions
 > --enable-multilib --disable-libmudflap --disable-libssp
 > --disable-libgcj --enable-shared --enable-threads=posix
 > --enable-__cxa_atexit --enable-clocale=gnu
 > (Note: some of these flags were copied from the Gentoo build, since I
 > really didn't know what to use, the dr- prefix is just something so
 > that the final binary doesn't shadow my production gcc)

The build system thinks you're building a cross-compiler.  This is bad.

You need to get rid of some of the configure arguments.

 ~/ ../gcc-4.1.1/configure --prefix=/home/pmatos/gcc-bin
 --disable-altivec --enable-nls
 --without-included-gettext --with-system-zlib 
 --disable-werror --enable-secureplt --disable-libunwind-exceptions
 --enable-multilib --disable-libmudflap --disable-libssp
 --disable-libgcj --enable-shared --enable-threads=posix
 --enable-__cxa_atexit --enable-clocale=gnu

ought to do it.

Andrew.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Compiling GCC
@ 2007-01-31 10:27 Paulo J. Matos
  2007-01-31 10:37 ` Andrew Haley
  0 siblings, 1 reply; 13+ messages in thread
From: Paulo J. Matos @ 2007-01-31 10:27 UTC (permalink / raw)
  To: gcc-help

Hello all,

I'm trying to compile gcc in my home dir, just to make some tests but
I've having some errors during compilation. Compilation is being
performed in an intel duo core. This is what I do:
~/ tar -xvjf gcc-4.1.1.tar.bz2
~/ mkdir gcc-build
~/ cd gcc-build
~/ ../gcc-4.1.1/configure --prefix=/home/pmatos/gcc-bin
--program-prefix=dr- --with-gnu-as --with-as=/usr/bin/as --with-gnu-ld
--with-ld=/usr/bin/ld --host=x86_64-pc-linux-gnu
--build=x86_64-pc-linux-gnu --disable-altivec --enable-nls
--without-included-gettext --with-system-zlib --disable-checking
--disable-werror --enable-secureplt --disable-libunwind-exceptions
--enable-multilib --disable-libmudflap --disable-libssp
--disable-libgcj --enable-shared --enable-threads=posix
--enable-__cxa_atexit --enable-clocale=gnu
(Note: some of these flags were copied from the Gentoo build, since I
really didn't know what to use, the dr- prefix is just something so
that the final binary doesn't shadow my production gcc)
~/ make -j 3

I get:
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for x86_64-pc-linux-gnu-gcc...
/home/pmatos/gcc411-build/./gcc/xgcc
-B/home/pmatos/gcc411-build/./gcc/
-B/home/pmatos/gcc-bin/x86_64-pc-linux-gnu/bin/
-B/home/pmatos/gcc-bin/x86_64-pc-linux-gnu/lib/ -isystem
/home/pmatos/gcc-bin/x86_64-pc-linux-gnu/include -isystem
/home/pmatos/gcc-bin/x86_64-pc-linux-gnu/sys-include  -m32
checking for C compiler default output file name... a.out
checking whether the C compiler works... configure: error: cannot run
C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
make[1]: *** [configure-target-libstdc++-v3] Error 1
make[1]: Leaving directory `/home/pmatos/gcc411-build'
make: *** [all] Error 2

the respective config.log is:
...
$ ../../../../gcc-4.1.1/libstdc++-v3/configure --with-multisubdir=32
--with-multisrctop=
 --enable-multilib --cache-file=./config.cache
--build=x86_64-pc-linux-gnu --host=x86_64-p
c-linux-gnu --target=x86_64-pc-linux-gnu --prefix=/home/pmatos/gcc-bin
--with-gnu-as --wit
h-as=/usr/bin/as --with-gnu-ld --with-ld=/usr/bin/ld --disable-altivec
--enable-nls --with
out-included-gettext --with-system-zlib --disable-checking
--disable-werror --enable-secur
eplt --disable-libunwind-exceptions --enable-multilib
--disable-libmudflap --disable-libss
p --disable-libgcj --enable-shared --enable-threads=posix
--enable-__cxa_atexit --enable-c
locale=gnu --enable-languages=c,c++,fortran,java,objc
--program-transform-name=s,^,dr-,;
--with-target-subdir=x86_64-pc-linux-gnu
--srcdir=../../../gcc-4.1.1/libstdc++-v3 CPPFLAGS
= build_alias=x86_64-pc-linux-gnu host_alias=x86_64-pc-linux-gnu
target_alias=x86_64-pc-li
nux-gnu -srcdir=../../../../gcc-4.1.1/libstdc++-v3
...
## --------- ##
## Platform. ##
## --------- ##

hostname = galileu
uname -m = x86_64
uname -r = 2.6.18-gentoo-r4
uname -s = Linux
uname -v = #1 SMP Wed Dec 13 12:08:32 GMT 2006

/usr/bin/uname -p = Intel(R) Pentium(R) D CPU 3.40GHz
/bin/uname -X     = unknown

/bin/arch              = x86_64
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
hostinfo               = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /usr/kde/3.5/bin
PATH: /usr/local/bin
PATH: /usr/bin
PATH: /bin
PATH: /opt/bin
PATH: /usr/x86_64-pc-linux-gnu/gcc-bin/4.1.1
PATH: /opt/blackdown-jdk-1.4.2.03/bin
PATH: /opt/blackdown-jdk-1.4.2.03/jre/bin
PATH: /usr/kde/3.5/bin
PATH: /usr/qt/3/bin
...
configure:2406: /home/pmatos/gcc411-build/./gcc/xgcc
-B/home/pmatos/gcc411-build/./gcc/ -B
/home/pmatos/gcc-bin/x86_64-pc-linux-gnu/bin/
-B/home/pmatos/gcc-bin/x86_64-pc-linux-gnu/l
ib/ -isystem /home/pmatos/gcc-bin/x86_64-pc-linux-gnu/include -isystem
/home/pmatos/gcc-bi
n/x86_64-pc-linux-gnu/sys-include  -m32 -o conftest -O2 -g -O2
conftest.c  >&5
/usr/bin/ld: skipping incompatible /usr/lib/../lib/libc.so when
searching for -lc
/usr/bin/ld: skipping incompatible /usr/lib/../lib/libc.a when searching for -lc
/usr/bin/ld: warning: i386:x86-64 architecture of input file
`/usr/lib/../lib/crt1.o' is i
ncompatible with i386 output
/usr/bin/ld: warning: i386:x86-64 architecture of input file
`/usr/lib/../lib/crti.o' is i
ncompatible with i386 output
/usr/bin/ld: warning: i386:x86-64 architecture of input file
`/usr/lib/../lib/crtn.o' is i
ncompatible with i386 output
configure:2409: $? = 0
configure:2443: checking for C compiler default output file name
configure:2446: /home/pmatos/gcc411-build/./gcc/xgcc
-B/home/pmatos/gcc411-build/./gcc/ -B
/home/pmatos/gcc-bin/x86_64-pc-linux-gnu/bin/
-B/home/pmatos/gcc-bin/x86_64-pc-linux-gnu/l
ib/ -isystem /home/pmatos/gcc-bin/x86_64-pc-linux-gnu/include -isystem
/home/pmatos/gcc-bi
n/x86_64-pc-linux-gnu/sys-include  -m32 -O2 -g -O2    conftest.c  >&5
/usr/bin/ld: skipping incompatible /usr/lib/../lib/libc.so when
searching for -lc
/usr/bin/ld: skipping incompatible /usr/lib/../lib/libc.a when searching for -lc
/usr/bin/ld: warning: i386:x86-64 architecture of input file
`/usr/lib/../lib/crt1.o' is i
ncompatible with i386 output
/usr/bin/ld: warning: i386:x86-64 architecture of input file
`/usr/lib/../lib/crti.o' is i
ncompatible with i386 output
/usr/bin/ld: warning: i386:x86-64 architecture of input file
`/usr/lib/../lib/crtn.o' is i
ncompatible with i386 output
configure:2449: $? = 0
configure:2495: result: a.out
configure:2500: checking whether the C compiler works
configure:2506: ./a.out
../../../../gcc-4.1.1/libstdc++-v3/configure: line 2507:   610
Segmentation fault      ./$
ac_file
configure:2509: $? = 139
configure:2518: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.


Any ideas of what might be the problem? I can't even start to guess
why the seg fault ocorred.

Cheers,
-- 
Paulo Jorge Matos - pocm at soton.ac.uk
http://www.personal.soton.ac.uk/pocm
PhD Student @ ECS
University of Southampton, UK

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2012-02-24 10:42 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-11  9:38 compiling gcc ryan p bobko
2001-01-11 10:38 ` Alexandre Oliva
2007-01-31 10:27 Compiling GCC Paulo J. Matos
2007-01-31 10:37 ` Andrew Haley
2007-01-31 10:52   ` Paulo J. Matos
2007-01-31 11:04     ` Andrew Haley
2007-01-31 11:21     ` Kai Ruottu
2007-01-31 11:26       ` Andrew Haley
2007-01-31 12:53         ` Kai Ruottu
2007-01-31 11:38     ` Kai Ruottu
2012-02-24  5:30 Compiling gcc Me Myself and I
2012-02-24  9:05 ` Jonathan Wakely
2012-02-24 10:42 ` Bryce McKinlay

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).