Closed katananja closed 5 years ago
Are you setting OVERRIDE_CC
and OVERRIDE_CXX
to point to the cross-compilers? Are you setting CROSS_BUILD
to enable separate host/target compilers?
I just tested it and cross-compilation works as expected. Additionally, @couriersud has been using cross-compilation successfully over the past few days. If you're having trouble using a feature please ensure you understand how it's supposed to work before opening an issue. The issue tracker is not a help forum.
According to toolchain.lua
at this specific code starting at line 275 to 293:
if "mingw64-gcc" == _OPTIONS["gcc"] then
if not os.getenv("MINGW64") then
print("Set MINGW64 envrionment variable.")
end
if toolchainPrefix == nil or toolchainPrefix == "" then
toolchainPrefix = "$(MINGW64)/bin/x86_64-w64-mingw32-"
end
premake.gcc.cc = toolchainPrefix .. "gcc"
premake.gcc.cxx = toolchainPrefix .. "g++"
-- work around GCC 4.9.2 not having proper linker for LTO=1 usage
local version_4_ar = str_to_version(_OPTIONS["gcc_version"])
if (version_4_ar < 50000) then
premake.gcc.ar = toolchainPrefix .. "ar"
end
if (version_4_ar >= 50000) then
premake.gcc.ar = toolchainPrefix .. "gcc-ar"
end
location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-mingw64-gcc")
end
It show that it will setup and use the cross-compilers once the MINGW64
environment is set and the code will handle the rest, so it will resolve $(MINGW64)/bin/x86_64-w64-mingw32-
in to the full path of /usr/x86_64-w64-mingw32/bin/x86_64-w64-mingw32-gcc
and /usr/x86_64-w64-mingw32/bin/x86_64-w64-mingw32-g++
in my case. I only use OVERRIDE_CC
and OVERRIDE_CXX
to build MAME with Clang.
I did run another test with OVERRIDE_CC=/usr/x86_64-w64-mingw32/bin/x86_64-w64-mingw32-gcc
and OVERRIDE_CXX=/usr/x86_64-w64-mingw32/bin/x86_64-w64-mingw32-g++
it return the exact same error since looks like is a link and not compiling issues.
Looks like it's the same issue as 9c9fe82d4f811fff6639df5b286d8c7da13818a9, it might be necessary to change Imm32
to imm32
, Version
to version
, Ole32
to ole32
so on and so forth.
This errors only happen with a SDL version of MAME, without it, cross-compiling a non-SDL version for windows works fine. The CROSS_BUILD=1
is set in all cross-compilations.
I just tested it and cross-compilation works as expected. Additionally, @couriersud has been using cross-compilation successfully over the past few days. If you're having trouble using a feature please ensure you understand how it's supposed to work before opening an issue. The issue tracker is not a help forum.
The cross-compilation is not broken @cuavas, I can compile a MAME for windows just fine, the issue is with the SDL version of it, the linker can't link using Imm32
and other libs because it's case-sensitive.
OK, I checked made the library names lowercase for libraries that are lowercase in system32 on my Windows system, documented the cross-compilation options (was doing that already), and made USE_BUNDLED_LIB_SDL2
do the right thing for both 0 and 1 (0 doesn't change the default) -- see 8ffff5d2d3bcebbdbefec2508ddd2ecd264a399a
Thank you.
mame0206-402-g95f817b54d
Debian 9.6 X64 GCC 6.3.0 Build options:make clean && make TARGETOS=windows SUBTARGET=tiny OSD=sdl
SDL 2.0.5
Environment:
First try:
Second try:
make TARGETOS=windows SUBTARGET=tiny OSD=sdl REGENIE=1 USE_BUNDLED_LIB_SDL2=0
Looks like this is a case-sensitive issue at
scripts/src/osd/sdl.lua
starting at line 55:This goes beyond me, maybe other fixes might be needed. Thank you.