public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* building 686->ppc-linux cross compiler with mainline.
@ 2001-06-05  4:17 Rob Taylor
  2001-06-05  9:56 ` Geoff Keating
  0 siblings, 1 reply; 7+ messages in thread
From: Rob Taylor @ 2001-06-05  4:17 UTC (permalink / raw)
  To: Gcc@Gcc. Gnu. Org

I'm currently building a 686->ppc-linux cross compiler with the mainline current
snapshot.
problems I've hit so far:
the ppc build seems to build two types of crt objects , scrt?.o for SVR4 systems
and ecrt?.o for EABI systems. STARTFILE_LINUX and ENDFILE_LINUX are defined like
so:

  #define STARTFILE_LINUX_SPEC "\
  %{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}} \
  %{mnewlib: ecrti.o%s} %{!mnewlib: crti.o%s} \
  %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"

  #define ENDFILE_LINUX_SPEC "%{!shared:crtend.o%s} %{shared:crtendS.o%s} \
  %{mnewlib: ecrtn.o%s} %{!mnewlib: crtn.o%s}"

Am i correct in thinking that these should be defined like this under this
scheme:
(note, currently no crt?.o files get built)

  #define STARTFILE_LINUX_SPEC "\
  %{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:scrt1.o%s}}} \
  %{mnewlib: ecrti.o%s} %{!mnewlib: scrti.o%s} \
  %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"

  #define ENDFILE_LINUX_SPEC "%{!shared:crtend.o%s} %{shared:crtendS.o%s} \
  %{mnewlib: ecrtn.o%s} %{!mnewlib: scrtn.o%s}"

Problem no.2 i've hit is that the xgcc generated is configured to run 'as'
rather than 'pcc-linux-as' - can anyone tell me how the choice of assembler is
configured?


Thanks to anyone who can help me :)

Rob Taylor

"Dream as if you'll live forever, live as if you'll die today."

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

* Re: building 686->ppc-linux cross compiler with mainline.
  2001-06-05  4:17 building 686->ppc-linux cross compiler with mainline Rob Taylor
@ 2001-06-05  9:56 ` Geoff Keating
  2001-06-05 10:39   ` Rob Taylor
  0 siblings, 1 reply; 7+ messages in thread
From: Geoff Keating @ 2001-06-05  9:56 UTC (permalink / raw)
  To: Rob Taylor; +Cc: gcc

"Rob Taylor" <robt@flyingpig.com> writes:

> I'm currently building a 686->ppc-linux cross compiler with the mainline current
> snapshot.
> problems I've hit so far:
> the ppc build seems to build two types of crt objects , scrt?.o for SVR4 systems
> and ecrt?.o for EABI systems. STARTFILE_LINUX and ENDFILE_LINUX are defined like
> so:
> 
>   #define STARTFILE_LINUX_SPEC "\
>   %{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}} \
>   %{mnewlib: ecrti.o%s} %{!mnewlib: crti.o%s} \
>   %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
> 
>   #define ENDFILE_LINUX_SPEC "%{!shared:crtend.o%s} %{shared:crtendS.o%s} \
>   %{mnewlib: ecrtn.o%s} %{!mnewlib: crtn.o%s}"
> 
> Am i correct in thinking that these should be defined like this under this
> scheme:
> (note, currently no crt?.o files get built)
> 
>   #define STARTFILE_LINUX_SPEC "\
>   %{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:scrt1.o%s}}} \
>   %{mnewlib: ecrti.o%s} %{!mnewlib: scrti.o%s} \
>   %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
> 
>   #define ENDFILE_LINUX_SPEC "%{!shared:crtend.o%s} %{shared:crtendS.o%s} \
>   %{mnewlib: ecrtn.o%s} %{!mnewlib: scrtn.o%s}"

These are for Linux using newlib.  The definitions for linux using
glibc are in linux.h.

> Problem no.2 i've hit is that the xgcc generated is configured to run 'as'
> rather than 'pcc-linux-as' - can anyone tell me how the choice of assembler is
> configured?

This doesn't happen to me.  If you specify --target=ppc-linux it
should run ppc-linux-as.

-- 
- Geoffrey Keating <geoffk@geoffk.org>

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

* RE: building 686->ppc-linux cross compiler with mainline.
  2001-06-05  9:56 ` Geoff Keating
