Skip to content

Commit de9c27b

Browse files
sergioamrTilmann Scheller
authored andcommitted
Remove problems with gettimeofday, newlibc and zephyr SDK
Fix Zephyr build With the changes to the zephyr sdk, gettimeofday is being guarded by XOPEN_SOURCE_EXTENDED which requires at least 700 on XOPEN_SOURCE to be active This little patch also helps on removing most of the warnings we had before related to that issue. More info on this feature: http://man7.org/linux/man-pages/man7/feature_test_macros.7.html Another option was to enable _GNU_SOURCE for this port. There are still some harmless warnings related to __sputc_r for which we still require the convertion warning. Tested on qemu_cortex_m3, qemu_x86, arduino_101 and frdm_k64f. Zephyr Sdk 0.8.2, Zephyr 1.5.0-rc4 & Zephyr ec39b216 Closes #1311. JerryScript-DCO-1.0-Signed-off-by: Sergio Martinez [email protected]
1 parent 57d8b39 commit de9c27b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

targets/zephyr/Makefile.zephyr

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ EXT_CFLAGS += -Wall -Wno-format-zero-length -Wno-pointer-sign
8484
EXT_CFLAGS += -Werror=format -Werror=implicit-int -Wno-unused-but-set-variable
8585
EXT_CFLAGS += -Wno-main -Wno-strict-aliasing -Wno-old-style-declaration
8686
EXT_CFLAGS += -Wno-error=format=
87-
EXT_CFLAGS += -D_XOPEN_SOURCE
87+
EXT_CFLAGS += -D_XOPEN_SOURCE=700
8888

8989
# Pass2
9090
-include $(ZEPHYR_BASE)/scripts/Makefile.toolchain.$(ZEPHYR_GCC_VARIANT)
@@ -94,9 +94,8 @@ CC = $(CROSS_COMPILE)gcc
9494
ZEPHYR_LIBC_INC = $(subst -I,,$(TOOLCHAIN_CFLAGS))
9595
LIB_INCLUDE_DIR += -L $(CURDIR)/$(OUTPUT)
9696

97-
# TODO: Order of includes seems to have changed and time_t seems to be defined differently. Temporary disable the conversion and sign-conversion until we find what is happening
98-
# this will generate warnings on the default date port.
99-
EXT_CFLAGS += -Wno-error=conversion -Wno-error=sign-conversion
97+
# TODO: There is a warning when compiling in some architectures related to __sputc_r
98+
EXT_CFLAGS += -Wno-error=conversion
10099
EXT_CFLAGS += $(LIB_INCLUDE_DIR)
101100
EXT_CFLAGS += $(TOOLCHAIN_CFLAGS)
102101

0 commit comments

Comments
 (0)