]> xenbits.xensource.com Git - unikraft/libs/newlib.git/commitdiff
build: export -D__DYNAMIC_REENT__ to global C[XX]FLAGS if used
authorFlorian Schmidt <florian.schmidt@neclab.eu>
Fri, 10 May 2019 08:49:38 +0000 (10:49 +0200)
committerFlorian Schmidt <florian.schmidt@neclab.eu>
Mon, 13 May 2019 07:41:33 +0000 (09:41 +0200)
__DYNAMIC_REENT__ is used as a preprocessor flag in several public
header files (most importantly, stdio.h). This means that if newlib is
compiled with one set of flags and the rest of the build with another,
the header file and the implementation don't match. This leads to
problems such as stdin/stdoud/stderr not working because they always use
the (non-functional) versions inside _impure_data instead instead of the
current environment's private _reent struct.

Signed-off-by: Florian Schmidt <florian.schmidt@neclab.eu>
Reviewed-by: Costin Lupu <costin.lupu@cs.pub.ro>
Makefile.uk

index 82e4e6efa2f20f1d7ed398349988727e235317a7..f49264e52b67c39e881d829b4bd4c28814435b48 100644 (file)
@@ -318,7 +318,8 @@ LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/posix/regfree.c
 ################################################################################
 ifeq ($(CONFIG_HAVE_SCHED),y)
 # if scheduling enabled, then Unikraft provides __getreent()
-LIBNEWLIBC_CFLAGS-y += -D__DYNAMIC_REENT__
+CFLAGS-$(CONFIG_LIBNEWLIBC) += -D__DYNAMIC_REENT__
+CXXFLAGS-$(CONFIG_LIBNEWLIBC) += -D__DYNAMIC_REENT__
 else
 LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/reent/getreent.c
 endif