@ 2001-06-05 10:39   ` Rob Taylor
  2001-06-05 11:41     ` Geoff Keating
  0 siblings, 1 reply; 7+ messages in thread
From: Rob Taylor @ 2001-06-05 10:39 UTC (permalink / raw)
  To: Geoff Keating; +Cc: Gcc@Gcc. Gnu. Org

>
> "Rob Taylor" <robt@flyingpig.com> writes:
>
> > I'm currently building a 686->ppc-linux cross compiler with the
> mainline current
> > snapshot.
> > problems I've hit so far:
> > the ppc build seems to build two types of crt objects , scrt?.o for
> SVR4 systems
> > and ecrt?.o for EABI systems. STARTFILE_LINUX and ENDFILE_LINUX are
> defined like
> > so:
> >
> >   #define STARTFILE_LINUX_SPEC "\
> >   %{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}} \
> >   %{mnewlib: ecrti.o%s} %{!mnewlib: crti.o%s} \
> >   %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
> >
> >   #define ENDFILE_LINUX_SPEC "%{!shared:crtend.o%s} %{shared:crtendS.o%s} \
> >   %{mnewlib: ecrtn.o%s} %{!mnewlib: crtn.o%s}"
> >
> > Am i correct in thinking that these should be defined like this under this
> > scheme:
> > (note, currently no crt?.o files get built)
> >
> >   #define STARTFILE_LINUX_SPEC "\
> >   %{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:scrt1.o%s}}} \
> >   %{mnewlib: ecrti.o%s} %{!mnewlib: scrti.o%s} \
> >   %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
> >
> >   #define ENDFILE_LINUX_SPEC "%{!shared:crtend.o%s} %{shared:crtendS.o%s} \
> >   %{mnewlib: ecrtn.o%s} %{!mnewlib: scrtn.o%s}"
>
> These are for Linux using newlib.  The definitions for linux using
> glibc are in linux.h.

hmm.. i'm configuring with
/usr/local/src/cvssrc/gcc/configure --prefix=/usr/local/gcc-i686-to-ppc/gcc-
686-ppc --target=ppc-linux --host=i686-pc-linux --enable-shared --enable-thr
eads=posix --enable-libstdcxx-v3 --enable-namespaces --enable-long-long --wi
th-headers=/usr/local/gcc-i686-to-ppc/ppc-linux/include/  --with-libs="/usr/
local/gcc-i686-to-ppc/ppc-linux/lib/" --disable-multilib --enable-languages=
c,c++ --disable-libgcj

(...had to work around a few things in the final rekoning..)

and it's *definitly* using those defines - I eventually changed them to

#define STARTFILE_LINUX_SPEC "\
%{!shared: %{pg:gcrt0.o%s} %{!pg:%{p:gcrt0.o%s} %{!p:scrt0.o%s}}}  \
%{mnewlib: ecrti.o%s} %{!mnewlib: scrti.o%s} \
%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"

#define ENDFILE_LINUX_SPEC "%{!shared:crtend.o%s} %{shared:crtendS.o%s} \
%{mnewlib: ecrtn.o%s} %{!mnewlib: scrtn.o%s}"

- i know for certain it's using these defines, as when i change them, my
startfile_linux:/ endfile_linux: instructions in my specs change. looking at
config/rs6000/linux.h, no STARTFILE macros are defined there.

