From 7bfaeaa590d8b4842aaafc5ff392caa624e269d3 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Fri, 14 Aug 2020 11:26:44 +0100 Subject: [PATCH] aco: pass -fno-exceptions and -fno-rtti MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Acked-by: Timur Kristóf Reviewed-by: Eric Anholt Part-of: --- 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 59d0f5f..b82b69a 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 003d76b..74073cd 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, ], -- 2.7.4