newlib: Don't use -fshort-enums
The upstream newlib build uses -fshort-enums for a few files. This
is intended to reduce code size, and it's harmless because the enums
affected are not used in at any ABI boundaries, just inside private
functions. But on ARM, using -fshort-enums marks an object with
attributes saying it's using a non-default ABI and the linker warns
about mixing objects with and without -fshort-enums. The possible
performance/code-size benefit of -fshort-enums is negligible in the
NaCl context, and it's more important that SDK users not get these
confusing warnings at link time. Some unrelated whitespace/filling
changes appear as fallout from re-running Automake.
BUG= http://code.google.com/p/nativeclient/issues/detail?id=3193
TEST= none
Change-Id: I844aa8a2bebb43a8660dd7e316eaeebd3c0c574d
diff --git a/newlib/libc/reent/Makefile.in b/newlib/libc/reent/Makefile.in
index ae2057e..b170beb 100644
--- a/newlib/libc/reent/Makefile.in
+++ b/newlib/libc/reent/Makefile.in
@@ -57,15 +57,15 @@
lib_a_LIBADD =
am__objects_1 = lib_a-closer.$(OBJEXT) lib_a-reent.$(OBJEXT) \
lib_a-impure.$(OBJEXT) lib_a-fcntlr.$(OBJEXT) \
- lib_a-fstatr.$(OBJEXT) lib_a-getpidr.$(OBJEXT) lib_a-getreent.$(OBJEXT) \
- lib_a-gettimeofdayr.$(OBJEXT) lib_a-isattyr.$(OBJEXT) \
- lib_a-linkr.$(OBJEXT) lib_a-lseekr.$(OBJEXT) \
- lib_a-mkdirr.$(OBJEXT) lib_a-openr.$(OBJEXT) \
- lib_a-readr.$(OBJEXT) lib_a-renamer.$(OBJEXT) \
- lib_a-signalr.$(OBJEXT) lib_a-signgam.$(OBJEXT) \
- lib_a-sbrkr.$(OBJEXT) lib_a-statr.$(OBJEXT) \
- lib_a-timesr.$(OBJEXT) lib_a-unlinkr.$(OBJEXT) \
- lib_a-writer.$(OBJEXT)
+ lib_a-fstatr.$(OBJEXT) lib_a-getpidr.$(OBJEXT) \
+ lib_a-getreent.$(OBJEXT) lib_a-gettimeofdayr.$(OBJEXT) \
+ lib_a-isattyr.$(OBJEXT) lib_a-linkr.$(OBJEXT) \
+ lib_a-lseekr.$(OBJEXT) lib_a-mkdirr.$(OBJEXT) \
+ lib_a-openr.$(OBJEXT) lib_a-readr.$(OBJEXT) \
+ lib_a-renamer.$(OBJEXT) lib_a-signalr.$(OBJEXT) \
+ lib_a-signgam.$(OBJEXT) lib_a-sbrkr.$(OBJEXT) \
+ lib_a-statr.$(OBJEXT) lib_a-timesr.$(OBJEXT) \
+ lib_a-unlinkr.$(OBJEXT) lib_a-writer.$(OBJEXT)
@HAVE_STDIO64_DIR_TRUE@am__objects_2 = lib_a-fstat64r.$(OBJEXT) \
@HAVE_STDIO64_DIR_TRUE@ lib_a-lseek64r.$(OBJEXT) \
@HAVE_STDIO64_DIR_TRUE@ lib_a-stat64r.$(OBJEXT) \
@@ -83,9 +83,9 @@
LTLIBRARIES = $(noinst_LTLIBRARIES)
libreent_la_LIBADD =
am__objects_6 = closer.lo reent.lo impure.lo fcntlr.lo fstatr.lo \
- getpidr.lo getreent.lo gettimeofdayr.lo isattyr.lo linkr.lo lseekr.lo \
- mkdirr.lo openr.lo readr.lo renamer.lo signalr.lo signgam.lo \
- sbrkr.lo statr.lo timesr.lo unlinkr.lo writer.lo
+ getpidr.lo getreent.lo gettimeofdayr.lo isattyr.lo linkr.lo \
+ lseekr.lo mkdirr.lo openr.lo readr.lo renamer.lo signalr.lo \
+ signgam.lo sbrkr.lo statr.lo timesr.lo unlinkr.lo writer.lo
@HAVE_STDIO64_DIR_TRUE@am__objects_7 = fstat64r.lo lseek64r.lo \
@HAVE_STDIO64_DIR_TRUE@ stat64r.lo open64r.lo
am__objects_8 = $(am__objects_7)
diff --git a/newlib/libc/stdio/Makefile.am b/newlib/libc/stdio/Makefile.am
index a1ba475..796c79a 100644
--- a/newlib/libc/stdio/Makefile.am
+++ b/newlib/libc/stdio/Makefile.am
@@ -181,32 +181,34 @@
include $(srcdir)/../../Makefile.shared
+#CFLAGS_enums = -fshort-enums
+
# This rule is needed so that libtool compiles vfiprintf before vfprintf. Otherwise
# libtool moves vfprintf.o and subsequently can't find it.
$(lpfx)vfprintf.$(oext): vfprintf.c
- $(LIB_COMPILE) -fshort-enums -c $(srcdir)/vfprintf.c -o $@
+ $(LIB_COMPILE) $(CFLAGS_enums) -c $(srcdir)/vfprintf.c -o $@
$(lpfx)vfiprintf.$(oext): vfprintf.c
- $(LIB_COMPILE) -fshort-enums -DINTEGER_ONLY -c $(srcdir)/vfprintf.c -o $@
+ $(LIB_COMPILE) $(CFLAGS_enums) -DINTEGER_ONLY -c $(srcdir)/vfprintf.c -o $@
$(lpfx)svfprintf.$(oext): vfprintf.c
- $(LIB_COMPILE) -fshort-enums -DSTRING_ONLY -c $(srcdir)/vfprintf.c -o $@
+ $(LIB_COMPILE) $(CFLAGS_enums) -DSTRING_ONLY -c $(srcdir)/vfprintf.c -o $@
$(lpfx)svfiprintf.$(oext): vfprintf.c
- $(LIB_COMPILE) -fshort-enums -DINTEGER_ONLY -DSTRING_ONLY -c $(srcdir)/vfprintf.c -o $@
+ $(LIB_COMPILE) $(CFLAGS_enums) -DINTEGER_ONLY -DSTRING_ONLY -c $(srcdir)/vfprintf.c -o $@
$(lpfx)vfwprintf.$(oext): vfwprintf.c
- $(LIB_COMPILE) -fshort-enums -c $(srcdir)/vfwprintf.c -o $@
+ $(LIB_COMPILE) $(CFLAGS_enums) -c $(srcdir)/vfwprintf.c -o $@
$(lpfx)vfiwprintf.$(oext): vfwprintf.c
- $(LIB_COMPILE) -fshort-enums -DINTEGER_ONLY -c $(srcdir)/vfwprintf.c -o $@
+ $(LIB_COMPILE) $(CFLAGS_enums) -DINTEGER_ONLY -c $(srcdir)/vfwprintf.c -o $@
$(lpfx)svfwprintf.$(oext): vfwprintf.c
- $(LIB_COMPILE) -fshort-enums -DSTRING_ONLY -c $(srcdir)/vfwprintf.c -o $@
+ $(LIB_COMPILE) $(CFLAGS_enums) -DSTRING_ONLY -c $(srcdir)/vfwprintf.c -o $@
$(lpfx)svfiwprintf.$(oext): vfwprintf.c
- $(LIB_COMPILE) -fshort-enums -DINTEGER_ONLY -DSTRING_ONLY -c $(srcdir)/vfwprintf.c -o $@
+ $(LIB_COMPILE) $(CFLAGS_enums) -DINTEGER_ONLY -DSTRING_ONLY -c $(srcdir)/vfwprintf.c -o $@
$(lpfx)vfscanf.$(oext): vfscanf.c
$(LIB_COMPILE) -c $(srcdir)/vfscanf.c -o $@
diff --git a/newlib/libc/stdio/Makefile.in b/newlib/libc/stdio/Makefile.in
index 849bef2..0ed5920 100644
--- a/newlib/libc/stdio/Makefile.in
+++ b/newlib/libc/stdio/Makefile.in
@@ -1569,32 +1569,34 @@
echo $$i `pwd`/$$i >> objectlist.awk.in ; \
done
+#CFLAGS_enums = -fshort-enums
+
# This rule is needed so that libtool compiles vfiprintf before vfprintf. Otherwise
# libtool moves vfprintf.o and subsequently can't find it.
$(lpfx)vfprintf.$(oext): vfprintf.c
- $(LIB_COMPILE) -fshort-enums -c $(srcdir)/vfprintf.c -o $@
+ $(LIB_COMPILE) $(CFLAGS_enums) -c $(srcdir)/vfprintf.c -o $@
$(lpfx)vfiprintf.$(oext): vfprintf.c
- $(LIB_COMPILE) -fshort-enums -DINTEGER_ONLY -c $(srcdir)/vfprintf.c -o $@
+ $(LIB_COMPILE) $(CFLAGS_enums) -DINTEGER_ONLY -c $(srcdir)/vfprintf.c -o $@
$(lpfx)svfprintf.$(oext): vfprintf.c
- $(LIB_COMPILE) -fshort-enums -DSTRING_ONLY -c $(srcdir)/vfprintf.c -o $@
+ $(LIB_COMPILE) $(CFLAGS_enums) -DSTRING_ONLY -c $(srcdir)/vfprintf.c -o $@
$(lpfx)svfiprintf.$(oext): vfprintf.c
- $(LIB_COMPILE) -fshort-enums -DINTEGER_ONLY -DSTRING_ONLY -c $(srcdir)/vfprintf.c -o $@
+ $(LIB_COMPILE) $(CFLAGS_enums) -DINTEGER_ONLY -DSTRING_ONLY -c $(srcdir)/vfprintf.c -o $@
$(lpfx)vfwprintf.$(oext): vfwprintf.c
- $(LIB_COMPILE) -fshort-enums -c $(srcdir)/vfwprintf.c -o $@
+ $(LIB_COMPILE) $(CFLAGS_enums) -c $(srcdir)/vfwprintf.c -o $@
$(lpfx)vfiwprintf.$(oext): vfwprintf.c
- $(LIB_COMPILE) -fshort-enums -DINTEGER_ONLY -c $(srcdir)/vfwprintf.c -o $@
+ $(LIB_COMPILE) $(CFLAGS_enums) -DINTEGER_ONLY -c $(srcdir)/vfwprintf.c -o $@
$(lpfx)svfwprintf.$(oext): vfwprintf.c
- $(LIB_COMPILE) -fshort-enums -DSTRING_ONLY -c $(srcdir)/vfwprintf.c -o $@
+ $(LIB_COMPILE) $(CFLAGS_enums) -DSTRING_ONLY -c $(srcdir)/vfwprintf.c -o $@
$(lpfx)svfiwprintf.$(oext): vfwprintf.c
- $(LIB_COMPILE) -fshort-enums -DINTEGER_ONLY -DSTRING_ONLY -c $(srcdir)/vfwprintf.c -o $@
+ $(LIB_COMPILE) $(CFLAGS_enums) -DINTEGER_ONLY -DSTRING_ONLY -c $(srcdir)/vfwprintf.c -o $@
$(lpfx)vfscanf.$(oext): vfscanf.c
$(LIB_COMPILE) -c $(srcdir)/vfscanf.c -o $@
diff --git a/newlib/libc/stdlib/Makefile.am b/newlib/libc/stdlib/Makefile.am
index 38120e6..2ccf594 100644
--- a/newlib/libc/stdlib/Makefile.am
+++ b/newlib/libc/stdlib/Makefile.am
@@ -257,7 +257,7 @@
wcstoull.def \
system.def \
wcstombs.def \
- wctomb.def
+ wctomb.def
SUFFIXES = .def
@@ -274,11 +274,13 @@
CLEANFILES = $(CHEWOUT_FILES) *.ref
+#CFLAGS_enums = -fshort-enums
+
$(lpfx)dtoa.$(oext): dtoa.c mprec.h
$(lpfx)ldtoa.$(oext): ldtoa.c mprec.h
$(lpfx)ecvtbuf.$(oext): ecvtbuf.c mprec.h
$(lpfx)mbtowc_r.$(oext): mbtowc_r.c mbctype.h
- $(LIB_COMPILE) -c -fshort-enums $(srcdir)/mbtowc_r.c -o $@
+ $(LIB_COMPILE) -c $(CFLAGS_enums) $(srcdir)/mbtowc_r.c -o $@
$(lpfx)mprec.$(oext): mprec.c mprec.h
$(lpfx)strtod.$(oext): strtod.c mprec.h
diff --git a/newlib/libc/stdlib/Makefile.in b/newlib/libc/stdlib/Makefile.in
index 5fe069f..04aa0d9 100644
--- a/newlib/libc/stdlib/Makefile.in
+++ b/newlib/libc/stdlib/Makefile.in
@@ -477,7 +477,7 @@
wcstoull.def \
system.def \
wcstombs.def \
- wctomb.def
+ wctomb.def
SUFFIXES = .def
CHEW = ../../doc/makedoc -f $(srcdir)/../../doc/doc.str
@@ -1403,11 +1403,13 @@
doc: $(CHEWOUT_FILES)
cat $(srcdir)/stdlib.tex >> $(TARGETDOC)
+#CFLAGS_enums = -fshort-enums
+
$(lpfx)dtoa.$(oext): dtoa.c mprec.h
$(lpfx)ldtoa.$(oext): ldtoa.c mprec.h
$(lpfx)ecvtbuf.$(oext): ecvtbuf.c mprec.h
$(lpfx)mbtowc_r.$(oext): mbtowc_r.c mbctype.h
- $(LIB_COMPILE) -c -fshort-enums $(srcdir)/mbtowc_r.c -o $@
+ $(LIB_COMPILE) -c $(CFLAGS_enums) $(srcdir)/mbtowc_r.c -o $@
$(lpfx)mprec.$(oext): mprec.c mprec.h
$(lpfx)strtod.$(oext): strtod.c mprec.h