How to compile binutils properly?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
Wajideu
Member
Member
Posts: 153
Joined: Wed Jul 30, 2014 1:05 am

Re: How to compile binutils properly?

Post 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.
Binero
Posts: 15
Joined: Mon Mar 03, 2014 1:00 pm

Re: How to compile binutils properly?

Post 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.
Binero
Posts: 15
Joined: Mon Mar 03, 2014 1:00 pm

Re: How to compile binutils properly?

Post 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?
Post Reply