Skip to content

Commit cefbba5

Browse files
committed
Build newlib with POSIX mode
- newlib was default to XOPEN MODE before 2018/12/6[1], but newlib decide to remove XOPEN mode SVID3 mode, and change the default IEEE mode. - The problem is IEEE won't set errno on several math function, so build with POSIX mode would be better for newlib. - For newlib nano, we might able to build with _IEEE_LIBM in future to reduce code size, and improve performance. [1] https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=commit;h=b14a879d85b171960df789ac8ba2332004f838e0
1 parent 0964df6 commit cefbba5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Makefile.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,8 +477,8 @@ stamps/build-newlib: $(srcdir)/riscv-newlib stamps/build-gcc-newlib-stage1
477477
--enable-newlib-io-long-long \
478478
--enable-newlib-io-c99-formats \
479479
--enable-newlib-register-fini \
480-
CFLAGS_FOR_TARGET="-O2 $(CFLAGS_FOR_TARGET)" \
481-
CXXFLAGS_FOR_TARGET="-O2 $(CXXFLAGS_FOR_TARGET)"
480+
CFLAGS_FOR_TARGET="-O2 -D_POSIX_MODE $(CFLAGS_FOR_TARGET)" \
481+
CXXFLAGS_FOR_TARGET="-O2 -D_POSIX_MODE $(CXXFLAGS_FOR_TARGET)"
482482
$(MAKE) -C $(notdir $@)
483483
$(MAKE) -C $(notdir $@) install
484484
mkdir -p $(dir $@) && touch $@

0 commit comments

Comments
 (0)