mirror of
https://github.com/holub/mame
synced 2025-07-03 17:08:39 +03:00
This lets MAME compile in Arch Linux GCC 5.2. 16G RAM used to prevent crash. compile with 'make SSE3=1 LTO=1'
testing GCC 5.2 MSYS2 now (NW)
This commit is contained in:
parent
834982ec3b
commit
0eef937287
@ -282,6 +282,15 @@ newoption {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
newoption {
|
||||||
|
trigger = "SSE3",
|
||||||
|
description = "SSE3 optimized code and SSE3 code generation.",
|
||||||
|
allowed = {
|
||||||
|
{ "0", "Disabled" },
|
||||||
|
{ "1", "Enabled" },
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
newoption {
|
newoption {
|
||||||
trigger = "OPENMP",
|
trigger = "OPENMP",
|
||||||
description = "OpenMP optimized code.",
|
description = "OpenMP optimized code.",
|
||||||
@ -704,8 +713,12 @@ if (_OPTIONS["targetos"]=="solaris") then
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
buildoptions_c {
|
buildoptions_c {
|
||||||
|
-- "-std=gnu99",
|
||||||
"-std=gnu89",
|
"-std=gnu89",
|
||||||
|
-- "-Wpedantic",
|
||||||
|
-- "-pedantic",
|
||||||
|
-- "-Wno-variadic-macros",
|
||||||
|
-- "-Wno-long-long",
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -714,12 +727,24 @@ if _OPTIONS["CPP11"]=="1" then
|
|||||||
buildoptions_cpp {
|
buildoptions_cpp {
|
||||||
"-x c++",
|
"-x c++",
|
||||||
"-std=gnu++11",
|
"-std=gnu++11",
|
||||||
|
-- "-std=c++11",
|
||||||
|
-- "-Wpedantic",
|
||||||
|
-- "-pedantic",
|
||||||
|
-- "-Wno-variadic-macros",
|
||||||
|
-- "-Wno-long-long",
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
--we compile C++ code to C++98 standard with GNU extensions
|
--we compile C++ code to C++98 standard with GNU extensions
|
||||||
buildoptions_cpp {
|
buildoptions_cpp {
|
||||||
"-x c++",
|
"-x c++",
|
||||||
|
-- "-Wpedantic",
|
||||||
|
-- "-pedantic",
|
||||||
"-std=gnu++98",
|
"-std=gnu++98",
|
||||||
|
"-Wno-variadic-macros",
|
||||||
|
"-Wno-long-long",
|
||||||
|
"-Wno-variadic-macros",
|
||||||
|
-- "-std=c++98",
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -815,18 +840,23 @@ if _OPTIONS["OPTIMIZE"] then
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
if _OPTIONS["LTO"]=="1" then
|
if _OPTIONS["LTO"]=="1" then
|
||||||
-- -flto=4 -> 4 threads, reduce if you are low on memory (less than 8G)
|
|
||||||
buildoptions {
|
buildoptions {
|
||||||
"-flto=4",
|
"-flto=1",
|
||||||
}
|
-- these next flags allow MAME to compile in linux GCC 5.2. odr warnings should be fixed as LTO randomly crashes otherwise
|
||||||
buildoptions {
|
"-ffat-lto-objects", "-Wodr",
|
||||||
"-fno-fat-lto-objects",
|
"-flto-compression-level=9", -- lto didn't work with anything less on linux with < 12G RAM
|
||||||
|
"-flto-odr-type-merging",
|
||||||
|
"-flto-report" -- if you get an error in lto after [WPA] stage, but before [LTRANS] stage, you need more memory!
|
||||||
|
|
||||||
}
|
}
|
||||||
|
-- same flags are needed by linker
|
||||||
linkoptions {
|
linkoptions {
|
||||||
"-flto=4",
|
"-flto=1",
|
||||||
}
|
-- these next flags allow MAME to compile in linux GCC 5.2. odr warnings should be fixed as LTO randomly crashes otherwise
|
||||||
linkoptions {
|
"-ffat-lto-objects", "-Wodr",
|
||||||
"-fno-fat-lto-objects",
|
"-flto-compression-level=9", -- lto didn't work with anything less on linux with < 12G RAM
|
||||||
|
"-flto-odr-type-merging",
|
||||||
|
"-flto-report" -- if you get an error in lto after [WPA] stage printout, but before any [LTRANS] section printout, you need more memory!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -846,6 +876,15 @@ if _OPTIONS["SSE2"]=="1" then
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if _OPTIONS["SSE3"]=="1" then
|
||||||
|
buildoptions {
|
||||||
|
"-msse",
|
||||||
|
"-msse2",
|
||||||
|
"-msse3"
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
if _OPTIONS["OPENMP"]=="1" then
|
if _OPTIONS["OPENMP"]=="1" then
|
||||||
buildoptions {
|
buildoptions {
|
||||||
"-fopenmp",
|
"-fopenmp",
|
||||||
@ -969,14 +1008,27 @@ end
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
if (version >= 40800) then
|
if (version >= 40800) then
|
||||||
-- array bounds checking seems to be buggy in 4.8.1 (try it on video/stvvdp1.c and video/model1.c without -Wno-array-bounds)
|
-- grr.. array-bounds works on GCC5.2 linux, but fails in sqllite3.c on MingW GCC 5.1.1 for now
|
||||||
|
-- if (version < 50000) then
|
||||||
|
-- -- array bounds checking seems to be buggy in 4.8.1 (try it on video/stvvdp1.c and video/model1.c without -Wno-array-bounds)
|
||||||
buildoptions {
|
buildoptions {
|
||||||
"-Wno-array-bounds"
|
"-Wno-array-bounds"
|
||||||
}
|
}
|
||||||
|
-- end
|
||||||
end
|
end
|
||||||
if (version >= 50000) then
|
if (version >= 50000) then
|
||||||
buildoptions {
|
buildoptions {
|
||||||
"-D__USE_MINGW_ANSI_STDIO=1",
|
"-D__USE_MINGW_ANSI_STDIO=1", -- required or lua won't compile linux ignores this but Windows needs it
|
||||||
|
"-freport-bug",
|
||||||
|
"-D_GLIBCXX_USE_CXX11_ABI=0", -- does not seem to matter in linux, mingw needs to link printf,etc
|
||||||
|
-- "-DNO_MEM_TRACKING", -- must comment out for mingw GCC 5.2 pedantic or get new/delete redef error
|
||||||
|
-- next two should work, but compiler complains about end conditions that are int when loop variable is unsigned. maybe these can be fixed
|
||||||
|
-- "-funsafe-loop-optimizations",
|
||||||
|
-- "-Wunsafe-loop-optimizations",
|
||||||
|
-- this six flag combo lets MAME compile with LTO=1 on linux with no errors (whew!--Cowering) someone should probably pretty this up as you can't really debug with them enabled
|
||||||
|
"-fdevirtualize-at-ltrans","-fgcse-sm","-fgcse-las",
|
||||||
|
"-fipa-pta","-fipa-icf","-fvariable-expansion-in-unroller",
|
||||||
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user