package/jemalloc: fix build on m68k/uClibc

include/jemalloc/internal/jemalloc_internal_inlines_a.h:16:32: error:
 implicit declaration of function 'sched_getcpu'; did you mean
 'SYS_getcpu'? [-Wimplicit-function-declaration]
   16 |         return (malloc_cpuid_t)sched_getcpu();

Added -D_GNU_SOURCE to CFLAGS because

  extern int sched_getcpu

is wrapped with __USE_GNU:
https://github.com/wbx-github/uclibc-ng/blob/v1.0.57/libc/sysdeps/linux/common/bits/sched.h#L80C1-L80C17

Fixes:
https://autobuild.buildroot.net/results/57c/57c68aad9abcce7621fbff52081da041485e8830/

Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
Signed-off-by: Arnout Vandecappelle <arnout@rnout.be>
(cherry picked from commit 6b15fa64e6)
Signed-off-by: Thomas Perale <thomas.perale@mind.be>
This commit is contained in:
Bernd Kuhls
2026-04-18 23:55:34 +02:00
committed by Thomas Perale
parent df47e4fec2
commit 4539cb556b

View File

@@ -12,11 +12,15 @@ JEMALLOC_LICENSE_FILES = COPYING
JEMALLOC_INSTALL_STAGING = YES
JEMALLOC_CONFIG_SCRIPTS = jemalloc-config
JEMALLOC_CFLAGS = $(TARGET_CFLAGS) -D_GNU_SOURCE
# gcc bug internal compiler error: in merge_overlapping_regs, at
# regrename.c:304. This bug is fixed since gcc 6.
ifeq ($(BR2_or1k):$(BR2_TOOLCHAIN_GCC_AT_LEAST_6),y:)
JEMALLOC_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -O0"
JEMALLOC_CFLAGS += -O0
endif
JEMALLOC_CONF_ENV += CFLAGS="$(JEMALLOC_CFLAGS)"
$(eval $(autotools-package))
$(eval $(host-autotools-package))