abi: Differentiate on architectures and compilers
aarch64 and x86_64 have different stack orderings for parameters to
decode_get_date_time_resp() and
decode_get_fru_record_table_metadata_resp(). This triggers a false ABI
break warning from abi-compliance-checker, as we weren't differentiating
on architecture.
Rearrange the compliance check to support multiple architectures and
compilers.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: Ida057dc69a5a6eb33304bf6ead236b1d12ab048e
diff --git a/meson.build b/meson.build
index 9bb4f5a..a249774 100644
--- a/meson.build
+++ b/meson.build
@@ -64,30 +64,35 @@
if get_option('tests').enabled()
subdir('tests')
- if get_option('abi-compliance-check').allowed()
+ c_suite = meson.get_compiler('c').get_id()
+ cpp_suite = meson.get_compiler('cpp').get_id()
+
+ if get_option('abi-compliance-check').allowed() and c_suite == cpp_suite and c_suite == 'gcc'
+ host = host_machine.cpu_family()
+ baseline_dump = meson.project_source_root() / 'abi' / host / '@0@.dump'.format(c_suite)
+
abi_dumper = find_program('abi-dumper',
native: true,
required: get_option('abi-compliance-check'))
abi_compliance_checker = find_program('abi-compliance-checker',
native: true,
required: get_option('abi-compliance-check'))
- public_api_dir = meson.project_source_root() / 'include'
- baseline_dump = meson.project_source_root() / 'abi' / 'baseline.dump'
+
+ test_abi_compliance = abi_dumper.found() and \
+ abi_compliance_checker.found() and \
+ import('fs').is_file(baseline_dump)
+
current_dump = custom_target('abi-dump',
input: libpldm,
output: 'current.dump',
command: [ abi_dumper,
'-public-headers',
- public_api_dir,
+ meson.project_source_root() / 'include',
'@INPUT@',
'-o',
'@OUTPUT@',
'-lver',
meson.project_version()])
- test_abi_compliance = abi_dumper.found() and \
- abi_compliance_checker.found() and \
- meson.get_compiler('c').get_id() == 'gcc' and \
- meson.get_compiler('cpp').get_id() == 'gcc'
abi_compliance = custom_target('abi-compliance',
input: [baseline_dump, current_dump],
output: 'abi-compliance',