[PATCH] Massage cpp output before passing to awk for generating sdksyms.c

Hans de Goede hdegoede at redhat.com
Fri Feb 13 00:37:07 PST 2015


Hi,

On 11-02-15 17:04, Alan Coopersmith wrote:
> Fixes build errors when using Solaris Studio 12.4 from getting the wrong
> strings (such as __attribute__) put into the sdksyms function list.
>
> Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>

Hmm, have you seen my patch to sdksyms.sh to fix buildign with gcc5's
cpp ? It is not a very good patch, but at least it sticks to awk only,
I do not think adding sed to the mix makes things better.

What we really need is someone who knows awk to step in and help us
with both our problems and fix things properly.

So does anyone know anyone who may be able to help out with fixing
the awk stuff ?

Regards,

Hans


> ---
>   hw/xfree86/Makefile.am |    3 ++-
>   hw/xfree86/sdksyms.sh  |    7 ++++++-
>   2 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am
> index 27f2cc6..a600a75 100644
> --- a/hw/xfree86/Makefile.am
> +++ b/hw/xfree86/Makefile.am
> @@ -135,7 +135,8 @@ CLEANFILES = sdksyms.c sdksyms.dep Xorg.sh
>   EXTRA_DIST += sdksyms.sh
>
>   sdksyms.dep sdksyms.c: sdksyms.sh
> -	$(AM_V_GEN)CPP='$(CPP)' AWK='$(AWK)' $(SHELL) $(srcdir)/sdksyms.sh $(top_srcdir) $(CFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS)
> +	$(AM_V_GEN)CPP='$(CPP)' AWK='$(AWK)' SED='$(SED)' $(SHELL) \
> +	 $(srcdir)/sdksyms.sh $(top_srcdir) $(CFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS)
>
>   SDKSYMS_DEP = sdksyms.dep
>   -include $(SDKSYMS_DEP)
> diff --git a/hw/xfree86/sdksyms.sh b/hw/xfree86/sdksyms.sh
> index 2305073..3b9363a 100755
> --- a/hw/xfree86/sdksyms.sh
> +++ b/hw/xfree86/sdksyms.sh
> @@ -314,7 +314,12 @@ shift
>   LC_ALL=C
>   export LC_ALL
>   ${CPP:-cpp} "$@" sdksyms.c > /dev/null || exit $?
> -${CPP:-cpp} "$@" sdksyms.c | ${AWK:-awk} -v topdir=$topdir '
> +# Some cpps add spaces in the middle of __attribute__((visibility(...)))
> +# so we need to remove them for the following awk script to work.
> +${CPP:-cpp} "$@" sdksyms.c | \
> +    ${SED:-sed} -e 's/( /(/g' -e 's/_ (/_(/g' -e 's/ )/)/g' \
> +    -e 's/visibility (/visibility(/' | \
> +    ${AWK:-awk} -v topdir=$topdir '
>   BEGIN {
>       sdk = 0;
>       print("/*");
>


More information about the xorg-devel mailing list