Add a universal option to the osx flag, does not work yet since scons strips out the -arch flag that it thinks is a duplicate, add to linker flags since cross compiling on OSX was failing since it was trying to link everything as the wrong arch. Re-Enable the loadstores in 32bit Dolphin in OSX, due to the reason described in the comments (Fast 32bit OSX!). Add an alert if the memory space ends up above 32bit in *nix sides, since it will ALWAYS be above in 64bit OSX, Will try to fix.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5155 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Sonicadvance1 2010-03-05 09:23:28 +00:00
parent e79dc93a5c
commit d18ab50520
3 changed files with 18 additions and 1 deletions

View File

@ -124,7 +124,7 @@ vars.AddVariables(
ignorecase = 2
),
EnumVariable('osx', 'Choose a backend (WIP)', '32cocoa',
allowed_values = ('32x11', '32cocoa', '64cocoa'),
allowed_values = ('32x11', '32cocoa', '64cocoa', 'universal'),
ignorecase = 2
),
PathVariable('wxconfig', 'Path to the wxconfig', None),
@ -328,9 +328,14 @@ if sys.platform != 'darwin':
if sys.platform == 'darwin':
if env['osx'] == '64cocoa':
compileFlags += ['-arch' , 'x86_64', '-m64' ]
env['LINKFLAGS'] += ['-arch' , 'x86_64', '-m64' ]
conf.Define('MAP_32BIT', 0)
if env['osx'] == '32cocoa':
compileFlags += ['-arch' , 'i386', '-m32' ]
env['LINKFLAGS'] += ['-arch' , 'i386', '-m32' ]
if env['osx'] == 'universal':
compileFlags += ['-arch i386', '-arch x86_64']
env['LINKFLAGS'] += ['-arch i386', '-arch x86_64']
if not env['osx'] == '32x11':
env['HAVE_X11'] = 0
env['HAVE_COCOA'] = 1

View File

@ -62,6 +62,13 @@ void* AllocateExecutableMemory(size_t size, bool low)
, -1, 0); // | MAP_FIXED
// printf("Mapped executable memory at %p (size %i)\n", retval, size);
if ((u64)ptr >= 0x80000000)
{
// Should only happen in 64bit OSX
// Just a reminder, to show a OSX user that it may fail
PanicAlert("Executable memory ended up above 2GB!");
}
if (!retval)
{
PanicAlert("Failed to allocate executable memory, errno=%i", errno);

View File

@ -87,8 +87,13 @@ void SCoreStartupParameter::LoadDefaults()
// These are required for the JIT cores to work in OSX
// Older revs (~4854) Only required LoadStorePaired to be turned off
// Newer revs (~4890) require both turned off
#ifdef __x86_64__
// These work fine in 32bit OSX
// Since the reason why 64bit OSX fails out is due to casting (u32)(u64)
// Since all 64bit applications are above the 32bit memory boundary
bJITLoadStoreOff = true;
bJITLoadStorePairedOff = true;
#endif
#elif defined(__linux__)
// Similar to OSX, something with LoadStorePaired seems to cause
// crashes on linux. Only Win32 seems to be forgiving enough to