Greetings,

The gthread API has thread entry points receiving and returning void*.
VxWorks' task creation uses different conventions, so gthr-vxworks-thread.c
resorts to a __task_wrapper adaptor.

__task_wrapper currently receives the gthread_create entry point argument
directly as if it had the VxWorks signature, which is conceptually
incorrect and
causes real trouble with int/void* conversions on powerpc64.

This patch corrects the internal declarations to use more accurate
interface types and adjusts the wrapper implementation to perform explicit
conversions as needed.

This change has been exercised for more than a year across a number of VxWorks
ports based on GCC 15 (for arm, aarch64, powerpc, powerpc64, x86 and
x86_64), It builds and still helps a GCC 16 based toolchain for powerpc64.

Committing to mainline after a quick sanity check. The patch applies
directly there.

Thanks @Alexandre for crafting the patch and for identifying the issue and
in the first place :-)

Cheers!

Olivier

--

2026-11-08  Alexandre Oliva  <[email protected]>

libgcc/

        * config/gthr-vxworks-thread.c (ENTRYPTR): Rename to...
        (__gthread_entry_point_t): ... this.  Use gthread
        conventions.  Drop indirection.
        (__task_wrapper): Use VxWorks conventions for its formals,
        and convert to the gthread types.  Drop extraneous and risky
        double-underscore prefixes.  Add indirection to entry point
        pointer.
        (__gthread_create): Use __gthread_entry_point_t.

Attachment: 0001-vxworks-Straighten-the-VxWorks-task_wrapper-API.patch
Description: Binary data

Reply via email to