for cross-arch development, it comes handy when binutils is captable of handling more executable formats than just the one on the install machine. Following Debian's example (package: binutils-multiarch) I've added a new use flag to enable all targets binutils is captable of. Patch attached.
Created attachment 30671 [details, diff] multiarch use flag. set multiarch to enable all bfd targets.
robbat didn't you encounter problems with doing this in the past before? Any reason we should not support this as either a multiarch or cross USE flag?
multiarch does NOT correct describe what --enable-targets=all does. I did have success in using binutils with all-targets for some stuff I was doing. namely, enable-targets=all provides MOST of binutils cross-platform stuff, but not for all of the binutils programs. 'as' is a notable exception that doesn't do multiple targets (which is a great pity and I believe the binutils people were working on removing this limitation). ld does support multiple targets, and i've used it for that before. call the use flag 'multitarget' when you include it, as it better describes what it is. beware that it massively expands the size of installed binutils, from ~10mb to ~50mb.
Added to portage >=sys-devel/binutils-2.14.90.0.8-r1 New local USE flag. grep multitarget * use.local.desc:sys-devel/binutils:multitarget - Adds support to binutils for canadian cross compiling. (does not work with gas) Note: This flag has to be best effort. There will be a number of patches that do not get applied to binutils across the board for all arches so if you use it beware.
(In reply to comment #0) > I've added a new use flag to enable all targets binutils is captable of. > Patch attached. Is it possible to use this flag to make cross-compiling tools which will be able to build Win32 EXE PE binaries [pe-i386] as well as Linux ones? If yes, how to achieve it? > For cross-arch development, it comes handy when binutils is captable of > handling more executable formats than just the one on the install machine. Seems like that flag is what I want, but how to choose executable formats which I need?
SasQ: yes, but the USE flag is called 'multitarget' now. For using LD directly, this is the most of what you need: ld -m i386pe Beyond that, go and look at Wine, or the SGI VISWS 320 bootloader.