Scoofy12
04-15-2005, 12:46 AM
warning: not interesting to non (unix) hackers
so... am i just a complete idiot for not knowing this fact?
<rant>
so I've been working on my toolchain to build fullblown programs for my nic simulator (gcc 3.2 and binutils that build binaries for a subset of the MIPS architecture, with a few extra instructions, plus the newlib C library)... i just spent half a day trying to figure out wtf i could have done to my compiler (i only made small changes) that made the linker fail to link with my C library, when it had no problem doing so before. even after i put the compiler back the way it was, it had problems. did you guys have any idea that library linking arguments to gcc or ld are ORDER DEPENDENT! like the -lc/-lm/-lpthread has to go AFTER your object files! wtf!? since when does order of command line arguments matter? it's not clear in the man page either. if you know this fact ahead of time and go back to read the man page, you could maybe see how part of it could be interpreted to mean that, sort of. but its not at all clear. the only reason i found it out was that i happened to type it the right way one time and it worked, and i eventually figured out that that was the only difference.
stupid. really stupid
</rant>
so... am i just a complete idiot for not knowing this fact?
<rant>
so I've been working on my toolchain to build fullblown programs for my nic simulator (gcc 3.2 and binutils that build binaries for a subset of the MIPS architecture, with a few extra instructions, plus the newlib C library)... i just spent half a day trying to figure out wtf i could have done to my compiler (i only made small changes) that made the linker fail to link with my C library, when it had no problem doing so before. even after i put the compiler back the way it was, it had problems. did you guys have any idea that library linking arguments to gcc or ld are ORDER DEPENDENT! like the -lc/-lm/-lpthread has to go AFTER your object files! wtf!? since when does order of command line arguments matter? it's not clear in the man page either. if you know this fact ahead of time and go back to read the man page, you could maybe see how part of it could be interpreted to mean that, sort of. but its not at all clear. the only reason i found it out was that i happened to type it the right way one time and it worked, and i eventually figured out that that was the only difference.
stupid. really stupid
</rant>