aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorTom Callaway <spotrh@gmail.com>2020-09-11 05:15:43 -0400
committerGitHub <noreply@github.com>2020-09-11 10:15:43 +0100
commit83f682385543d949e4ee5e1271a96beddaa9a23b (patch)
tree849e76efe41e23089f5410d7f0b935232e01f15e /meson.build
parent86f40b858487ca218906f3306e5ec839d926f647 (diff)
downloadlibfuse-83f682385543d949e4ee5e1271a96beddaa9a23b.tar.gz
Implement GCC 10 style symbol versioning (#545)
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build17
1 files changed, 17 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index dbef8ab..e17ebb0 100644
--- a/meson.build
+++ b/meson.build
@@ -87,6 +87,23 @@ if not cc.compiles(code, args: [ '-O0', '-Werror=unused-result' ])
add_project_arguments('-Wno-unused-result', language: 'c')
endif
+# gcc-10 and newer support the symver attribute which we need to use if we
+# want to support LTO
+code = '''
+__attribute__((symver ("get@@TEST_0"))) int get_4() {
+ return 4;
+}
+int main(void) {
+ (void) get_4();
+ return 0;
+}'''
+if cc.compiles(code, args: [ '-O0', '-c'])
+ message('Compiler supports symver attribute')
+ add_project_arguments('-DHAVE_SYMVER_ATTRIBUTE', language: 'c')
+else
+ message('Compiler does not support symver attribute')
+endif
+
# '.' will refer to current build directory, which contains config.h
include_dirs = include_directories('include', 'lib', '.')