public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Fwd: cross compiling gcc for i686 target
       [not found] <CAKhyrx_farUmLu5FVac5_1bepqhAdb_HHy2ngRucs2+V3xfd1g@mail.gmail.com>
@ 2013-03-01 17:39 ` vijay nag
  2013-03-01 18:28   ` Ian Lance Taylor
  0 siblings, 1 reply; 5+ messages in thread
From: vijay nag @ 2013-03-01 17:39 UTC (permalink / raw)
  To: gcc-help

Hi,

Is it possible to do a cross compile of gcc-4.7.2 on AMD x86_64 to
produce i686 target ?

My build, host and target parameters are amd64-pc-linux-gnu,
amd64-pc-linux-gnu and i686-pc-linux-gnu. My native compiler again is
a 64 bit compiler emitting default 64 bit object code.

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

* Re: cross compiling gcc for i686 target
  2013-03-01 17:39 ` Fwd: cross compiling gcc for i686 target vijay nag
@ 2013-03-01 18:28   ` Ian Lance Taylor
  2013-03-01 20:01     ` Tim Prince
  2013-03-02  7:45     ` vijay nag
  0 siblings, 2 replies; 5+ messages in thread
From: Ian Lance Taylor @ 2013-03-01 18:28 UTC (permalink / raw)
  To: vijay nag; +Cc: gcc-help

On Fri, Mar 1, 2013 at 9:39 AM, vijay nag <vijunag@gmail.com> wrote:
>
> Is it possible to do a cross compile of gcc-4.7.2 on AMD x86_64 to
> produce i686 target ?
>
> My build, host and target parameters are amd64-pc-linux-gnu,
> amd64-pc-linux-gnu and i686-pc-linux-gnu. My native compiler again is
> a 64 bit compiler emitting default 64 bit object code.

Yes, it is possible.

It is also usually unnecessary.  A typical x86_64 compiler
installation will produce 32-bit x86 code with the -m32 option.

Ian

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

* Re: cross compiling gcc for i686 target
  2013-03-01 18:28   ` Ian Lance Taylor
@ 2013-03-01 20:01     ` Tim Prince
  2013-03-02  7:45     ` vijay nag
  1 sibling, 0 replies; 5+ messages in thread
From: Tim Prince @ 2013-03-01 20:01 UTC (permalink / raw)
  To: gcc-help

On 03/01/2013 01:28 PM, Ian Lance Taylor wrote:
> On Fri, Mar 1, 2013 at 9:39 AM, vijay nag <vijunag@gmail.com> wrote:
>> Is it possible to do a cross compile of gcc-4.7.2 on AMD x86_64 to
>> produce i686 target ?
>>
>> My build, host and target parameters are amd64-pc-linux-gnu,
>> amd64-pc-linux-gnu and i686-pc-linux-gnu. My native compiler again is
>> a 64 bit compiler emitting default 64 bit object code.
> Yes, it is possible.
>
> It is also usually unnecessary.  A typical x86_64 compiler
> installation will produce 32-bit x86 code with the -m32 option.
>
> Ian
That switches you over to a 32-bit compiler, taking advantage of the 
support of 32-bit execution under this OS.  In many current x86_64 
installations, the 32-bit compiler is an additional option requiring the 
primary gcc development system option.

-- 
Tim Prince

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

* Re: cross compiling gcc for i686 target
  2013-03-01 18:28   ` Ian Lance Taylor
  2013-03-01 20:01     ` Tim Prince
@ 2013-03-02  7:45     ` vijay nag
  2013-03-04 15:14       ` vijay nag
  1 sibling, 1 reply; 5+ messages in thread
From: vijay nag @ 2013-03-02  7:45 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-help

I tried to build with host,build = amd64-pc-linux-gnu and
target=i686-pc-linux-gnu.  Binutils compile successfully for
i686-pc-linux-gnu target , but when native compiler tries to invoke
"i686-pc-linux-gn-as" which by default emits 32 bit code i see the
following errors.

gcc -c   -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall
-Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes
-Wmissing-format-attribute -Wold-style-definition -Wc++-compat
-DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibuild -I../../../gcc/gcc
-I../../../gcc/gcc/build -I../../../gcc/gcc/../include
-I../../../gcc/gcc/../libcpp/include
-I/localdisk/vinag/tmp/sbtools.tmp.201302221200/sbtools/systemsw/tools/src/objdir_201302221200_linux-x86/gcc_stage1/./gmp
-I/localdisk/vinag/tmp/sbtools.tmp.201302221200/sbtools/systemsw/tools/src/gcc/gmp
-I/localdisk/vinag/tmp/sbtools.tmp.201302221200/sbtools/systemsw/tools/src/objdir_201302221200_linux-x86/gcc_stage1/./mpfr
-I/localdiskvinag/tmp/sbtools.tmp.201302221200/sbtools/systemsw/tools/src/gcc/mpfr
-I/localdisk/vinag/tmp/sbtools.tmp.201302221200/sbtools/systemsw/tools/src/gcc/mpc/src
 -I../../../gcc/gcc/../libdecnumber
-I../../../gcc/gcc/../libdecnumber/bid -I../libdecnumber    \
                -DBASEVER="\"4.7.2\"" -DDATESTAMP="\"\"" \
                -DREVISION="\"\"" \
                -DDEVPHASE="\"\"" -DPKGVERSION="\"(GCC) \"" \
                -DBUGURL="\"<http://gcc.gnu.org/bugs.html>\"" -o
build/version.o ../../../gcc/gcc/version.c
/tmp/ccAlfevC.s: Assembler messages:
/tmp/ccAlfevC.s:37: Error: cannot represent relocation type BFD_RELOC_64
/tmp/ccAlfevC.s:38: Error: cannot represent relocation type BFD_RELOC_64
/tmp/ccAlfevC.s:66: Error: cannot represent relocation type BFD_RELOC_64
/tmp/ccAlfevC.s:84: Error: cannot represent relocation type BFD_RELOC_64
/tmp/ccAlfevC.s:102: Error: cannot represent relocation type BFD_RELOC_64
make[2]: *** [build/version.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/bin/sh ../../../gcc/gcc/../move-if-change tmp-optionlist optionlist
echo timestamp > s-options
make[2]: *** wait: No child processes.  Stop.
make[1]: *** [all-gcc] Error 2

exporting CFLAGS='-m64'  I could go past this point. It bails out in
the next stage of compilation when the target compiler is used with
-m64 option with the error "cc1plus: sorry, unimplemented: 64-bit mode
not compiled in"

On Fri, Mar 1, 2013 at 11:58 PM, Ian Lance Taylor <iant@google.com> wrote:
> On Fri, Mar 1, 2013 at 9:39 AM, vijay nag <vijunag@gmail.com> wrote:
>>
>> Is it possible to do a cross compile of gcc-4.7.2 on AMD x86_64 to
>> produce i686 target ?
>>
>> My build, host and target parameters are amd64-pc-linux-gnu,
>> amd64-pc-linux-gnu and i686-pc-linux-gnu. My native compiler again is
>> a 64 bit compiler emitting default 64 bit object code.
>
> Yes, it is possible.
>
> It is also usually unnecessary.  A typical x86_64 compiler
> installation will produce 32-bit x86 code with the -m32 option.
>
> Ian

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

* Re: cross compiling gcc for i686 target
  2013-03-02  7:45     ` vijay nag
