aco: pass -fno-exceptions and -fno-rtti
authorRhys Perry <pendingchaos02@gmail.com>
Fri, 14 Aug 2020 10:26:44 +0000 (11:26 +0100)
committerMarge Bot <eric+marge@anholt.net>
Tue, 15 Sep 2020 14:36:57 +0000 (14:36 +0000)
We don't use exceptions or RTTI at all, so pass this flag to the compiler
to allow it to create better code.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6315>

src/amd/compiler/meson.build
src/amd/compiler/tests/meson.build

index 59d0f5f..b82b69a 100644 (file)
@@ -85,6 +85,8 @@ libaco_files = files(
   'aco_validate.cpp',
 )
 
+cpp_args_aco = cpp.get_supported_arguments(['-fno-exceptions', '-fno-rtti'])
+
 _libaco = static_library(
   'aco',
   [libaco_files, aco_opcodes_c, aco_opcodes_h, aco_builder_h],
@@ -100,6 +102,7 @@ _libaco = static_library(
   ],
   gnu_symbol_visibility : 'hidden',
   build_by_default : true,
+  cpp_args : cpp_args_aco,
 )
 
 # Also link with aco
index 003d76b..74073cd 100644 (file)
@@ -46,7 +46,8 @@ test(
     [aco_tests_files, gen_spirv_files],
     cpp_args : ['-DACO_TEST_SOURCE_DIR="@0@"'.format(meson.current_source_dir()),
                 '-DACO_TEST_BUILD_ROOT="@0@"'.format(meson.build_root()),
-                '-DACO_TEST_PYTHON_BIN="@0@"'.format(prog_python.path())],
+                '-DACO_TEST_PYTHON_BIN="@0@"'.format(prog_python.path())] +
+               cpp_args_aco,
     include_directories : [
       inc_include, inc_src, inc_gallium, inc_compiler, inc_mesa, inc_mapi, inc_amd, inc_amd_common, inc_amd_common_llvm,
     ],