[PATCH xserver] sdksyms: Tighten up the symbols we add to the magic table

Jon Turney jon.turney at dronecode.org.uk
Mon Mar 6 18:23:36 UTC 2017


On 16/02/2017 19:00, Adam Jackson wrote:
> The code as written would match anything declared extern. _X_EXPORT is
> what we really mean here. That's a macro, so check for what it expands
> to and skip if not found.
> ---
>  hw/xfree86/sdksyms.sh | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/hw/xfree86/sdksyms.sh b/hw/xfree86/sdksyms.sh
> index cf26892..10909d0 100755
> --- a/hw/xfree86/sdksyms.sh
> +++ b/hw/xfree86/sdksyms.sh
> @@ -343,6 +343,10 @@ BEGIN {
>             n = 1;
>          }
>
> +        # only match _X_EXPORT
> +        if ($n !~ /^(__attribute__..visibility..default|__global)/)
> +            next;
> +
>  	# skip attribute, if any
>  	while ($n ~ /^(__attribute__|__global)/ ||
>  	    # skip modifiers, if any
>

Unfortunately, one of the possible definitions of _X_EXPORT in 
Xfuncproto.h is empty, in which case, this leaves us with nothing in 
sdksyms.c

This would be much easier if we could use -fdirectives-only, but I guess 
this needs to be cpp-agnostic.

Not sure how to fix this short of having a define to make Xfuncproto.h 
not define the _X_EXPORT macro, and turning that on when sdksyms.sh 
invokes cpp, and having sdksyms.sh recognize a literal X_EXPORT...



More information about the xorg-devel mailing list