Link "id" against the LibC.

We can now produce what should essentially be a runnable Serenity executable.
This commit is contained in:
Andreas Kling 2018-10-22 14:13:17 +02:00
parent 63764b3a65
commit 38a621c721
Notes: sideshowbarker 2024-07-19 18:45:11 +09:00
3 changed files with 11 additions and 3 deletions

View file

@ -2,7 +2,7 @@
extern "C" int main(int, char**); extern "C" int main(int, char**);
extern "C" int elf_entry() extern "C" int _start()
{ {
// FIXME: Pass appropriate argc/argv. // FIXME: Pass appropriate argc/argv.
main(0, nullptr); main(0, nullptr);

2
Userland/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
id
*.o

View file

@ -1,6 +1,9 @@
OBJS = \ OBJS = \
id.o id.o
APPS = \
id
ARCH_FLAGS = ARCH_FLAGS =
STANDARD_FLAGS = -std=c++17 -nostdinc++ -nostdlib STANDARD_FLAGS = -std=c++17 -nostdinc++ -nostdlib
USERLAND_FLAGS = -ffreestanding -fno-stack-protector -fno-ident USERLAND_FLAGS = -ffreestanding -fno-stack-protector -fno-ident
@ -15,9 +18,12 @@ CXXFLAGS = $(WARNING_FLAGS) $(OPTIMIZATION_FLAGS) $(USERLAND_FLAGS) $(FLAVOR_FLA
CXX = g++ CXX = g++
LD = ld LD = ld
AR = ar AR = ar
LDFLAGS = -T linker.ld --strip-debug -melf_i386 --gc-sections --build-id=none -z norelro -z now LDFLAGS = --strip-debug -melf_i386 --gc-sections --build-id=none -z norelro -z now
all: $(OBJS) all: $(OBJS) $(APPS)
id: id.o
$(LD) -o $@ $(LDFLAGS) $< ../LibC/LibC.a
.cpp.o: .cpp.o:
@echo "CXX $<"; $(CXX) $(CXXFLAGS) -o $@ -c $< @echo "CXX $<"; $(CXX) $(CXXFLAGS) -o $@ -c $<