@ 2013-03-04 15:14       ` vijay nag
  0 siblings, 0 replies; 5+ messages in thread
From: vijay nag @ 2013-03-04 15:14 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-help

Will cross compile of gcc create xgcc by any chance ?  xgcc is trying
to make references to the target specific libraries like libcrt, libc,
et al while compiling libstdc++-v3.

Tail of my config logs.
configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES”
configure:3885:
/auto/nobackup-bgl-mitg-dev13/vinag/tmpv/sbtools.tmp.201302221200/sbtools/systemsw/tools/src/objdir_201302221200_linux-x86/gcc_stage1/./gcc/xgcc
-B/auto/nobackup-bgl-mitg-dev13/vinag/tmpv/sbtools.tmp.201302221200/sbtools/systemsw/tools/src/objdir_201302221200_linux-x86/gcc_stage1/./gcc/
-B/ws/vinag-bgl/tools/bintools/linux-x86/gcc/201302221200/i686-pc-linux-gnu/bin/
-B/ws/vinag-bgl/tools/bintools/linux-x86/gcc/201302221200/i686-pc-linux-gnu/lib/
-isystem /ws/vinag-bgl/tools/bintools/linux-x86/gcc/201302221200/i686-pc-linux-gnu/include
-isystem /ws/vinag-bgl/tools/bintools/linux-x86/gcc/201302221200/i686-pc-linux-gnu/sys-include
   -o conftest -m32    conftest.c  >&5
/ws/vinag-bgl/tools/bintools/linux-x86/gcc/201302221200/i686-pc-linux-gnu/bin/ld:
cannot find crt1.o: No such file or directory
/ws/vinag-bgl/tools/bintools/linux-x86/gcc/201302221200/i686-pc-linux-gnu/bin/ld:
cannot find crti.o: No such file or directory
/ws/vinag-bgl/tools/bintools/linux-x86/gcc/201302221200/i686-pc-linux-gnu/bin/ld:
cannot find -lc
/ws/vinag-bgl/tools/bintools/linux-x86/gcc/201302221200/i686-pc-linux-gnu/bin/ld:
cannot find crtn.o: No such file or directory

Why is this error ?
On Sat, Mar 2, 2013 at 1:15 PM, vijay nag <vijunag@gmail.com> wrote:
> I tried to build with host,build = amd64-pc-linux-gnu and
> target=i686-pc-linux-gnu.  Binutils compile successfully for
> i686-pc-linux-gnu target , but when native compiler tries to invoke
> "i686-pc-linux-gn-as" which by default emits 32 bit code i see the
> following errors.
>
> gcc -c   -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall
> -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes
> -Wmissing-format-attribute -Wold-style-definition -Wc++-compat
> -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibuild -I../../../gcc/gcc
> -I../../../gcc/gcc/build -I../../../gcc/gcc/../include
> -I../../../gcc/gcc/../libcpp/include
> -I/localdisk/vinag/tmp/sbtools.tmp.201302221200/sbtools/systemsw/tools/src/objdir_201302221200_linux-x86/gcc_stage1/./gmp
> -I/localdisk/vinag/tmp/sbtools.tmp.201302221200/sbtools/systemsw/tools/src/gcc/gmp
> -I/localdisk/vinag/tmp/sbtools.tmp.201302221200/sbtools/systemsw/tools/src/objdir_201302221200_linux-x86/gcc_stage1/./mpfr
> -I/localdiskvinag/tmp/sbtools.tmp.201302221200/sbtools/systemsw/tools/src/gcc/mpfr
> -I/localdisk/vinag/tmp/sbtools.tmp.201302221200/sbtools/systemsw/tools/src/gcc/mpc/src
>  -I../../../gcc/gcc/../libdecnumber
> -I../../../gcc/gcc/../libdecnumber/bid -I../libdecnumber    \
>                 -DBASEVER="\"4.7.2\"" -DDATESTAMP="\"\"" \
>                 -DREVISION="\"\"" \
>                 -DDEVPHASE="\"\"" -DPKGVERSION="\"(GCC) \"" \
>                 -DBUGURL="\"<http://gcc.gnu.org/bugs.html>\"" -o
> build/version.o ../../../gcc/gcc/version.c
> /tmp/ccAlfevC.s: Assembler messages:
> /tmp/ccAlfevC.s:37: Error: cannot represent relocation type BFD_RELOC_64
> /tmp/ccAlfevC.s:38: Error: cannot represent relocation type BFD_RELOC_64
> /tmp/ccAlfevC.s:66: Error: cannot represent relocation type BFD_RELOC_64
> /tmp/ccAlfevC.s:84: Error: cannot represent relocation type BFD_RELOC_64
> /tmp/ccAlfevC.s:102: Error: cannot represent relocation type BFD_RELOC_64
> make[2]: *** [build/version.o] Error 1
> make[2]: *** Waiting for unfinished jobs....
> /bin/sh ../../../gcc/gcc/../move-if-change tmp-optionlist optionlist
> echo timestamp > s-options
> make[2]: *** wait: No child processes.  Stop.
> make[1]: *** [all-gcc] Error 2
>
> exporting CFLAGS='-m64'  I could go past this point. It bails out in
> the next stage of compilation when the target compiler is used with
> -m64 option with the error "cc1plus: sorry, unimplemented: 64-bit mode
> not compiled in"
>
> On Fri, Mar 1, 2013 at 11:58 PM, Ian Lance Taylor <iant@google.com> wrote:
>> On Fri, Mar 1, 2013 at 9:39 AM, vijay nag <vijunag@gmail.com> wrote:
>>>
>>> Is it possible to do a cross compile of gcc-4.7.2 on AMD x86_64 to
>>> produce i686 target ?
>>>
>>> My build, host and target parameters are amd64-pc-linux-gnu,
>>> amd64-pc-linux-gnu and i686-pc-linux-gnu. My native compiler again is
>>> a 64 bit compiler emitting default 64 bit object code.
>>
>> Yes, it is possible.
>>
>> It is also usually unnecessary.  A typical x86_64 compiler
>> installation will produce 32-bit x86 code with the -m32 option.
>>
>> Ian

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

end of thread, other threads:[~2013-03-04 15:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAKhyrx_farUmLu5FVac5_1bepqhAdb_HHy2ngRucs2+V3xfd1g@mail.gmail.com>
2013-03-01 17:39 ` Fwd: cross compiling gcc for i686 target vijay nag
2013-03-01 18:28   ` Ian Lance Taylor
2013-03-01 20:01     ` Tim Prince
2013-03-02  7:45     ` vijay nag
2013-03-04 15:14       ` vijay nag

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