[2/3] lib: add experimental symbols check to meson build

Message ID 20191008143628.46054-3-bruce.richardson@intel.com
State New
Delegated to: Thomas Monjalon
Headers show
Series
  • Add scanning for experimental symbols to meson
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Bruce Richardson Oct. 8, 2019, 2:36 p.m.
Call check-experimental-syms.sh script as part of the meson build to ensure
that all functions are correctly tagged.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 buildtools/meson.build |  2 ++
 lib/meson.build        | 12 +++++++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

Patch

diff --git a/buildtools/meson.build b/buildtools/meson.build
index 32c79c130..8d0b9e0cd 100644
--- a/buildtools/meson.build
+++ b/buildtools/meson.build
@@ -5,6 +5,8 @@  subdir('pmdinfogen')
 
 pmdinfo = find_program('gen-pmdinfo-cfile.sh')
 
+check_experimental_syms = find_program('check-experimental-syms.sh')
+
 # set up map-to-def script using python, either built-in or external
 python3 = import('python').find_installation(required: false)
 if python3.found()
diff --git a/lib/meson.build b/lib/meson.build
index e5ff83893..5be5c8559 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -128,11 +128,21 @@  foreach l:libraries
 				command: [map_to_def_cmd, '@INPUT@', '@OUTPUT@'],
 				input: version_map,
 				output: 'rte_@0@_exports.def'.format(name))
+			lk_deps = [version_map, def_file]
 			if is_windows
 				lk_args = ['-Wl,/def:' + def_file.full_path(),
 					'-Wl,/implib:lib\\' + implib]
 			else
 				lk_args = ['-Wl,--version-script=' + version_map]
+				# on unix systems check the output of the
+				# experimental syms script, using it as a
+				# dependency of the .so build
+				lk_deps += custom_target(name + '.exp_chk',
+					command: [check_experimental_syms,
+						version_map, '@INPUT@'],
+					capture: true,
+					input: static_lib,
+					output: name + '.exp_chk')
 			endif
 
 			shared_lib = shared_library(libname,
@@ -142,7 +152,7 @@  foreach l:libraries
 					dependencies: shared_deps,
 					include_directories: includes,
 					link_args: lk_args,
-					link_depends: [version_map, def_file],
+					link_depends: lk_deps,
 					version: lib_version,
 					soversion: so_version,
 					install: true)