In the questions which followed my talk at the recent collaboration meeting
the topic of ABI compatibility came up again. Following up on this I revisited
what I see as the necessary first step in doing anything about ABI, which is some
way to quantify changes, especially with c++.
The tool which gets mentioned is abi-compliance-checker. Unfortunately, in the past
I've not had success in having this tool detect a deliberate change.
eg. One test is to add an argument with a default value to a public method.
Because of the default value, this is an API compatible change, but
is a clear ABI break as the c++ mangled symbol name changes.
> --- a/src/pvxs/client.h
> +++ b/src/pvxs/client.h
> @@ -717,7 +717,7 @@ public:
> MonitorBuilder& maskDisconnected(bool m = true) { _maskDisconn = m; return *this; }
>
> PVXS_API
> - std::shared_ptr<Subscription> exec();
> + std::shared_ptr<Subscription> exec(int =0);
>
> friend struct Context::Pvt;
> };
A diff of the symbol names in the resulting library shows
> --- orig.nm 2020-10-27 10:46:37.085745237 -0700
> +++ change.nm 2020-10-27 10:48:31.942183007 -0700
> @@ -663,7 +663,7 @@
> t _ZN4pvxs6client13OperationBaseD1Ev
> t _ZN4pvxs6client13OperationBaseD2Ev
> T _ZN4pvxs6client14ConnectBuilder4execEv
> -T _ZN4pvxs6client14MonitorBuilder4execEv
> +T _ZN4pvxs6client14MonitorBuilder4execEi
> t _ZN4pvxs6client16SubscriptionImpl12disconnectedERKSt10shared_ptrINS0_13OperationBaseEE
> t _ZN4pvxs6client16SubscriptionImpl3popEv
> t _ZN4pvxs6client16SubscriptionImpl5_nameB5cxx11Ev
.. omitting the other 26 symbol names which also change. yay c++ :P
With the last abi-dumper release 1.1, as packaged with Debian 10,
this change is not detected.
I've realized that this has been fixed since the 1.1 release (circa 2017).
The lastest (circa 2019) revisions[1] do detect this ABI change.
I'm still not certain how this test could fit into my development/release workflow.
FYI. my methodology
> make distclean -s
> make -j8 CROSS_COMPILER_TARGET_ARCHS= OPT_CFLAGS='-g -Og' OPT_CXXFLAGS='-g -Og' src
>
> nm lib/linux-x86_64/libpvxs.so|sed -e 's|^[0-9a-f]*\s*||' > orig.nm
> abi-dumper lib/linux-x86_64/libpvxs.so.* -o orig.dump -public-headers include -lver 0
>
> # change source ...
>
> make distclean -s
> make -j8 CROSS_COMPILER_TARGET_ARCHS= OPT_CFLAGS='-g -Og' OPT_CXXFLAGS='-g -Og' src
>
> nm lib/linux-x86_64/libpvxs.so|sed -e 's|^[0-9a-f]*\s*||' > change.nm
> abi-dumper lib/linux-x86_64/libpvxs.so.* -o change.dump -public-headers include -lver 1
>
> diff -u orig.nm change.nm|less
>
> abi-compliance-checker -l libpvxs -old orig.dump -new change.dump
[1] Versions I tested with:
vtable-dumper 7c326e9a1e5ef7c96fc47579b795c998b58ec2e7
abi-dumper 3d6dbb6d48d10579984fb7fda2e79d3d73e10f70
abi-compliance-checker f60ce442c33f1d5cda1cec7cfddee24af1777572
- Navigate by Date:
- Prev:
Jenkins build became unstable: epics-7.0 » linux32 #264 APS Jenkins via Core-talk
- Next:
epics-base-7.0-win64-test - Build # 227 - Fixed! APS Jenkins via Core-talk
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
<2020>
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Jenkins build became unstable: epics-7.0 » linux32 #264 APS Jenkins via Core-talk
- Next:
[Bug 1902285] [NEW] caput never uses ca_get_callback() Andrew Johnson via Core-talk
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
<2020>
2021
2022
2023
2024
|