diff --git a/pkg/jerryscript/Makefile.include b/pkg/jerryscript/Makefile.include
index 2c4e51777bd477ae3a8d79f7dbc722aee2dee9de..fdf28101d4781e6dbdc1f304e58265add61f3d3b 100644
--- a/pkg/jerryscript/Makefile.include
+++ b/pkg/jerryscript/Makefile.include
@@ -1,9 +1,2 @@
 INCLUDES += -I$(PKGDIRBASE)/jerryscript/jerry-core/include
 INCLUDES += -I$(PKGDIRBASE)/jerryscript/jerry-ext/include
-
-ifneq (,$(filter cortex-m%,$(CPU_ARCH)))
-  # jerryscript package package is not using system includes right now, so
-  # many newlib hearders (not even stdio.h) is found
-  # Fixed in #9821 (so remove when merged)
-  TOOLCHAINS_BLACKLIST += llvm
-endif
diff --git a/pkg/jerryscript/Makefile.jerryscript b/pkg/jerryscript/Makefile.jerryscript
index 504c79590ffbaac3ba106a6c66172bae07199121..a5ca47b2d61d65ec8a3800da3bd4b772d486297b 100644
--- a/pkg/jerryscript/Makefile.jerryscript
+++ b/pkg/jerryscript/Makefile.jerryscript
@@ -6,6 +6,20 @@ EXT_CFLAGS :=-D__TARGET_RIOT
 
 ifeq ($(TOOLCHAIN)_$(BOARD),llvm_native)
   EXT_CFLAGS :=-D__TARGET_RIOT -Wno-conversion
+else ifeq (esp32,$(CPU))
+  # The esp32 C newlib version 2.2.0 has errors when compiling with warnings
+  # that are enabled by jerryscript build system so disable them for this cpu:
+  #  * -Wundef: stdio.h: `__GNU_VISIBLE` and `__BSD_VISIBLE` are not defined
+  EXT_CFLAGS += -Wno-undef -Wno-error=undef
+else ifeq (esp8266,$(CPU))
+  # The esp8266 C newlib version 3.0.0 has errors when compiling with warnings
+  # that are enabled by jerryscript build system so disable them for this cpu:
+  #  * -Wundef
+  #  * -Wconversion
+  #  * -Wsign-conversion
+  EXT_CFLAGS += -Wno-undef -Wno-error=undef
+  EXT_CFLAGS += -Wno-conversion -Wno-error=conversion
+  EXT_CFLAGS += -Wno-sign-conversion -Wno-error=sign-conversion
 endif
 
 .PHONY: all libjerry
@@ -25,7 +39,7 @@ libjerry:
 	 -DJERRY_LIBM=OFF \
 	 -DJERRY_CMDLINE=OFF \
 	 -DHAVE_TIME_H=0 \
-	 -DEXTERNAL_COMPILE_FLAGS="$(EXT_CFLAGS)" \
+	 -DEXTERNAL_COMPILE_FLAGS="$(INCLUDES) $(EXT_CFLAGS)" \
 	 -DMEM_HEAP_SIZE_KB=$(JERRYHEAP)
 
 	"$(MAKE)" -C $(BUILD_DIR) jerry-core jerry-ext jerry-port-default-minimal