From 9d999eeb34a8a44305d47a71bcf3d401759623c8 Mon Sep 17 00:00:00 2001 From: Heath Petersen Date: Wed, 13 Jul 2016 03:01:58 +0000 Subject: [PATCH] update / correct some compilation and linkage settings HOSTCFLAGS: Should not be set the same as CFLAGS since CFLAGS may be for a completely different platform. Use sane defaults like other configs/*/*/Make.defs. ARCHCPUFLAGS: Depending on how the GNU compiler was built we may need -fno-stack-protector. Since we always want it we can just default to specifying it instead of depending on the compiler default. LDFLAGS: If compiling for a 32 bit target from a 64 bit platform we need to tell the linker to generate a 32 bit elf file with -m elf_i386. --- configs/qemu-i486/nsh/Make.defs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configs/qemu-i486/nsh/Make.defs b/configs/qemu-i486/nsh/Make.defs index 0d16a608b0d..4f857d81dec 100644 --- a/configs/qemu-i486/nsh/Make.defs +++ b/configs/qemu-i486/nsh/Make.defs @@ -63,8 +63,7 @@ else ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/nsh/ld.script endif -ARCHCPUFLAGS = -march=i486 -mtune=i486 -fno-builtin -#ARCHCPUFLAGS = -march=i486 -mtune=i486 -fno-builtin -fno-stack-protector +ARCHCPUFLAGS = -march=i486 -mtune=i486 -fno-builtin -fno-stack-protector ARCHPICFLAGS = -fpic ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef ARCHDEFINES = @@ -73,6 +72,7 @@ ARCHDEFINES = ifeq ($(CONFIG_ARCH_X86_M32),y) ARCHCPUFLAGS += -m32 +LDFLAGS += -m elf_i386 endif # We have to use a cross-development toolchain under Cygwin because the native @@ -109,5 +109,5 @@ MKDEP = $(TOPDIR)/tools/mkdeps$(HOSTEXEEXT) HOSTCC = gcc HOSTINCLUDESv = -I. -HOSTCFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(HOSTINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe +HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -g -pipe HOSTLDFLAGS =