In RTP mode, defining TLS_DELETE_HOOK_ARG as NULL AKA 0 elicits a
warning, that casting it to TASK_ID avoids.

objLibP.h defines an inline function that, depending on the
configuration, will have unused parameters.  Allow warnings about
them.

vxTas calls are supposed to take __vx_tas_t, but upon passing it that
on aarch64, we get warnings about discarding volatile qualifiers, that
not even explicit type casts avoid.  So, allow the warnings.

Regstrapped on x86_64-linux-gnu.  Also tested with ppc-vx7r2,
ppc64-vx7r2, arm-vx7r2, and aarch64-vx7r2.  Ok to install?


for  libgcc/ChangeLog

        * config/gthr-vworks-tls.c (TLS_DELETE_HOOK_ARG): Type-cast
        NULL constant to avoid warning.
        * config/t-vxworks (LIBGCC2_CFLAGS): Tolerate unused-parameter
        and discarded-qualifiers errors.
---
 libgcc/config/gthr-vxworks-tls.c |    2 +-
 libgcc/config/t-vxworks          |   13 +++++++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/libgcc/config/gthr-vxworks-tls.c b/libgcc/config/gthr-vxworks-tls.c
index 0c09604204a69..2ca69cf040062 100644
--- a/libgcc/config/gthr-vxworks-tls.c
+++ b/libgcc/config/gthr-vxworks-tls.c
@@ -174,7 +174,7 @@ static __gthread_once_t tls_init_guard = 
__GTHREAD_ONCE_INIT;
 
 #ifdef __RTP__
 #define TLS_DELETE_HOOK_ARG_DECL TASK_ID tcb ATTRIBUTE_UNUSED
-#define TLS_DELETE_HOOK_ARG NULL
+#define TLS_DELETE_HOOK_ARG ((TASK_ID)0)
 #else
 #define TLS_DELETE_HOOK_ARG_DECL void
 #define TLS_DELETE_HOOK_ARG
diff --git a/libgcc/config/t-vxworks b/libgcc/config/t-vxworks
index ca0d0cfcb6a2e..3967e0065469b 100644
--- a/libgcc/config/t-vxworks
+++ b/libgcc/config/t-vxworks
@@ -37,6 +37,19 @@ LIBGCC2_INCLUDES = -nostdinc -include vxworks-predef.h -I. \
   -isystem $(MULTIBUILDTOP)../../gcc/include-fixed$(MULTISUBDIR) \
   -isystem $(MULTIBUILDTOP)../../gcc/include
 
+# The aarch64-vx7r2 objLibP.h defines an inline function with unused
+# parameters.  Ideally using -isystem instead of -I above would work
+# around that, but then we get conflicts between GCC's and VxWorks'
+# regs.h.
+
+LIBGCC2_CFLAGS += -Wno-error=unused-parameter
+
+# aarch64-vx7r2 also gets complaints about dropping volatile
+# qualifiers in vxTas calls taking a pointer to __vx_tas_t.
+# An explicit cast doesn't avoid the warning, alas.
+
+LIBGCC2_CFLAGS += -Wno-error=discarded-qualifiers
+
 # Use these also for the vxcrstuff objects (.e.g for version.h), on top of
 # the options possibly already set specifically for the target:
 CRTSTUFF_T_CFLAGS += $(LIBGCC2_INCLUDES)

-- 
Alexandre Oliva, happy hacker            https://blog.lx.oliva.nom.br/
Free Software Activist     FSFLA co-founder     GNU Toolchain Engineer
More tolerance and less prejudice are key for inclusion and diversity.
Excluding neuro-others for not behaving ""normal"" is *not* inclusive!

Reply via email to