[PATCH] libcsupport: Workaround for GCC 5.1 and later

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Jul 13 08:20:53 UTC 2015


Disable an optimization which would lead to a recursive calloc() call in
calloc().
---
 cpukit/libcsupport/Makefile.am | 8 ++++++--
 cpukit/wrapup/Makefile.am      | 1 +
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/cpukit/libcsupport/Makefile.am b/cpukit/libcsupport/Makefile.am
index 7474079..a5da5f1 100644
--- a/cpukit/libcsupport/Makefile.am
+++ b/cpukit/libcsupport/Makefile.am
@@ -1,8 +1,9 @@
 include $(top_srcdir)/automake/multilib.am
 include $(top_srcdir)/automake/compile.am
 
-noinst_LIBRARIES = libcsupport.a
+noinst_LIBRARIES = libcsupport.a libcalloc.a
 libcsupport_a_CPPFLAGS = $(AM_CPPFLAGS)
+libcalloc_a_CPPFLAGS = $(AM_CPPFLAGS)
 
 include_rtemsdir = $(includedir)/rtems
 include_rtems_HEADERS = include/console.h
@@ -79,7 +80,7 @@ ID_C_FILES = src/getegid.c src/geteuid.c src/getgid.c src/getgroups.c \
     src/seteuid.c src/setgid.c src/setuid.c src/setegid.c src/setpgid.c \
     src/setsid.c
 
-MALLOC_C_FILES = src/malloc_initialize.c src/calloc.c src/malloc.c \
+MALLOC_C_FILES = src/malloc_initialize.c src/malloc.c \
     src/realloc.c src/_calloc_r.c src/_malloc_r.c \
     src/free.c src/_free_r.c \
     src/_realloc_r.c src/mallocfreespace.c \
@@ -138,6 +139,9 @@ libcsupport_a_SOURCES += $(LIBC_GLUE_C_FILES) $(PASSWORD_GROUP_C_FILES) \
 
 libcsupport_a_SOURCES += src/flockfile.c src/funlockfile.c src/ftrylockfile.c
 
+libcalloc_a_SOURCES = src/calloc.c
+libcalloc_a_CFLAGS = -fno-builtin
+
 EXTRA_DIST = src/TODO src/CASES src/README
 
 include $(srcdir)/preinstall.am
diff --git a/cpukit/wrapup/Makefile.am b/cpukit/wrapup/Makefile.am
index 53861df..5fd6e33 100644
--- a/cpukit/wrapup/Makefile.am
+++ b/cpukit/wrapup/Makefile.am
@@ -21,6 +21,7 @@ endif
 
 TMP_LIBS += ../libcrypt/libcrypt.a
 TMP_LIBS += ../libcsupport/libcsupport.a
+TMP_LIBS += ../libcsupport/libcalloc.a
 TMP_LIBS += ../libblock/libblock.a
 if LIBDOSFS
 TMP_LIBS += ../libfs/libdosfs.a
-- 
1.8.4.5



More information about the devel mailing list