aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Bucur <stefanb@zytor.com>2008-05-12 21:47:23 +0300
committerStefan Bucur <stefanb@zytor.com>2008-05-12 21:47:23 +0300
commit4561fc3586957f5d745bc9eb3baf8d859897da17 (patch)
tree1789353f8744b40090c74f5ebb924ef0079fb23a
parente31a673cc14223db120f363dcd6ecc491125f622 (diff)
downloadsyslinux-elf-4561fc3586957f5d745bc9eb3baf8d859897da17.tar.gz
syslinux-elf-4561fc3586957f5d745bc9eb3baf8d859897da17.tar.xz
syslinux-elf-4561fc3586957f5d745bc9eb3baf8d859897da17.zip
Fixed the various Makefiles so that SYSLINUX compiles on platforms with GCC -fstack-protector flag enabled by default.
-rw-r--r--com32/lib/MCONFIG2
-rw-r--r--com32/libutil/Makefile2
-rw-r--r--com32/menu/Makefile2
-rw-r--r--com32/modules/Makefile2
-rw-r--r--com32/samples/Makefile2
-rw-r--r--dos/Makefile3
-rw-r--r--extlinux/Makefile2
-rw-r--r--memdisk/Makefile3
-rw-r--r--memdump/Makefile3
-rw-r--r--sample/Makefile3
10 files changed, 14 insertions, 10 deletions
diff --git a/com32/lib/MCONFIG b/com32/lib/MCONFIG
index e9b29412..2e36597b 100644
--- a/com32/lib/MCONFIG
+++ b/com32/lib/MCONFIG
@@ -1,13 +1,13 @@
# -*- makefile -*-
TMPFILE = $(shell mktemp /tmp/gcc_ok.XXXXXX)
+CC = gcc
gcc_ok = $(shell tmpf=$(TMPFILE); if $(CC) $(1) -c -x c /dev/null -o $$tmpf 2>/dev/null; \
then echo $(1); else echo $(2); fi; rm -f $$tmpf)
GCCOPT := $(call gcc_ok,-m32,) $(call gcc_ok,-fno-stack-protector,)
-CC = gcc
LD = ld
INCLUDE = -I.
AR = ar
diff --git a/com32/libutil/Makefile b/com32/libutil/Makefile
index 5514f8b6..01de06a3 100644
--- a/com32/libutil/Makefile
+++ b/com32/libutil/Makefile
@@ -30,13 +30,13 @@
##
TMPFILE = $(shell mktemp /tmp/gcc_ok.XXXXXX)
+CC = gcc
gcc_ok = $(shell tmpf=$(TMPFILE); if $(CC) $(1) -c -x c /dev/null -o $$tmpf 2>/dev/null; \
then echo $(1); else echo $(2); fi; rm -f $$tmpf)
M32 := $(call gcc_ok,-m32,) $(call gcc_ok,-fno-stack-protector,)
-CC = gcc
LD = ld -m elf_i386
AR = ar
NASM = nasm
diff --git a/com32/menu/Makefile b/com32/menu/Makefile
index 4e0abc55..8d7b69f4 100644
--- a/com32/menu/Makefile
+++ b/com32/menu/Makefile
@@ -15,13 +15,13 @@
##
TMPFILE = $(shell mktemp /tmp/gcc_ok.XXXXXX)
+CC = gcc
gcc_ok = $(shell tmpf=$(TMPFILE); if $(CC) $(1) -c -x c /dev/null -o $$tmpf 2>/dev/null; \
then echo $(1); else echo $(2); fi; rm -f $$tmpf)
M32 := $(call gcc_ok,-m32,) $(call gcc_ok,-fno-stack-protector,)
-CC = gcc
LD = ld -m elf_i386
AR = ar
NASM = nasm
diff --git a/com32/modules/Makefile b/com32/modules/Makefile
index 690183ec..f7f12f09 100644
--- a/com32/modules/Makefile
+++ b/com32/modules/Makefile
@@ -15,13 +15,13 @@
##
TMPFILE = $(shell mktemp /tmp/gcc_ok.XXXXXX)
+CC = gcc
gcc_ok = $(shell tmpf=$(TMPFILE); if $(CC) $(1) -c -x c /dev/null -o $$tmpf 2>/dev/null; \
then echo $(1); else echo $(2); fi; rm -f $$tmpf)
M32 := $(call gcc_ok,-m32,) $(call gcc_ok,-fno-stack-protector,)
-CC = gcc
LD = ld -m elf_i386
AR = ar
NASM = nasm
diff --git a/com32/samples/Makefile b/com32/samples/Makefile
index 189dc187..77feb58c 100644
--- a/com32/samples/Makefile
+++ b/com32/samples/Makefile
@@ -15,13 +15,13 @@
##
TMPFILE = $(shell mktemp /tmp/gcc_ok.XXXXXX)
+CC = gcc
gcc_ok = $(shell tmpf=$(TMPFILE); if $(CC) $(1) -c -x c /dev/null -o $$tmpf 2>/dev/null; \
then echo $(1); else echo $(2); fi; rm -f $$tmpf)
M32 := $(call gcc_ok,-m32,) $(call gcc_ok,-fno-stack-protector,)
-CC = gcc
LD = ld -m elf_i386
AR = ar
NASM = nasm
diff --git a/dos/Makefile b/dos/Makefile
index 4f344f49..964c7fdc 100644
--- a/dos/Makefile
+++ b/dos/Makefile
@@ -1,5 +1,7 @@
TMPFILE = $(shell mktemp /tmp/gcc_ok.XXXXXX)
+CC = gcc
+
gcc_ok = $(shell tmpf=$(TMPFILE); if $(CC) $(1) -c -x c /dev/null -o $$tmpf 2>/dev/null; \
then echo $(1); else echo $(2); fi; rm -f $$tmpf)
@@ -7,7 +9,6 @@ M32 := $(call gcc_ok,-m32,) $(call gcc_ok,-ffreestanding,) \
$(call gcc_ok,-fno-stack-protector,) \
$(call gcc_ok,-fno-top-level-reorder,$(call gcc_ok,-fno-unit-at-a-time))
-CC = gcc
LD = ld -m elf_i386
OBJCOPY = objcopy
OPTFLAGS = -g -Os -march=i386 -falign-functions=0 -falign-jumps=0 -falign-loops=0 -fomit-frame-pointer
diff --git a/extlinux/Makefile b/extlinux/Makefile
index 9dd7ec94..f4267020 100644
--- a/extlinux/Makefile
+++ b/extlinux/Makefile
@@ -1,4 +1,5 @@
TMPFILE = $(shell mktemp /tmp/gcc_ok.XXXXXX)
+CC = gcc
gcc_ok = $(shell tmpf=$(TMPFILE); if $(CC) $(1) ../dummy.c -o $$tmpf 2>/dev/null; \
then echo '$(1)'; else echo '$(2)'; fi; rm -f $$tmpf)
@@ -6,7 +7,6 @@ gcc_ok = $(shell tmpf=$(TMPFILE); if $(CC) $(1) ../dummy.c -o $$tmpf 2>/dev/nu
comma := ,
LDHASH := $(call gcc_ok,-Wl$(comma)--hash-style=both,)
-CC = gcc
OPTFLAGS = -g -Os
INCLUDES = -I. -I.. -I../libinstaller
CFLAGS = -W -Wall -Wno-sign-compare -D_FILE_OFFSET_BITS=64 $(OPTFLAGS) $(INCLUDES)
diff --git a/memdisk/Makefile b/memdisk/Makefile
index d9cc7f9f..3c288ca4 100644
--- a/memdisk/Makefile
+++ b/memdisk/Makefile
@@ -14,6 +14,8 @@ VERSION := $(shell cat ../version)
TMPFILE = $(shell mktemp /tmp/gcc_ok.XXXXXX)
+CC = gcc
+
gcc_ok = $(shell tmpf=$(TMPFILE); if $(CC) $(1) -c -x c /dev/null -o $$tmpf 2>/dev/null; \
then echo $(1); else echo $(2); fi; rm -f $$tmpf)
@@ -21,7 +23,6 @@ M32 := $(call gcc_ok,-m32,)
ALIGN := $(call gcc_ok,-falign-functions=0 -falign-jumps=0 -falign-loops=0,-malign-functions=0 -malign-jumps=0 -malign-loops=0)
FREE := $(call gcc_ok,-ffreestanding,) $(call gcc_ok,-fno-stack-protector,)
-CC = gcc
CFLAGS = $(M32) $(FREE) -g -W -Wall -Wno-sign-compare \
-Os -fomit-frame-pointer -march=i386 $(ALIGN) \
-DVERSION='"$(VERSION)"' -DDATE='"$(DATE)"'
diff --git a/memdump/Makefile b/memdump/Makefile
index 585381d6..60c4229b 100644
--- a/memdump/Makefile
+++ b/memdump/Makefile
@@ -1,11 +1,12 @@
TMPFILE = $(shell mktemp /tmp/gcc_ok.XXXXXX)
+CC = gcc
+
gcc_ok = $(shell tmpf=$(TMPFILE); if $(CC) $(1) -c -x c /dev/null -o $$tmpf 2>/dev/null; \
then echo $(1); else echo $(2); fi; rm -f $$tmpf)
M32 := $(call gcc_ok,-m32,) $(call gcc_ok,-ffreestanding,) $(call gcc_ok,-fno-stack-protector,)
-CC = gcc
LD = ld -m elf_i386
OBJCOPY = objcopy
OPTFLAGS = -g -Os -march=i386 -falign-functions=0 -falign-jumps=0 -falign-loops=0 -fomit-frame-pointer
diff --git a/sample/Makefile b/sample/Makefile
index cf0d3f19..d2a00f9b 100644
--- a/sample/Makefile
+++ b/sample/Makefile
@@ -16,12 +16,13 @@
TMPFILE = $(shell mktemp /tmp/gcc_ok.XXXXXX)
+CC = gcc
+
gcc_ok = $(shell tmpf=$(TMPFILE); if $(CC) $(1) -c -x c /dev/null -o $$tmpf 2>/dev/null; \
then echo $(1); else echo $(2); fi; rm -f $$tmpf)
M32 := $(call gcc_ok,-m32,) $(call gcc_ok,-ffreestanding,) $(call gcc_ok,-fno-stack-protector,)
-CC = gcc
LD = ld -m elf_i386
AR = ar
NASM = nasm