From f4ac435a2bd00e9999ceb05cc6d225188b11251f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Quei=C3=9Fner?= Date: Wed, 4 May 2016 17:19:40 +0200 Subject: [PATCH] Adds libgcc for better compatibility. --- prototypes/base/Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/prototypes/base/Makefile b/prototypes/base/Makefile index ee264e4..eb84f45 100644 --- a/prototypes/base/Makefile +++ b/prototypes/base/Makefile @@ -4,7 +4,7 @@ CC=gcc CXX=g++ LD=ld -FLAGS = -ffreestanding -m32 -Werror -Wall -iquote include +FLAGS = -ffreestanding -m32 -Werror -Wall -iquote include -O3 ASFLAGS = $(FLAGS) CFLAGS = $(FLAGS) CXXFLAGS = $(FLAGS) -std=c++14 -fno-rtti -fno-exceptions -fno-leading-underscore -fno-use-cxa-atexit -nostdlib -fno-builtin @@ -12,10 +12,12 @@ CXXFLAGS = $(FLAGS) -std=c++14 -fno-rtti -fno-exceptions -fno-leading-underscore SRCS = $(shell find -regextype egrep -regex '.*/.*\.(cpp|S|c)') OBJS = $(addsuffix .o, $(notdir $(basename $(SRCS)))) +LIBGCC = $(shell gcc -m32 -print-libgcc-file-name) + all: kernel-base.ker kernel-base.ker: $(OBJS) - $(LD) -melf_i386 -Tlinker.ld -o kernel-base.ker $(addprefix obj/, $^) + $(LD) -melf_i386 -Tlinker.ld -o kernel-base.ker $(addprefix obj/, $^) $(LIBGCC) %.o: %.cpp $(CXX) $(CXXFLAGS) -c -o obj/$@ $<