This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Question about building binutils as cross-compiler for multiple targets


2008/11/29 NightStrike <nightstrike@gmail.com>:
> On Sat, Nov 29, 2008 at 3:05 AM, Nick Clifton <nickc@redhat.com> wrote:
>>
>> Hi Kai, Hi NightStrike,
>>
>>> $ ../configure --target=x86_64-pc-mingw32
>>> --enable-targets=x86_64-pc-mingw32,i686-pc-mingw32 --enable-multilib
>>> --disable-nls --prefix=/home/ktietz/multiroot
>>> --with-sysroot=/home/ktietz/multiroot --enable-64-bit-bfd'
>>
>> Note: I would suggest dropping the "--target=x86_64-pc-mingw32".
>
> Why?
>
>>> The attached patch is what Kai has so far.  The current roadblock is in ld:
>>>
>>> root-x86_64-pc-linux/x86_64-pc-mingw32/bin/ld: unrecognised emulation
>>> mode: pe-i386
>>> Supported emulations: i386pep i386pe
>>
>> How do I reproduce this roadblock ?
>>
>> For the record the toolchain that I built today, configured as above, except without the --target switch, reports:
>>
>>  .../bin/ld: supported targets: elf32-i386 a.out-i386-linux efi-app-ia32 efi-bsdrv-ia32 efi-rtdrv-ia32 elf64-x86-64 elf64-little elf64-big elf32-little elf32-big pe-x86-64 pei-x86-64 pe-i386 pei-i386 srec symbolsrec tekhex binary ihex trad-core
>>  .../bin/ld: supported emulations: elf_i386 i386linux elf_x86_64 i386pep i386pe
>>
>>
>> Which looks correct to me.
>
> I do the following:
>
> 1) Create a sysroot at /tmp/rt using the mingw-w64 header set
> available at mingw-w64.sf.net from svn repo
> 2) Build/install binutils with these options:
> --prefix=/tmp/rt
> --with-sysroot=/tmp/rt
> --enable-multilib
> --target=x86_64-pc-mingw32
> --enable-targets=x86_64-pc-mingw32,i686-pc-mingw32
> 3) Build gcc with "make all-gcc" and "make install-gcc" using the above options
> 4) Compile our crt libraries using the bootstrap compiler with these options:
> --prefix=/tmp/rt
> --with-sysroot=/tmp/rt
> --enable-lib32
> --host=x86_64-pc-mingw32
>
> It will die here during make.  gcc launches cc1 with -m32, which
> correctly outputs 32-bit asm.  That gets fed into as, which, after
> adding the --enable-targets line to binutils configure and the --32
> option to as, works.  Then ld is launched, and that dies.
>
> There is an apparent naming conflict where ld wants i386pe, but we are
> feeding in pe-i386.
>

The name of 32-bit emulation is i386pe, and for the 64-bit it is
i386pep. Gcc specifies by the -m option for ld the emulation, not the
internal target name IIUC.

Cheers,
Kai


-- 
|  (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]