From 05740a6edd900094c5e595bfab7adb569a1784ae Mon Sep 17 00:00:00 2001 From: Nathael Pajani Date: Thu, 4 Dec 2014 03:23:18 +0100 Subject: [PATCH] -ffreestanding Assert that compilation targets a freestanding environment (one with no OS and none of the related stuff) -nostdlib prevents inclusion of standard libraries, which or not present in our system. Requiered parts have been re-implemented (mostly a copy from the Linux kernel code) --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index a6659bf..008a803 100644 --- a/Makefile +++ b/Makefile @@ -7,9 +7,10 @@ ARCH = armv6-m CROSS_COMPILE = arm-linux-gnueabi- CC = $(CROSS_COMPILE)gcc -FOPTS = -fno-builtin -ffunction-sections -fdata-sections +FOPTS = -fno-builtin -ffunction-sections -fdata-sections -ffreestanding CFLAGS = -Wall -O2 -mthumb -mcpu=$(CPU) $(FOPTS) -LINKOPTS = -static -nostartfiles -Wl,--gc-sections -Wl,--build-id=none \ +LINKOPTS = -static -nostartfiles -nostdlib \ + -Wl,--gc-sections -Wl,--build-id=none \ -Wl,-Map=lpc_map_$(LPC).map -Tlpc_link_$(LPC).ld -- 2.43.0