Skip to content

Commit

Permalink
Switch: Fix compilation with latest toolchain
Browse files Browse the repository at this point in the history
  • Loading branch information
rsn8887 committed May 23, 2021
1 parent 16c4721 commit 5c4aab2
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 119 deletions.
118 changes: 1 addition & 117 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -491,124 +491,8 @@ if(BUILD_NX)
-march=armv8-a
-mtune=cortex-a57
-mtp=soft
#-fPIE is neccessary to prevent crash on startup
-fPIE
#using anything but -O0 causes crash when loading a level that contains rubberbands
#the crash happens in rubberbands.cc, line 41: switchAnchor(old, anchor1, anchor2Object());
#enabling optimization flags by hand prevents the crash
-O0
#O1 (flags from https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html)
-fauto-inc-dec
-fbranch-count-reg
-fcombine-stack-adjustments
-fcompare-elim
-fcprop-registers
-fdce
-fdefer-pop
-fdelayed-branch
-fdse
-fforward-propagate
-fguess-branch-probability
-fif-conversion
-fif-conversion2
-finline-functions-called-once
-fipa-profile
#the commented three flags here used to cause a crash in rubberbands.cc (see FIXME comment there)
#-fipa-pure-const
-fipa-reference
#-fmerge-constants
-fmove-loop-invariants
#-fomit-frame-pointer
-freorder-blocks
-fshrink-wrap
-fshrink-wrap-separate
-fsplit-wide-types
-fssa-backprop
-fssa-phiopt
-ftree-bit-ccp
-ftree-ccp
-ftree-ch
-ftree-coalesce-vars
-ftree-copy-prop
-ftree-dce
-ftree-dominator-opts
-ftree-dse
-ftree-forwprop
-ftree-fre
-ftree-phiprop
-ftree-pta
-ftree-scev-cprop
-ftree-sink
-ftree-slsr
-ftree-sra
-ftree-ter
-funit-at-a-time

#-O2
-falign-functions
-falign-jumps
-falign-labels
-falign-loops
-fcaller-saves
-fcode-hoisting
-fcrossjumping
-fcse-follow-jumps
-fcse-skip-blocks
-fdelete-null-pointer-checks
-fdevirtualize
-fdevirtualize-speculatively
-fexpensive-optimizations
-fgcse
-fgcse-lm
-fhoist-adjacent-loads
-finline-small-functions
-findirect-inlining
-fipa-bit-cp
-fipa-cp
-fipa-icf
-fipa-ra
-fipa-sra
-fipa-vrp
-fisolate-erroneous-paths-dereference
-flra-remat
-foptimize-sibling-calls
-foptimize-strlen
-fpartial-inlining
-fpeephole2
-freorder-blocks-algorithm=stc
-freorder-blocks-and-partition
-freorder-functions
-frerun-cse-after-loop
-fschedule-insns
-fschedule-insns2
-fsched-interblock
-fsched-spec
-fstore-merging
-fstrict-aliasing
-fthread-jumps
-ftree-builtin-call-dce
-ftree-pre
-ftree-switch-conversion
-ftree-tail-merge
-ftree-vrp

#O3
-fgcse-after-reload
-finline-functions
-fipa-cp-clone
-floop-interchange
-floop-unroll-and-jam
-fpeel-loops
-fpredictive-commoning
-fsplit-paths
-ftree-loop-distribute-patterns
-ftree-loop-distribution
-ftree-loop-vectorize
-ftree-partial-pre
-ftree-slp-vectorize
-funswitch-loops
-fvect-cost-model

-O3
-fno-asynchronous-unwind-tables
-funroll-loops
-fno-unwind-tables
Expand Down
2 changes: 2 additions & 0 deletions src/client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,9 @@ void ClientShutdown() {
}

bool NetworkStart() {
#ifndef __SWITCH__
return client_instance.network_start();
#endif
}

void Msg_LevelLoaded(bool isRestart) {
Expand Down
2 changes: 2 additions & 0 deletions src/gui/MainMenu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,14 @@ namespace enigma { namespace gui {

void NetworkMenu::on_action(gui::Widget *w)
{
#ifndef __SWITCH__
if (w == startgame) {
netgame::Start();
}
else if (w == m_joingame) {
netgame::Join("localhost", 12345);
}
#endif
if (w == m_back)
Menu::quit();
}
Expand Down
2 changes: 1 addition & 1 deletion src/switch/sdl2_to_sdl1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ int isDocked() {
case AppletOperationMode_Handheld:
return 0;
break;
case AppletOperationMode_Docked:
case AppletOperationMode_Console:
return 1;
break;
default:
Expand Down
2 changes: 1 addition & 1 deletion src/switch/sdl2_to_sdl1.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ extern SDL_Surface *alpha_format_source;
#define SDLK_LMETA SDLK_LGUI
#define SDLK_RMETA SDLK_RGUI
#define SDL_keysym SDL_Keysym
#define SDL_DisplayFormat(x) SDL_ConvertSurface(x,switch_screen_surface->format,0)
#define SDL_DisplayFormat(x) SDL_ConvertSurface(x,alpha_format_source->format,0)
#define SDL_DisplayFormatAlpha(x) SDL_ConvertSurface(x,alpha_format_source->format,0)
#define SDL_SetAlpha(x,y,z) SDL_SetSurfaceAlphaMod(x,z); SDL_SetSurfaceBlendMode(x, SDL_BLENDMODE_BLEND);
typedef enum {
Expand Down

0 comments on commit 5c4aab2

Please sign in to comment.