> > Problem no.2 i've hit is that the xgcc generated is configured to run 'as'
> > rather than 'pcc-linux-as' - can anyone tell me how the choice of
> assembler is
> > configured?
>
> This doesn't happen to me.  If you specify --target=ppc-linux it
> should run ppc-linux-as.
>
well, as you can see, I'm using --target=ppc-linux and it's not running though -
can you tell me where this information should be being passed into the xgcc
build (header? define?) and i can look there and debug the build process..

attached is the diffs i had to make to get a cross gcc from i686-pc-linux to
ppc-linux, starting from that snapshot of 20010528.

Thanks,
Rob Taylor

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

* Re: building 686->ppc-linux cross compiler with mainline.
  2001-06-05 10:39   ` Rob Taylor
@ 2001-06-05 11:41     ` Geoff Keating
  2001-06-05 13:03       ` Rob Taylor
  0 siblings, 1 reply; 7+ messages in thread
From: Geoff Keating @ 2001-06-05 11:41 UTC (permalink / raw)
  To: robt; +Cc: gcc

> From: "Rob Taylor" <robt@flyingpig.com>
> Cc: "Gcc@Gcc. Gnu. Org" <gcc@gcc.gnu.org>
> Date: Tue, 5 Jun 2001 18:58:30 +0100

> #define STARTFILE_LINUX_SPEC "\
> %{!shared: %{pg:gcrt0.o%s} %{!pg:%{p:gcrt0.o%s} %{!p:scrt0.o%s}}}  \
> %{mnewlib: ecrti.o%s} %{!mnewlib: scrti.o%s} \
> %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
> 
> #define ENDFILE_LINUX_SPEC "%{!shared:crtend.o%s} %{shared:crtendS.o%s} \
> %{mnewlib: ecrtn.o%s} %{!mnewlib: scrtn.o%s}"

The scrt* files are for Solaris.  You do not want to try using them
for linux, for various reasons not least that Solaris was
little-endian but linux is big-endian.

The files you want to use are really called 'crt1.o', 'crti.o', and
'crtn.o'.  They come from glibc, they are not built as part of gcc.

> - i know for certain it's using these defines, as when i change them, my
> startfile_linux:/ endfile_linux: instructions in my specs change. looking at
> config/rs6000/linux.h, no STARTFILE macros are defined there.

Oh, sorry.  Yes, I forgot that we fixed that.

> > > Problem no.2 i've hit is that the xgcc generated is configured to run 'as'
> > > rather than 'pcc-linux-as' - can anyone tell me how the choice of
> > assembler is
> > > configured?
> >
> > This doesn't happen to me.  If you specify --target=ppc-linux it
> > should run ppc-linux-as.
> >
> well, as you can see, I'm using --target=ppc-linux and it's not running though -
> can you tell me where this information should be being passed into the xgcc
> build (header? define?) and i can look there and debug the build process..

The routine that does this is find_a_file in gcc.c; it's the code
under the comment

	/* Certain prefixes are tried with just the machine type,
	   not the version.  This is used for finding as, ld, etc.  */

I would first try running

ppc-linux-gcc --print-prog-name=as

-- 
- Geoffrey Keating <geoffk@geoffk.org>

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

* RE: building 686->ppc-linux cross compiler with mainline.
  2001-06-05 11:41     ` Geoff Keating
@ 2001-06-05 13:03       ` Rob Taylor
  2001-06-05 15:12         ` Geoff Keating
  0 siblings, 1 reply; 7+ messages in thread
From: Rob Taylor @ 2001-06-05 13:03 UTC (permalink / raw)
  To: Geoff Keating; +Cc: Gcc@Gcc. Gnu. Org

>
> > #define STARTFILE_LINUX_SPEC "\
> > %{!shared: %{pg:gcrt0.o%s} %{!pg:%{p:gcrt0.o%s} %{!p:scrt0.o%s}}}  \
> > %{mnewlib: ecrti.o%s} %{!mnewlib: scrti.o%s} \
> > %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
> >
> > #define ENDFILE_LINUX_SPEC "%{!shared:crtend.o%s} %{shared:crtendS.o%s} \
> > %{mnewlib: ecrtn.o%s} %{!mnewlib: scrtn.o%s}"
>
> The scrt* files are for Solaris.  You do not want to try using them
> for linux, for various reasons not least that Solaris was
> little-endian but linux is big-endian.
>
> The files you want to use are really called 'crt1.o', 'crti.o', and
> 'crtn.o'.  They come from glibc, they are not built as part of gcc.

