[gcc r16-8315] libgcc: vxworks: work around warnings promoted to errors on aarch64

Alexandre Oliva aoliva@gcc.gnu.org
Sat Mar 28 03:27:59 GMT 2026


https://gcc.gnu.org/g:229c58121d534233978578b72b32f94b0638b1b5

commit r16-8315-g229c58121d534233978578b72b32f94b0638b1b5
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Wed Mar 25 15:04:53 2026 -0300

    libgcc: vxworks: work around warnings promoted to errors on aarch64
    
    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.
    
    
    for  libgcc/ChangeLog
    
            * config/gthr-vxworks-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.

Diff:
---
 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 0c09604204a6..2ca69cf04006 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 ca0d0cfcb6a2..3967e0065469 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)


More information about the Gcc-cvs mailing list