Page 2 of 2

Re: How to compile binutils properly?

Posted: Wed Sep 10, 2014 9:04 am
by Wajideu
You got the target backwards, it should be x86_64-pe. The "--enable-ld=default" and "--enable-shared" are redundant as they're the default values. "--with-lib-path" doesn't work that way, it's a single direct path. The "--enable-threads" is pointless if you don't specify the type of threads using "--with-threads=XXX" where 'XXX' is 'none', 'posix', or 'win32' to name a few. The "--enable-gold" option is pointless because the gold linker only handles elf files. Lastly, I think you may have the misunderstanding that "--enable-plugins" is used to make DLL's.

In short...everything about that configuration was wrong. Use the settings described by the GCC cross compiler tutorial on the osdev wiki, and only add options after you figure out what they actually do with a quick google search.

Re: How to compile binutils properly?

Posted: Wed Sep 10, 2014 9:16 am
by Binero
DaemonR wrote:You got the target backwards, it should be x86_64-pe. The "--enable-ld=default" and "--enable-shared" are redundant as they're the default values. "--with-lib-path" doesn't work that way, it's a single direct path. The "--enable-threads" is pointless if you don't specify the type of threads using "--with-threads=XXX" where 'XXX' is 'none', 'posix', or 'win32' to name a few. The "--enable-gold" option is pointless because the gold linker only handles elf files. Lastly, I think you may have the misunderstanding that "--enable-plugins" is used to make DLL's.

In short...everything about that configuration was wrong. Use the settings described by the GCC cross compiler tutorial on the osdev wiki, and only add options after you figure out what they actually do with a quick google search.
The target is the right way around (ld -- help | grep pe-x86-64). The options you say are redundant are enabled by default for my distro, and I have no idea what --enable-plugins even does, and I doubt it's relevant for the cross-linking this linker is supposed to do. Also I would like to stress I want this linker to handle *multiple* targets, including linux/efi.

Re: How to compile binutils properly?

Posted: Wed Sep 10, 2014 10:03 am
by Binero
I learnt a bit more about binutils, and it seems I can pass '-m' to the linker together with an emulation target. Would i386pep be a good emulation target for pei-x86_64?