Building GCC cross compiler (from “Linux” to “Windows”)

前端 未结 3 2019
野性不改
野性不改 2020-12-14 13:06

I want to build \"gcc cross-compiler\" to compile \"c/c++\" applications on \"Linux\" environment but for \"Windows\" target.

I have made this so far:

3条回答
  •  遥遥无期
    2020-12-14 13:26

    That's actually OK: the way things go, you need to

    1. build binutils
    2. install headers
    3. build the a partial C compiler: enough to create object files, but not enough to link
    4. build the win32api and mingw runtime (which includes your missing dllcrt2.o)
    5. build a complete C compiler (and other front-ends, such as C++, Fortran, Ada, whatever, if you want them)

    You have successful performed step 3 above; it fails building libgcc (which is a GCC support library), but that means the C compiler core is functionnal (although it won't be able to link, it can still create valid object files). You can check that by looking at the gcc/xgcc file in your GCC build directory.

    So, you need to go to the next step, not worrying about your current failure.

    (To actuall install the partial C compiler, you should run make with the -k option, to have it do it best, even in the face of errors. For example, use make -k install.)

提交回复
热议问题