From 65572f5329daec91d0943ba22babdc060c3ada97 Mon Sep 17 00:00:00 2001 From: Antonio Cardace Date: Thu, 19 Dec 2019 09:25:02 +0100 Subject: [PATCH 1/4] meson: use has_link_argument() to check linker flags support --- meson.build | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 136b8a383c..63dde4636f 100644 --- a/meson.build +++ b/meson.build @@ -154,10 +154,14 @@ if enable_ld_gc test_ldflags = ['-Wl,--gc-sections'] - foreach cflag: test_c_flags + test_ldflags + foreach cflag: test_c_flags assert(cc.has_argument(cflag), 'Unused symbol eviction requested but not supported. Use -Dld_gc=false to build without it.') endforeach + foreach ldflag: test_ldflags + assert(cc.has_link_argument(ldflag), 'Linker garbage collection requested but not supported. Use -Dld_gc=false to build without it.') + endforeach + common_flags += test_c_flags common_ldflags += test_ldflags endif From 6dc816758801caa84c4e8df8e235497a76efade3 Mon Sep 17 00:00:00 2001 From: Antonio Cardace Date: Fri, 20 Dec 2019 11:44:09 +0100 Subject: [PATCH 2/4] meson: add additional debug CFLAGS to use the same ones autotools uses --- meson.build | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/meson.build b/meson.build index 63dde4636f..095b2689ad 100644 --- a/meson.build +++ b/meson.build @@ -177,16 +177,28 @@ endif if nm_debug common_flags += cc.get_supported_arguments([ + '-Wall', + '-Wextra', '-Wdeclaration-after-statement', '-Wfloat-equal', + '-Wformat-nonliteral', + '-Wformat-security', '-Wimplicit-fallthrough', + '-Wimplicit-function-declaration', '-Winit-self', '-Wlogical-op', '-Wmissing-declarations', '-Wmissing-include-dirs', '-Wmissing-prototypes', + '-Wpointer-arith', + '-Wshadow', + '-Wshift-negative-value', + '-Wstrict-prototypes', + '-Wundef', + '-Wvla', '-Wno-duplicate-decl-specifier', '-Wno-format-truncation', + '-Wno-format-y2k', '-Wno-gnu-variable-sized-type-not-at-end', '-Wno-missing-field-initializers', '-Wno-pragmas', From eaa26408f351e77ff044edc01d113b26d87fd63e Mon Sep 17 00:00:00 2001 From: Antonio Cardace Date: Fri, 20 Dec 2019 12:25:48 +0100 Subject: [PATCH 3/4] meson: remove pid_t redefinition For some reason has_type() does not work correctly and causes redefinition of the type. --- config.h.meson | 3 --- meson.build | 4 ---- 2 files changed, 7 deletions(-) diff --git a/config.h.meson b/config.h.meson index a2874f7703..0514418138 100644 --- a/config.h.meson +++ b/config.h.meson @@ -249,9 +249,6 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ #mesondefine _POSIX_SOURCE -/* Define to `int' if does not define. */ -#mesondefine pid_t - #mesondefine HAVE_PIDFD_OPEN #mesondefine HAVE_PIDFD_SEND_SIGNAL #mesondefine HAVE_RT_SIGQUEUEINFO diff --git a/meson.build b/meson.build index 095b2689ad..14046f5a55 100644 --- a/meson.build +++ b/meson.build @@ -137,10 +137,6 @@ config_h.set('SIZEOF_INO_T', cc.sizeof('ino_t', prefix : '#include config_h.set('SIZEOF_TIME_T', cc.sizeof('time_t', prefix : '#include ')) config_h.set('SIZEOF_RLIM_T', cc.sizeof('rlim_t', prefix : '#include ')) -if not cc.has_type('pid_t', prefix: '#include ') - config_h.set('pid_t', 'int') -endif - # compiler flags common_flags = [] common_ldflags = [] From 559893a081ff64392c971aec54a00885da9e5414 Mon Sep 17 00:00:00 2001 From: Antonio Cardace Date: Thu, 19 Dec 2019 09:26:31 +0100 Subject: [PATCH 4/4] meson: bump up min version to 0.46 according to minimum requirements The following used functions: `compiler.has_link_argument`, `link_whole arg in declare_dependency`, `compiler.has_multi_link_argument` are present only from meson 0.46. --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 14046f5a55..69bbccd818 100644 --- a/meson.build +++ b/meson.build @@ -10,7 +10,7 @@ project( 'buildtype=debugoptimized', 'c_std=gnu11', ], - meson_version: '>= 0.44.0', + meson_version: '>= 0.46.0', ) nm_name = meson.project_name()