I am trying to compile Godot for the PlayStation 2 using the PS2SDK homebrew project.
I am running into compilation errors and I am not sure how to resolve them. I have a repository created so that people can try to reproduce the issue locally.
The error I am receiving is:
In file included from ./core/method_bind.h:383,
from ./core/class_db.h:34,
from ./core/reference.h:34,
from modules/csg/csg.h:43,
from modules/csg/csg_shape.h:36,
from modules/csg/csg_shape.cpp:31:
./core/method_bind.gen.inc: In instantiation of 'PropertyInfo MethodBind0RC<R>::_gen_argument_type_info(int) const [with R = int]':
./core/method_bind.gen.inc:548:23: required from here
./core/method_bind.gen.inc:549:74: error: incomplete type 'GetTypeInfo<int, void>' used in nested name specifier
549 | if (p_argument==-1) return GetTypeInfo<R>::get_class_info();
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
./core/method_bind.gen.inc: In instantiation of 'GodotTypeInfo::Metadata MethodBind0RC<R>::get_argument_meta(int) const [with R = int]':
./core/method_bind.gen.inc:535:34: required from here
./core/method_bind.gen.inc:536:55: error: incomplete type 'GetTypeInfo<int, void>' used in nested name specifier
536 | if (p_arg==-1) return GetTypeInfo<R>::METADATA;
| ^~~~~~~~
./core/method_bind.gen.inc: In instantiation of 'void MethodBind0RC<R>::ptrcall(Object*, const void**, void*) [with R = int]':
./core/method_bind.gen.inc:586:15: required from here
./core/method_bind.gen.inc:588:36: error: 'encode' is not a member of 'PtrToArg<int>'
588 | PtrToArg<R>::encode( (instance->*method)() ,r_ret) ;
| ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Most probably, I am missing some flags for the compile, but I am unsure which.
This is my detect.py file:
import os
import platform
import sys
import os.path
def is_active():
return True
def get_name():
return "Playstation 2"
def can_build():
# Check the minimal dependencies
if "PS2SDK" not in os.environ:
print("PS2SDK not defined in environment.. Playstation 2 disabled.")
return False
if "PS2DEV" not in os.environ:
print("PS2DEV not defined in environment.. Playstation 2 disabled.")
return False
return True
def get_opts():
return []
def get_flags():
return [
("tools", False),
("builtin_bullet", True),
("builtin_enet", True),
("builtin_freetype", True),
("builtin_libogg", True),
("builtin_libpng", False),
("builtin_libtheora", True),
("builtin_libvorbis", True),
("builtin_libvpx", True),
("builtin_libwebp", True),
("builtin_wslay", True),
("builtin_mbedtls", True),
("builtin_miniupnpc", True),
("builtin_opus", True),
("builtin_pcre2", True),
("builtin_squish", True),
("builtin_zlib", True),
("builtin_zstd", True),
]
def configure(env):
env["CC"] = "mips64r5900el-ps2-elf-gcc"
env["CXX"] = "mips64r5900el-ps2-elf-g++"
env["AR"] = "mips64r5900el-ps2-elf-ar"
env["AS"] = "mips64r5900el-ps2-elf-as"
env["LD"] = "mips64r5900el-ps2-elf-ld"
env["OBJCOPY"] = "mips64r5900el-ps2-elf-objcopy"
env["STRIP"] = "mips64r5900el-ps2-elf-strip"
env["ADDR2LINE"] = "mips64r5900el-ps2-elf-addr2line"
env["RANLIB"] = "mips64r5900el-ps2-elf-ranlib"
env["BIN2S"] = os.environ.get("PS2SDK") + "/bin/bin2s"
env["VCL"] = "vcl"
env["VCLPP"] = "vclpp"
env["DVP"] = "dvp-as"
PS2DEV = os.environ.get("PS2DEV")
env.Prepend(CPPPATH=["{}/ps2sdk/ee/include".format(PS2DEV)])
env.Prepend(CPPPATH=["{}/ps2sdk/common/include".format(PS2DEV)])
env.Prepend(CPPPATH=["{}/ps2sdk/ports/include".format(PS2DEV)])
env.Append(CCFLAGS='-D_EE -Wall -O3 -DPOSH_COMPILER_GCC -DPOSH_OS_VITA -DPOSH_OS_STRING=\\"ps2\\" -D__PS2__ -DPS2_ENABLED')
env.Append(LIBS=["stdc++", "dma", "packet2", "graph", "draw", "math3d", "png", "debug", "z", "pad", "audsrv", "patches", "cdvd"])
env.Append(LINKFLAGS="-O3 -Wl,-zmax-page-size=128")
env.Append(ASFLAGS="-O3")
env["bits"] = "32"
env.Append(CPPDEFINES=['NEED_LONG_INT'])
env.Prepend(CPPPATH=["#platform/ps2"])
You can download a repo to test my build locally from https://github.com/ivandortulov/godot-ps2