Mesa (master): aco: pass -fno-exceptions and -fno-rtti

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Sep 15 14:48:59 UTC 2020


Module: Mesa
Branch: master
Commit: 7bfaeaa590d8b4842aaafc5ff392caa624e269d3
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7bfaeaa590d8b4842aaafc5ff392caa624e269d3

Author: Rhys Perry <pendingchaos02 at gmail.com>
Date:   Fri Aug 14 11:26:44 2020 +0100

aco: pass -fno-exceptions and -fno-rtti

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 at gmail.com>
Acked-by: Timur Kristóf <timur.kristof at gmail.com>
Reviewed-by: Eric Anholt <eric at anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6315>

---

 src/amd/compiler/meson.build       | 3 +++
 src/amd/compiler/tests/meson.build | 3 ++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/amd/compiler/meson.build b/src/amd/compiler/meson.build
index 59d0f5fee7a..b82b69a2aeb 100644
--- a/src/amd/compiler/meson.build
+++ b/src/amd/compiler/meson.build
@@ -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
diff --git a/src/amd/compiler/tests/meson.build b/src/amd/compiler/tests/meson.build
index 003d76b3bdd..74073cda427 100644
--- a/src/amd/compiler/tests/meson.build
+++ b/src/amd/compiler/tests/meson.build
@@ -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,
     ],



More information about the mesa-commit mailing list