Skip to content

Commit 20406af

Browse files
authored
[runtime] Have the runtime use the compiler builtin for alloca on NetBSD (#73480)
Most of the tests were failing with the following in their logs.. | /usr/bin/ld: /home/brad/llvm-build/runtimes/runtimes-bins/openmp/runtime/src/libomp.so: warning: Warning: reference to the libc supplied alloca(3); this most likely will not work. Please use the compiler provided version of alloca(3), by supplying the appropriate compiler flags (e.g. -std=gnu99). By making use of __builtin_alloca.. before: Total Discovered Tests: 353 Unsupported: 59 (16.71%) Passed : 51 (14.45%) Failed : 243 (68.84%) after: Total Discovered Tests: 353 Unsupported: 59 (16.71%) Passed : 290 (82.15%) Failed : 4 (1.13%)
1 parent 4a2db23 commit 20406af

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

openmp/runtime/src/kmp_safe_c_api.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@ template <typename T> struct kmp_get_rmax_t<T, true> {
5656

5757
// For now, these macros use the existing API.
5858

59+
#if KMP_OS_NETBSD
60+
#define KMP_ALLOCA __builtin_alloca
61+
#else
5962
#define KMP_ALLOCA alloca
63+
#endif
6064
#define KMP_MEMCPY_S(dst, bsz, src, cnt) memcpy(dst, src, cnt)
6165
#define KMP_SNPRINTF snprintf
6266
#define KMP_SSCANF sscanf

0 commit comments

Comments
 (0)