Commit Graph

10 Commits

Author SHA1 Message Date
Eric Anholt a8fb7ac1c4 mapi: Fix symbols check with ASan enabled.
ASan apparently introduces public symbols with __odr_asan as the prefix.
Fixes unit tests when building with ASan.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7936>
2020-12-15 19:39:29 +00:00
Eric Anholt ad6189920b symbols-check: Add __cxa_guard_* to the list of approved symbols.
These are introduced by the compiler during static local initialization in
c++ for thread safety.  This seems to end up being public in the driver
with --static-libc++ on android.

Reviewed-by: <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6700>
2020-10-14 16:54:59 +00:00
Pierre-Eric Pelloux-Prayer 8da237428c bin/symbols-check.py: add --ignore-symbol argument
This will be used by radv to ignore 'the ac_init_llvm_once' symbol,
which is not part of vulkan-icd-symbols.txt but is required to be
exported to improve interop with radeonsi/vaapi.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5648>
2020-07-10 11:57:11 +02:00
Eric Engestrom 2a61a8d95a bin/symbols-check: explain C++ symbols workaround
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5556>
2020-06-23 11:05:39 +00:00
Eric Engestrom 4d5cde1fff meson: add windows support to symbols checks
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviwed-by: Dylan Baker <dylan@pnwbakers>
2019-11-05 20:31:37 +00:00
Eric Engestrom f1c22390f7 symbols-check: ignore exported C++ symbols
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2019-10-13 17:40:43 +01:00
Eric Engestrom 8f1cdac793 symbols-check: fix `nm` invocation on MacOS
According to Mac OSX's man page [1], this is how we should get the list
of exported symbols:
  nm -g -P foo.dylib

-g to only show the exported symbols
-P to show it in a "portable" format, ie. readable by a script

Since this is supported by GNU nm as well, let's use that everywhere,
although some care needs to be taken as there are some differences in
the output.

[1] https://www.unix.com/man-page/osx/1/nm/

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Tested-by: Vinson Lee <vlee@freedesktop.org>
2019-08-04 11:06:27 +01:00
Eric Engestrom 59f8809f3c symbols-check: discard platform symbols early
(as the comment there already claimed)

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Tested-by: Vinson Lee <vlee@freedesktop.org>
2019-08-04 11:06:27 +01:00
Eric Engestrom 81b3d141b3 symbols-check: skip test if we can't get the symbols list
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Tested-by: Vinson Lee <vlee@freedesktop.org>
2019-08-04 11:06:27 +01:00
Eric Engestrom 176f350fcf symbols-check: introduce new python script
I've re-written this in bash a couple times over the years, and then
I realised python is much more portable and already required by Mesa, so
we might as well make use of it.

I decided to still use the build system's NM instead of re-implementing
symbols extraction, to offload the complexity of keeping it compatible
with many systems (Linux, Unix, BSD, MacOS, etc.), especially when
cross-building.

This new script checks not only that nothing is exported when it
shouldn't be, but also that everything that should be exported is.
Sometimes, some symbols _can_ be exported but don't have to be, in which
case they can be prefixed with `(optional)`.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2019-07-10 11:27:51 +00:00