Page 1 of 1

Can't use -lgcc flag with i686-elf-ld

Posted: Mon Oct 25, 2021 7:14 am
by NeonLightions
Like the title, can anyone help me solve this issue?

Re: Can't use -lgcc flag with i686-elf-ld

Posted: Mon Oct 25, 2021 7:23 am
by Solar
Have you possibly built a cross-compiler (judging from 'i686-elf-ld')? Have you double-checked that you have actually built and installed the lib, which you're to do in the GCC build step

Re: Can't use -lgcc flag with i686-elf-ld

Posted: Mon Oct 25, 2021 7:41 am
by NeonLightions
Solar wrote:Have you possibly built a cross-compiler (judging from 'i686-elf-ld')? Have you double-checked that you have actually built and installed the lib, which you're to do in the GCC build step
I see. But I really don't understand (cause my bad English). Could you help me explain it?

Re: Can't use -lgcc flag with i686-elf-ld

Posted: Mon Oct 25, 2021 8:39 am
by Solar
You do not really give enough information for us to help you.

And please do not be offended when I say: You need to be able to read, and write, English on a pretty high level if you want to get anywhere in system programming. If English poses a problem to you, you should practice English, not OS development...

Re: Can't use -lgcc flag with i686-elf-ld

Posted: Mon Oct 25, 2021 7:08 pm
by NeonLightions
Solar wrote:You do not really give enough information for us to help you.

And please do not be offended when I say: You need to be able to read, and write, English on a pretty high level if you want to get anywhere in system programming. If English poses a problem to you, you should practice English, not OS development...
No no no. I think my English is not a big problem for me. I'm good enough to read, write document in English and able to understand them. In https://wiki.osdev.org/GCC_Cross-Compiler I just say that I don't understand that problem. Wiki's solution makes me confuse...

Re: Can't use -lgcc flag with i686-elf-ld

Posted: Tue Oct 26, 2021 2:19 am
by iansjack
NeonLightions wrote:No no no. I think my English is not a big problem for me.
But I really don't understand (cause my bad English).
Both of these cannot be true. Solar is correct that, as so much documentation is written in English, you really need to make sure that you understand the language.

You need to give more information, and make your question more meaningful. At present it's the equivalent of saying "I don't feel well; what's wrong with me.

1. Did you follow the wiki instructions, exactly, when constructing your cross-compiler? Indeed, did you construct it or did you get it from some other source?
2. Dos the library libgcc exist in the lib directory of your cross-compiler installation?
3. Your question is far too vague:
  • i. What functions from libgcc are you trying to use?
    ii. What exact compile command are you using?
    iii. In what way does the command not work? Does it produce an executable that doesn't work properly, or does it fail with an error message?
    iv. If the latter, what is that error message (exactly)?