From b6ebe05dc389b9457e3707401411fd075230b10e Mon Sep 17 00:00:00 2001
From: Andrea Adami <andrea.adami@gmail.com>
Date: Tue, 21 Aug 2018 16:31:44 +0200
Subject: [PATCH] purgatory Makefile: adapt to klcc

Upstream-Status: Inappropriate [klibc specific]
Signed-off-by: Andrea Adami <andrea.adami@gmail.com>

---
 purgatory/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/purgatory/Makefile
+++ b/purgatory/Makefile
@@ -49,7 +49,7 @@ purgatory/sha256.o: $(srcdir)/util_lib/s
 $(PURGATORY): CC=$(TARGET_CC)
 $(PURGATORY): CFLAGS=$(PURGATORY_EXTRA_CFLAGS) \
 		      $($(ARCH)_PURGATORY_EXTRA_CFLAGS) \
-		      -Os -fno-builtin -ffreestanding \
+		      -Os -fno-builtin -ffreestanding -nostdinc \
 		      -fno-zero-initialized-in-bss \
 		      -fno-PIC -fno-PIE -fno-stack-protector -fno-tree-vectorize
 
@@ -61,8 +61,8 @@ $(PURGATORY): CPPFLAGS=$($(ARCH)_PURGATO
 			-Iinclude \
 			-I$(shell $(CC) -print-file-name=include)
 $(PURGATORY): LDFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS)\
-			-Wl,--no-undefined -nostartfiles -nostdlib \
-			-nodefaultlibs -e purgatory_start -r \
+			-Wl,--no-undefined -no-pie -nostartfiles -nostdlib \
+			-nodefaultlibs -Wl,--entry=purgatory_start -Wl,-r \
 			-Wl,-Map=$(PURGATORY_MAP)
 
 $(PURGATORY): $(PURGATORY_OBJS)
