From 60cb5307b9ae5614f0cbb280e19727e0c719a974 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Fri, 30 May 2008 20:00:19 +0000 Subject: - Fix gcc glitch with mremap and IMA. For -combine, make sure that we don't pollute our non-varargs mremap decl with some vararg decl from later in the TU by putting ours after anybody else who is picking up mman.h. This is admittedly a small work-around.. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit smallish testcase: $ cat bug.h extern void *mremap (void*, unsigned, unsigned, int, ...); $ cat bug1.c #include "bug.h" int whatever; $ cat bug2.c #define mremap _hidemremap #include "bug.h" #undef mremap void *mremap (void*, unsigned, unsigned, int, void*); $ gcc -c bug1.c bug2.c $ gcc -c bug1.c bug2.c -combine bug2.c:4: error: conflicting types for ‘mremap’ bug.h:1: error: previous declaration of ‘mremap’ was here --- libc/sysdeps/linux/common/Makefile.in | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libc/sysdeps/linux/common') diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in index 2e3ceca38..64421b98d 100644 --- a/libc/sysdeps/linux/common/Makefile.in +++ b/libc/sysdeps/linux/common/Makefile.in @@ -37,6 +37,13 @@ endif CFLAGS-ssp.c := $(SSP_DISABLE_FLAGS) CFLAGS-ssp-local.c := $(SSP_DISABLE_FLAGS) +ifneq ($(findstring mremap.c,$(CSRC)),) +# for -combine, make sure that we don't pollute our non-varargs mremap decl +# with some vararg decl from later in the TU by putting ours after anybody +# else who is picking up mman.h. +# This is admittedly a small work-around.. +CSRC := $(filter-out mremap.c,$(CSRC)) mremap.c +endif COMMON_SRC := $(patsubst %.c,$(COMMON_DIR)/%.c,$(CSRC)) COMMON_OBJ := $(patsubst %.c,$(COMMON_OUT)/%.o,$(CSRC)) -- cgit v1.2.3