1

This is totally outside my area of expertise, so forgive me if this seems rather elementary. I've never really worked with C, so this is a bit new to me. I've been tasked with cross-compiling the ISC's DHCP implementation into MIPS. I have the compiler (mipsel-linux-gcc) and other assorted tools and it compiles fine but it fails when linking on every file:

Bad value: failed to merge target specific data of file ... linking PIC files with non-PIC files

-fPIC and -fno-PIC changed nothing. Is there a simple solution to this, or will I need to start rewriting chunks of this software? Any input would be appreciated, I'm at a bit of a loss.

My configure line is as follows:

./configure CC=mipsel-linux-gcc CPP=mipsel-linux-cpp --host=mips --build=i686-pc-linux-gnu
Parker
  • 1,082
  • 3
  • 13
  • 27

1 Answers1

4

Something's wrong with libraries you're linking in. Make sure you have the standard library compiled for PIC, and that you link to it, not your system's.

nmichaels
  • 49,466
  • 12
  • 107
  • 135
  • 1
    To further clarify: PIC (Position Independent Code) is a property of compiled code and has nothing to do with your source. – Nathan Kidd Apr 11 '11 at 19:06
  • @Nathan: Gah, I missed that this was mips. I was thinking of [this](http://www.microchip.com/) PIC, but the answer is the same. Win! – nmichaels Apr 11 '11 at 19:53
  • Yes, what was happening is that a library was being compiled by gcc and the linker was trying to link x86 and MIPS code. – Parker Apr 16 '11 at 05:24