right. somewhere it may be good to comment that this must be in the libs include
with --with-libs. Who should I talk to about adding stuff to documentation?

> > well, as you can see, I'm using --target=ppc-linux and it's not
> running though -
> > can you tell me where this information should be being passed into the xgcc
> > build (header? define?) and i can look there and debug the build process..
>
> The routine that does this is find_a_file in gcc.c; it's the code
> under the comment
>
> 	/* Certain prefixes are tried with just the machine type,
> 	   not the version.  This is used for finding as, ld, etc.  */
>
> I would first try running
>
> ppc-linux-gcc --print-prog-name=as

calling this on my final executable (I'm currently building by modifying the
specs file manually halfway though the build process) returns 'as'

I've just stepped though the code..
the exec_prefixes I'm seeing contains:
"/usr/local/gcc-i686-to-ppc/gcc-28052001/gcc/./../lib/gcc-lib/"
"/usr/local/gcc-i686-to-ppc/gcc-686-ppc/lib/gcc-lib/"
"/usr/local/gcc-i686-to-ppc/gcc-686-ppc/lib/gcc-lib/"
"/usr/lib/gcc/"
"/usr/local/gcc-i686-to-ppc/gcc-28052001/gcc/./../lib/gcc-lib/ppc
-linux/3.0/../../../../ppc-linux/bin/"
"/usr/local/gcc-i686-to-ppc/gcc-686-ppc/lib/gcc-lib/ppc-linux/3.0
/../../../../ppc-linux/bin/"

/usr/local/gcc-i686-to-ppc/gcc-28052001 is my build dir
/usr/local/gcc-i686-to-ppc/gcc-686-ppc is my prefix

it appears that i should be installing binutils with the same prefix as gcc. If
I wished to install binutils to a different prefix to gcc, how would i go about
adding a new search prefix into exec_prefix?


Thanks,

Rob Taylor

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

* Re: building 686->ppc-linux cross compiler with mainline.
  2001-06-05 13:03       ` Rob Taylor
@ 2001-06-05 15:12         ` Geoff Keating
  0 siblings, 0 replies; 7+ messages in thread
From: Geoff Keating @ 2001-06-05 15:12 UTC (permalink / raw)
  To: robt; +Cc: gcc

> From: "Rob Taylor" <robt@flyingpig.com>
> Cc: "Gcc@Gcc. Gnu. Org" <gcc@gcc.gnu.org>
> Date: Tue, 5 Jun 2001 21:22:34 +0100
> X-Priority: 3 (Normal)
> X-MSMail-Priority: Normal
> Importance: Normal
> X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211
> X-Server: VPOP3 V1.3.0c - Registered to: Flying Pig Systems Ltd
> 
> >
> > > #define STARTFILE_LINUX_SPEC "\
> > > %{!shared: %{pg:gcrt0.o%s} %{!pg:%{p:gcrt0.o%s} %{!p:scrt0.o%s}}}  \
> > > %{mnewlib: ecrti.o%s} %{!mnewlib: scrti.o%s} \
> > > %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
> > >
> > > #define ENDFILE_LINUX_SPEC "%{!shared:crtend.o%s} %{shared:crtendS.o%s} \
> > > %{mnewlib: ecrtn.o%s} %{!mnewlib: scrtn.o%s}"
> >
> > The scrt* files are for Solaris.  You do not want to try using them
> > for linux, for various reasons not least that Solaris was
> > little-endian but linux is big-endian.
> >
> > The files you want to use are really called 'crt1.o', 'crti.o', and
> > 'crtn.o'.  They come from glibc, they are not built as part of gcc.
> 
> right. somewhere it may be good to comment that this must be in the libs include
> with --with-libs. Who should I talk to about adding stuff to documentation?
> 
> > > well, as you can see, I'm using --target=ppc-linux and it's not
> > running though -
> > > can you tell me where this information should be being passed into the xgcc
> > > build (header? define?) and i can look there and debug the build process..
> >
> > The routine that does this is find_a_file in gcc.c; it's the code
> > under the comment
> >
> > 	/* Certain prefixes are tried with just the machine type,
> > 	   not the version.  This is used for finding as, ld, etc.  */
> >
> > I would first try running
> >
> > ppc-linux-gcc --print-prog-name=as
> 
> calling this on my final executable (I'm currently building by modifying the
> specs file manually halfway though the build process) returns 'as'
> 
> I've just stepped though the code..
> the exec_prefixes I'm seeing contains:
> "/usr/local/gcc-i686-to-ppc/gcc-28052001/gcc/./../lib/gcc-lib/"
> "/usr/local/gcc-i686-to-ppc/gcc-686-ppc/lib/gcc-lib/"
> "/usr/local/gcc-i686-to-ppc/gcc-686-ppc/lib/gcc-lib/"
> "/usr/lib/gcc/"
> "/usr/local/gcc-i686-to-ppc/gcc-28052001/gcc/./../lib/gcc-lib/ppc
> -linux/3.0/../../../../ppc-linux/bin/"
> "/usr/local/gcc-i686-to-ppc/gcc-686-ppc/lib/gcc-lib/ppc-linux/3.0
> /../../../../ppc-linux/bin/"
> 
> /usr/local/gcc-i686-to-ppc/gcc-28052001 is my build dir
> /usr/local/gcc-i686-to-ppc/gcc-686-ppc is my prefix
> 
> it appears that i should be installing binutils with the same prefix as gcc. If
> I wished to install binutils to a different prefix to gcc, how would i go about
> adding a new search prefix into exec_prefix?

I don't think you can.  You can specify --with-as=/path/to/as
and similarly --with-ld, though.

-- 
- Geoffrey Keating <geoffk@geoffk.org>

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

* Re: building 686->ppc-linux cross compiler with mainline.
@ 2001-06-05  5:33 Rob Taylor
  0 siblings, 0 replies; 7+ messages in thread
From: Rob Taylor @ 2001-06-05  5:33 UTC (permalink / raw)
  To: Gcc@Gcc. Gnu. Org

> 
> I'm currently building a 686->ppc-linux cross compiler with the 
> mainline current
> snapshot.
> problems I've hit so far:
> the ppc build seems to build two types of crt objects , scrt?.o for 
> SVR4 systems
> and ecrt?.o for EABI systems. STARTFILE_LINUX and ENDFILE_LINUX are 
> defined like
> so:
> 
>   #define STARTFILE_LINUX_SPEC "\
>   %{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}} \
>   %{mnewlib: ecrti.o%s} %{!mnewlib: crti.o%s} \
>   %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
> 
>   #define ENDFILE_LINUX_SPEC "%{!shared:crtend.o%s} %{shared:crtendS.o%s} \
>   %{mnewlib: ecrtn.o%s} %{!mnewlib: crtn.o%s}"

Also, can anyone tell me what happened to crt1 for powerpc SVR4?

Thanks,
Rob Taylor

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

end of thread, other threads:[~2001-06-05 15:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-05  4:17 building 686->ppc-linux cross compiler with mainline Rob Taylor
2001-06-05  9:56 ` Geoff Keating
2001-06-05 10:39   ` Rob Taylor
2001-06-05 11:41     ` Geoff Keating
2001-06-05 13:03       ` Rob Taylor
2001-06-05 15:12         ` Geoff Keating
2001-06-05  5:33 Rob Taylor

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