Petr Salinger a écrit : > Hi. Hi!
>> First the change from elf64-x86-64 to elf64-x86-64-freebsd breaks the >> build of the kernel ("ld: target elf64-x86-64 not found"). This can >> probably be fixed, but I wonder to know if this change is really >> necessary? Plain FreeBSD amd64 seems to use elf64-x86-64. > > The plain FreeBSD does it in "the right way" only > for two (first) ports - i386 and alpha. For all others they use hack > for seting ELFOSABI_FREEBSD. So the "target elf64-x86-64" generated on > Linux is not same asthe one generated on FreeBSD :-( > It disallows building from the same source on both platforms, > cross compilers and so on. > IMO, the right way here is to use elf64-x86-64-freebsd in linker scripts. Ok, it's what I have done for the kernel. I hope the number of affected packages is rather limited. >> Second this seems to cause some problems when trying to build a bi-arch >> gcc. I get: File format is ambiguous. Matching formats: >> elf32-i386-freebsd elf32-i386. >> >> Changing the patch so that only elf64-x86-64 and elf32-i386-freebsd >> format are supported seems to fix those problems. What do you think? > > I hope you meant "elf64-x86-64-freebsd and elf32-i386-freebsd", > i.e. the right chunk of 2.17 patch should be: oops, yes, sorry for the mistake. > diff -urN binutils-2.17/bfd/config.bfd binutils-2.17/bfd/config.bfd > --- binutils-2.17/bfd/config.bfd > +++ binutils-2.17/bfd/config.bfd > @@ -551,8 +551,8 @@ > targ_selvecs="bfd_elf32_i386_vec i386coff_vec" > ;; > x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu) > - targ_defvec=bfd_elf64_x86_64_vec > - targ_selvecs="bfd_elf32_i386_vec i386coff_vec bfd_efi_app_ia32_vec" > + targ_defvec=bfd_elf64_x86_64_freebsd_vec > + targ_selvecs="bfd_elf32_i386_freebsd_vec i386coff_vec > bfd_efi_app_ia32_vec" > ;; > x86_64-*-netbsd* | x86_64-*-openbsd*) > targ_defvec=bfd_elf64_x86_64_vec > > > This way there will be no ambiguity. It looks like the linker is able to > solve ambiguity only partially - iff one of possible format is > "targ_defvec". I overlooked this during preparation of the patch. > After testing, we should ask upstream > to just drop "bfd_elf32_i386_vec bfd_elf64_x86_64_vec" from targ_selvecs. This is exactly what I done locally to build a bi-arch toolchain, so I can confirm that it is the right solution. I have almost finished to build a bi-arch toolchain on kfreebsd-amd64. I am currently starting a full rebuild of the involved packages. I think it will be ready for the week-end. Bye, Aurelien -- .''`. Aurelien Jarno | GPG: 1024D/F1BCDB73 : :' : Debian developer | Electrical Engineer `. `' [EMAIL PROTECTED] | [EMAIL PROTECTED] `- people.debian.org/~aurel32 | www.aurel32.net -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]