mirror of
https://github.com/Fennix-Project/Userspace.git
synced 2025-07-10 22:59:22 +00:00
Toolchain
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
# Config file
|
||||
include ../../../Makefile.conf
|
||||
|
||||
CC = ../../../$(COMPILER_PATH)/$(COMPILER_ARCH)gcc
|
||||
AS = ../../../$(COMPILER_PATH)/$(COMPILER_ARCH)as
|
||||
CC = ../../../$(TC_COMPILER_PATH)/$(TC_COMPILER_ARCH)gcc
|
||||
AS = ../../../$(TC_COMPILER_PATH)/$(TC_COMPILER_ARCH)as
|
||||
NASM = /usr/bin/nasm
|
||||
|
||||
C_SOURCES = $(shell find ./ -type f -name '*.c')
|
||||
@ -16,8 +16,14 @@ else ifeq ($(OSARCH), i686)
|
||||
ASM_ARCH := elf32
|
||||
endif
|
||||
|
||||
CRTBEGIN_PATH = $(shell $(CC) -print-file-name=crtbegin.o)
|
||||
CRTEND_PATH = $(shell $(CC) -print-file-name=crtend.o)
|
||||
CRTI_PATH = $(shell $(CC) -print-file-name=crti.o)
|
||||
CRTN_PATH = $(shell $(CC) -print-file-name=crtn.o)
|
||||
|
||||
build: $(OBJ)
|
||||
mv $^ ../../out/system/lib/
|
||||
cp $(CRTBEGIN_PATH) $(CRTEND_PATH) $(CRTI_PATH) $(CRTN_PATH) ../../out/system/lib/
|
||||
|
||||
%.o: %.c
|
||||
$(CC) -nostdlib -mno-red-zone -std=c17 -c $< -o $@
|
||||
|
@ -1,14 +0,0 @@
|
||||
# I WILL PLACE HERE THE crti.o BECAUSE GCC REFUSE TO LINK IT AND I DON'T KNOW WHY
|
||||
.section .init
|
||||
.global _init
|
||||
.type _init, @function
|
||||
_init:
|
||||
push %rbp
|
||||
movq %rsp, %rbp
|
||||
|
||||
.section .fini
|
||||
.global _fini
|
||||
.type _fini, @function
|
||||
_fini:
|
||||
push %rbp
|
||||
movq %rsp, %rbp
|
@ -1,8 +0,0 @@
|
||||
# I WILL PLACE HERE THE crtn.o BECAUSE GCC REFUSE TO LINK IT AND I DON'T KNOW WHY
|
||||
.section .init
|
||||
popq %rbp
|
||||
ret
|
||||
|
||||
.section .fini
|
||||
popq %rbp
|
||||
ret
|
@ -1,13 +0,0 @@
|
||||
.section .init
|
||||
.global _init
|
||||
.type _init, @function
|
||||
_init:
|
||||
push %rbp
|
||||
movq %rsp, %rbp
|
||||
|
||||
.section .fini
|
||||
.global _fini
|
||||
.type _fini, @function
|
||||
_fini:
|
||||
push %rbp
|
||||
movq %rsp, %rbp
|
@ -1,7 +0,0 @@
|
||||
.section .init
|
||||
popq %rbp
|
||||
ret
|
||||
|
||||
.section .fini
|
||||
popq %rbp
|
||||
ret
|
Reference in New Issue
Block a user