This patch
commit a36f0edbec6f2ef36792eda245fa7e512d032872
Author: Arsen Arsenović <[email protected]>
Date: Thu Apr 23 10:47:38 2026 +0000
libgomp: let plugins handle allocating the target variable table
broke Solaris bootstrap:
In file included from libgomp/oacc-parallel.c:30:
libgomp/oacc-parallel.c: In function ‘GOACC_parallel_keyed’:
libgomp/oacc-parallel.c:297:45: error: implicit declaration of function
‘alloca’ [-Wimplicit-function-declaration]
297 | : gomp_offload_session_new (acc_dev, alloca));
| ^~~~~~
libgomp/libgomp.h:1510:21: note: in definition of macro
‘gomp_offload_session_new’
1510 | void *session = alloc (devicep->session.size); \
| ^~~~~
libgomp/oacc-parallel.c:297:45: error: incompatible implicit declaration of
built-in function ‘alloca’ [-Werror=builtin-declaration-mismatch]
libgomp/libgomp.h:1510:21: note: in definition of macro
‘gomp_offload_session_new’
1510 | void *session = alloc (devicep->session.size); \
| ^~~~~
and similarly in target.c.
alloca is declared in <alloca.h> on Solaris. Therefore the code should
use gomp_alloca instead, which is just for such cases.
Bootstrapped without regressions on i386-pc-solaris2.11,
sparc-sun-solaris2.11, and x86_64-pc-linux-gnu.
Ok for trunk?
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
2026-06-01 Rainer Orth <[email protected]>
libgomp:
* oacc-parallel.c (GOACC_parallel_keyed): Use gomp_alloca instead
of alloca.
* target.c (GOMP_target): Likewise.
(GOMP_target_ext): Likewise.
# HG changeset patch
# Parent 6e02c5b6614236742bf225e4f1db81b1b3a1848c
libgomp: Don't use alloca directly
diff --git a/libgomp/oacc-parallel.c b/libgomp/oacc-parallel.c
--- a/libgomp/oacc-parallel.c
+++ b/libgomp/oacc-parallel.c
@@ -294,7 +294,7 @@ GOACC_parallel_keyed (int flags_m, void
/* Prepare an offload session. */
struct gomp_offload_session *session
= (aq ? gomp_offload_session_new (acc_dev, gomp_malloc)
- : gomp_offload_session_new (acc_dev, alloca));
+ : gomp_offload_session_new (acc_dev, gomp_alloca));
struct target_mem_desc *tgt
= goacc_map_vars (acc_dev, aq, mapnum, hostaddrs, NULL, sizes, kinds, true,
diff --git a/libgomp/target.c b/libgomp/target.c
--- a/libgomp/target.c
+++ b/libgomp/target.c
@@ -3251,7 +3251,7 @@ GOMP_target (int device, void (*fn) (voi
return gomp_target_fallback (fn, hostaddrs, devicep, NULL);
struct gomp_offload_session *session
- = gomp_offload_session_new (devicep, alloca);
+ = gomp_offload_session_new (devicep, gomp_alloca);
htab_t refcount_set = htab_create (mapnum);
struct target_mem_desc *tgt_vars
@@ -3577,7 +3577,7 @@ GOMP_target_ext (int device, void (*fn)
htab_t refcount_set = NULL;
struct gomp_offload_session *session
- = gomp_offload_session_new (devicep, alloca);
+ = gomp_offload_session_new (devicep, gomp_alloca);
if (devicep->capabilities & GOMP_OFFLOAD_CAP_SHARED_MEM)
{