Message-ID: <001901c31dfe$cb7cfa90$0100a8c0@acp42g> From: "Andrew Cottrell" To: Cc: "Andris Pavenis" , "Richard Dawe" References: <002301c31cfb$6ebfabd0$0100a8c0 AT acp42g> Subject: GCC 3.3 & LIBC patch #2 - build process change Date: Mon, 19 May 2003 22:04:25 +1000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Reply-To: djgpp-workers AT delorie DOT com All, I have added the -fno-strict-aliasing as per DJ's posting and have supplied a set of patches that allow libc.a to be built. Below is the first error encounted where I need help with suggestions if my way of fixing the problem is the correct way. I will start with the simple problem and fix. In emu387.cc one array used a char instead of an int. The solution that I propose it to typecast it to an int. The major problem encounted:- d:/dj204/bin/make.exe -C src gcc -MD -O2 -mcpu=pentium -march=i386 -Wall -Wbad-function-cast -Wcast-qual -Werror -Wmissing-declarations -Wmissing-prototypes -Wpointer-arit h -Wshadow -Wstrict-prototypes -Wwrite-strings -Wundef -Wcast-align -Wsign-c ompare -nostdinc -fno-strict-aliasing -I. -I- -isystem ../../../include -DGAS_MAJOR=2 -DGAS_MINOR=13 -DGAS_MINORMINOR=Copyright -c -fno-exceptions emu387.cc cc1plus.exe: warning: "-Wbad-function-cast" is valid for C/ObjC but not for C++ cc1plus.exe: warning: "-Wmissing-declarations" is valid for C/ObjC but not for C++ make.exe[3]: *** [emu387.o] Error 1 make.exe[2]: *** [all_subs] Error 2 make.exe[1]: *** [all] Error 2 make.exe: *** [subs] Error 2 Analaysis:- The problem is caused by GCC 3.3 changing its checking. The current LIBC make process does not include a specific gcc option file for C++ files and instead uses the gcc.opt file. Proposal:- Add a GPP.OPT file and modifiy the relevant files to use this. Below are the patches to resolve the minor and major issues above. Tomorrow night I will have a look at the zoneinfo as there are number of warning like the following:- localtime.c:949: warning: traditional C rejects ISO C style function definitions I used the following diff parameters:- -c -w -prcN *** src\libemu\src\emu387.cc.old Mon May 19 21:51:26 2003 --- src\libemu\src\emu387.cc Mon May 19 21:50:50 2003 *************** static void emu_printall() *** 272,278 **** (long)(r->sigl & 0xFFFF), r->exp - EXP_BIAS + 1); } ! eprintf("%s\r\n", tag_desc[r->tag]); } } --- 272,278 ---- (long)(r->sigl & 0xFFFF), r->exp - EXP_BIAS + 1); } ! eprintf("%s\r\n", tag_desc[(int)r->tag]); } } *** src\gpp.opt.old Thu Jan 1 00:00:00 1970 --- src\gpp.opt Mon May 19 21:13:12 2003 *************** *** 0 **** --- 1,18 ---- + -MD + -O2 + -mcpu=pentium + -march=i386 + -Wall + -Wcast-qual + -Werror + -Wmissing-prototypes + -Wpointer-arith + -Wshadow + -Wstrict-prototypes + -Wwrite-strings + -Wundef + -Wcast-align + -Wsign-compare + -nostdinc + -fno-strict-aliasing + *** src\libemu\src\makefile.old Fri Oct 18 09:00:26 2002 --- src\libemu\src\makefile Mon May 19 21:46:04 2003 *************** EXTRA_OBJS += emudummy.o *** 11,17 **** include $(TOP)/../makefile.inc %.o : %.cc ! $(XNOPGGCC) -c -fno-exceptions $< %.o : %.c $(XNOPGGCC) -c $< --- 11,17 ---- include $(TOP)/../makefile.inc %.o : %.cc ! $(XNOPGGPP) -c -fno-exceptions $< %.o : %.c $(XNOPGGCC) -c $< *** src\makefile.inc.old Mon May 19 21:43:02 2003 --- src\makefile.inc Mon May 19 21:44:14 2003 *************** MAKEFLAGS := --no-print-directory *** 13,18 **** --- 13,19 ---- # ifeq ($(CROSS_BUILD),1) GCC_OPT := $(shell cat $(TOP)/../gcc.opt) + GPP_OPT := $(shell cat $(TOP)/../gpp.opt) GCCL_OPT := $(shell cat $(TOP)/../gcc-l.opt) endif *************** ASFLAGS += -DGAS_MINORMINOR=$(GAS_MINORM *** 59,67 **** --- 60,70 ---- # ifneq ($(CROSS_BUILD),1) XGCC = $(CROSS_GCC) @$(TOP)/../gcc.opt -I. -I- -isystem $(TOP)/../../include $(CFLAGS) + XGPP = $(CROSS_GCC) @$(TOP)/../gpp.opt -I. -I- -isystem $(TOP)/../../include $(CFLAGS) XLGCC = $(CROSS_GCC) -s @$(TOP)/../gcc-l.opt -I. -I- -isystem $(TOP)/../../include $(CFLAGS) else XGCC = $(CROSS_GCC) $(GCC_OPT) -I. -I- -isystem $(TOP)/../../include $(CFLAGS) + XGPP = $(CROSS_GCC) $(GPP_OPT) -I. -I- -isystem $(TOP)/../../include $(CFLAGS) XLGCC = $(CROSS_GCC) $(GCCL_OPT) -I. -I- -isystem $(TOP)/../../include $(CFLAGS) endif *************** endif *** 72,77 **** --- 75,81 ---- # profiling support code). # XNOPGGCC = $(CROSS_GCC) $(shell sed -f $(TOP)/../noprof.sed $(TOP)/../gcc.opt) -I. -I- -isystem $(TOP)/../../include $(CFLAGS) + XNOPGGPP = $(CROSS_GCC) $(shell sed -f $(TOP)/../noprof.sed $(TOP)/../gpp.opt) -I. -I- -isystem $(TOP)/../../include $(CFLAGS) MISC = $(TOP)/../misc.exe *************** MISC = $(TOP)/../misc.exe *** 79,86 **** @$(MISC) echo - $(CROSS_GCC) '...' -c $< @$(XGCC) -c $< %.o : %.cc ! @$(MISC) echo - $(CROSS_GCC) '...' -c -fno-exceptions $< ! @$(XGCC) -c -fno-exceptions $< %.o : %.S @$(MISC) echo - $(CROSS_GCC) '...' -c $< @$(XGCC) -c $< --- 83,90 ---- @$(MISC) echo - $(CROSS_GCC) '...' -c $< @$(XGCC) -c $< %.o : %.cc ! @$(MISC) echo - $(CROSS_GPP) '...' -c -fno-exceptions $< ! @$(XGPP) -c -fno-exceptions $< %.o : %.S @$(MISC) echo - $(CROSS_GCC) '...' -c $< @$(XGCC) -c $< *************** MISC = $(TOP)/../misc.exe *** 91,104 **** %.i : %.c $(XGCC) -c $< -E > $@ %.i : %.cc ! $(XGCC) -c $< -E > $@ %.i : %.S $(XGCC) -c $< -E > $@ %.ss : %.c $(XGCC) -c $< -S > $@ %.ss : %.cc ! $(XGCC) -c $< -S > $@ %.c : %.y bison $*.y -o $*.c --- 95,108 ---- %.i : %.c $(XGCC) -c $< -E > $@ %.i : %.cc ! $(XGPP) -c $< -E > $@ %.i : %.S $(XGCC) -c $< -E > $@ %.ss : %.c $(XGCC) -c $< -S > $@ %.ss : %.cc ! $(XGPP) -c $< -S > $@ %.c : %.y bison $*.y -o $*.c