I've tried to compile some software with MINGW64 GCC, going through and "fixing" (making lame hacks to make it work) numerous errors stopped at inability to link compiled .o files because (as i've understood googling) ld.exe is trying to link 32-bit code to 64-bit executable. After making some more googling i've made "gcc -v" for both MSYS2 x64 and MINGW64 GCCs, and eventually saw "--disable-multilib" in build options of both.
So, the questions:
why was multilib disabled?
are you going to enable it and when?
is it possible to solve the problem with MINGW64 build, or do i need to install MINGW32 build?
Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Linking 32-bit and 64-bit object files together is not "multilib", nor is it anything. You can't do it. Actually, Apple binaries have support for multiple architectures in one object file, but the PE* format does not support this. Even when formats do support it, you can't mix two different architectures in one program, you end up with just two copies of the entire program in the final binary, only one of which is finally run depending on the machine you're running on.
From GCC's perspective, "multilib" means a compiler that accepts some flags that switch it (typically) from generating 32-bit code to 64-bit code (e.g. -m32 / -m64).
We're probably never going to enable GCC's version of "mulitlib" in MSYS2/MinGW-w64 since we want to use different exception models for each and this is not possible with "multilib" GCC toolchains.
You should stop trying to mix 32-bit code with 64-bit code. You need to re-compile your 32-bit code as 64-bit code. If the 32-bit code is not supplied in source code then you need to switch entirely to building 32-bit code and give up on making a 64-bit executable.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry for the noise, but seems i didn't explain correctly.
I don't need to make 64-bit executable, seems the software uses some structures incompatible with 64-bit GCC. I need to make 32-bit executable with MINGW64 GCC. And i've used "-m32", because without it i've got error:
error: CPU you selected does not support x86-64 instruction set
#include <stdarg.h>
^</stdarg.h>
Hi.
I've tried to compile some software with MINGW64 GCC, going through and "fixing" (making lame hacks to make it work) numerous errors stopped at inability to link compiled .o files because (as i've understood googling) ld.exe is trying to link 32-bit code to 64-bit executable. After making some more googling i've made "gcc -v" for both MSYS2 x64 and MINGW64 GCCs, and eventually saw "--disable-multilib" in build options of both.
So, the questions:
Thanks.
Linking 32-bit and 64-bit object files together is not "multilib", nor is it anything. You can't do it. Actually, Apple binaries have support for multiple architectures in one object file, but the PE* format does not support this. Even when formats do support it, you can't mix two different architectures in one program, you end up with just two copies of the entire program in the final binary, only one of which is finally run depending on the machine you're running on.
From GCC's perspective, "multilib" means a compiler that accepts some flags that switch it (typically) from generating 32-bit code to 64-bit code (e.g. -m32 / -m64).
We're probably never going to enable GCC's version of "mulitlib" in MSYS2/MinGW-w64 since we want to use different exception models for each and this is not possible with "multilib" GCC toolchains.
You should stop trying to mix 32-bit code with 64-bit code. You need to re-compile your 32-bit code as 64-bit code. If the 32-bit code is not supplied in source code then you need to switch entirely to building 32-bit code and give up on making a 64-bit executable.
Sorry for the noise, but seems i didn't explain correctly.
I don't need to make 64-bit executable, seems the software uses some structures incompatible with 64-bit GCC. I need to make 32-bit executable with MINGW64 GCC. And i've used "-m32", because without it i've got error:
error: CPU you selected does not support x86-64 instruction set
#include <stdarg.h>
^</stdarg.h>
This is exact info about what i tried and what i've got:
https://github.com/amarao/flashnul/issues/3
It appears that you are trying to compile some really old, really broken code.
You need to see if the original author is willing to fix his stuff.
FWIW, that code will not compile on Linux, Windows or Mac OS X in its present state.
.. or on anything else for that matter.
Thank you anyway for support