Binutils Build Report

I spent my whole day building the binutils, luckily for me I finally succeeded in the evening. I think I’d better write it down for remembering.
Purpose : Since I need to create a N32 port for Debian, all that I need to do is to building every package(hopefully) in Debian repo from source, with the specific CFLAGS="-march=mips3(or loongson2f) -mabi=n32". And before that, I should have this set of cross-compile tool-chain. And Binutils is the very first package to be built.
Goal : build Binutils-2.19 using the multilib version of gcc-4.4 with parameter "-march=mips3 -mabi=n32".
What I have done:
1. Download Binutils-2.19.51 from cvs with this patch since it’ll later be used with building the kernel with the option"-Wa(??),-mfix-ls2f-kernel". One thing to note is there’s a hunk can’t be patched automatically since the context around it in my gas/config/tc-mips.c file is a little bit different from when r0bertz create the patch. However it’s very easy to manually patch it.
2. Install Bison, Flex and texinfo on my debian-mipsel. To be exactly, I’m not sure if they’re *all* neccessary. But without them, the make process will report error "[bfd.info] error" and "yyparse undeclared indetifier". I google it a little and install these three packages at one time:-)
3. Configure. I use CFLAGS="-O2 -march=mips3 -mabi=n32 -pipe" as Fai told me and "–disable-nls –enable-shared". Of cource the CC="/usr/bin/gcc-4.4".
4. make configure-host && make && make install. The whole process took me 25min on my fuloong2f box.
Things still need to be figured out:
1. There is bin/ diretory in {PREFIX} and another bin/ in mips64el-unknown-linux-gnu. The last one is what i need but what’s the first one for?
2. I’m not sure what "make configure-host" is for.
3. I’m still confused the term "multilib". How many meanings does it have? We can say a multilib system and a mutilib gcc but what’s the relationship between them?
What’s next:
gcc, glibc and kernel.
Summary:
This is probably the easiest package to be built in the tool-chain and it cost me one hard day to learn and try. Though I build it successfully today, many potential errors may come out later when building other packages. However, I still think it as a good start330

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: