--- ./SConstruct.orig 2023-03-25 16:50:11.568918000 +0200 +++ ./SConstruct 2023-03-25 16:53:05.980989000 +0200 @@ -295,7 +295,7 @@ ) experimental_optimizations = [ - 'O3', + 'O', 'builtin-memcmp', 'fnsi', 'nofp', @@ -313,7 +313,7 @@ action="append", choices=experimental_optimization_choices, const=experimental_optimization_choices[0], - default=['+sandybridge'], + default=[''], help='Enable experimental optimizations', nargs='?', type='choice' @@ -1343,9 +1343,9 @@ print(env_vars.GenerateHelpText(env)) Exit(0) -unknown_vars = env_vars.UnknownVariables() -if unknown_vars: - env.FatalError("Unknown variables specified: {0}", ", ".join(list(unknown_vars.keys()))) +#unknown_vars = env_vars.UnknownVariables() +#if unknown_vars: +# env.FatalError("Unknown variables specified: {0}", ", ".join(list(unknown_vars.keys()))) install_actions.setup(env, get_option('install-action')) @@ -2435,13 +2435,12 @@ # If runtime hardening is requested, then build anything # destined for an executable with the necessary flags for PIE. env.AppendUnique( - PROGCCFLAGS=['-fPIE'], + PROGCCFLAGS=['-fpic'], PROGLINKFLAGS=['-pie'], ) # -Winvalid-pch Warn if a precompiled header (see Precompiled Headers) is found in the search path but can't be used. env.Append( CCFLAGS=["-fasynchronous-unwind-tables", - "-ggdb" if not env.TargetOSIs('emscripten') else "-g", "-Wall", "-Wsign-compare", "-Wno-unknown-pragmas", @@ -2566,7 +2565,7 @@ ) if optBuild and not optBuildForSize: - env.Append( CCFLAGS=["-O3" if "O3" in selected_experimental_optimizations else "-O2"] ) + env.Append( CCFLAGS=["-O" if "O3" in selected_experimental_optimizations else "-O"] ) elif optBuild and optBuildForSize: env.Append( CCFLAGS=["-Os"] ) else: @@ -2608,8 +2607,12 @@ # setting it for both C and C++ by setting both of CFLAGS and # CXXFLAGS. + arm_march_flag = "armv8-a" + if get_option('use-hardware-crc32') == "on": + arm_march_flag += "+crc" + default_targeting_flags_for_architecture = { - "aarch64" : { "-march=" : "armv8.2-a", "-mtune=" : "generic" }, + "aarch64" : { "-march=" : arm_march_flag, "-mtune=" : "generic" }, "i386" : { "-march=" : "nocona", "-mtune=" : "generic" }, "ppc64le" : { "-mcpu=" : "power8", "-mtune=" : "power8", "-mcmodel=" : "medium" }, "s390x" : { "-march=" : "z196", "-mtune=" : "zEC12" },