Skip to content

Commit e123334

Browse files
committed
build: do not depend on nasm anymore
1 parent ea6c6d5 commit e123334

File tree

13 files changed

+322
-324
lines changed

13 files changed

+322
-324
lines changed

Makefile

+2-3
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ $(kernel): $(linker_ld) $(libk_asm_objects) $(libk_c_objects) $(libk_extra_objec
306306
$(libk_asm_objects): $(libk_objs_dir)/%.o: %.asm
307307
$(progress) "CC" $<
308308
$(MKDIR) -p $(dir $@)
309-
$(ASM) $(KERNEL_ASM_FLAGS) $< -o $@
309+
$(CC) $(KERNEL_ASM_FLAGS) $< -o $@
310310

311311
$(libk_c_objects): $(libk_objs_dir)/%.o: %.c
312312
$(progress) "CC" $<
@@ -321,7 +321,7 @@ $(libc_c_objects): $(lib_objs_dir)/%.o: %.c
321321
$(libc_asm_objects): $(lib_objs_dir)/%.o: %.asm
322322
$(progress) "CC" $<
323323
$(MKDIR) -p $(dir $@)
324-
$(ASM) $(LIBC_ASM_FLAGS) $< -o $@
324+
$(CC) $(LIBC_ASM_FLAGS) $< -o $@
325325

326326
$(libc): $(libc_asm_objects) $(libc_c_objects) | $(dist_dir)
327327
$(progress) "AR" $@
@@ -409,7 +409,6 @@ fmt: ## automatically format the code with clang-format
409409

410410
version: ## print tool versions
411411
$(CC) --version
412-
$(ASM) --version
413412
$(LD) --version
414413
$(AR) --version
415414
$(QEMU) --version

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ The following dependencies are required to build this project:
6565
If you want to work on the `x86_64` architecture, you'll need the following
6666
extra dependencies:
6767

68-
- `nasm`
6968
- `grub-mkrescue`
7069
- `xorriso`
7170

@@ -134,7 +133,7 @@ depending on the architecture and board configured.
134133
Install [Homebrew](https://brew.sh/), then run the following commands:
135134

136135
```
137-
$ brew install nasm xorriso qemu llvm u-boot-tools
136+
$ brew install xorriso qemu llvm u-boot-tools
138137
```
139138

140139
#### Linux

src/kernel/arch/aarch32/Makefile.include

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ log_file = $(log_dir)/$(ARCH)-$(BOARD)-$(BUILD_MODE).log
1414

1515
QEMU = qemu-system-arm
1616
ARM_GCC = arm-none-eabi-gcc
17-
ASM = $(CC)
1817

1918
###############################################################################
2019
# Options for the different tools

src/kernel/arch/aarch64/Makefile.include

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ log_file = $(log_dir)/$(ARCH)-$(BOARD)-$(BUILD_MODE).log
1313
###############################################################################
1414

1515
QEMU = qemu-system-aarch64
16-
ASM = $(CC)
1716

1817
###############################################################################
1918
# Options for the different tools

src/kernel/arch/x86_64/Makefile.include

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ vbe_bpp = 32
2020
# Tools
2121
###############################################################################
2222

23-
ASM = nasm
2423
QEMU = qemu-system-x86_64
2524

2625
###############################################################################
@@ -60,14 +59,15 @@ libk_extra_objects += $(kernel_console_font)
6059
# Flags
6160
###############################################################################
6261

63-
LD_TARGET = elf_x86_64
64-
LIBC_ASM_FLAGS += -f elf64
65-
LIBC_CFLAGS += --target=x86_64 -fstack-protector-strong
62+
X86_64_CFLAGS += --target=x86_64
63+
LIBC_ASM_FLAGS += -c $(X86_64_CFLAGS)
64+
LIBC_CFLAGS += $(X86_64_CFLAGS) -fstack-protector-strong
6665
LIBC_CFLAGS += -mno-mmx -mno-sse -mno-sse2 -mno-avx -mno-avx2
67-
KERNEL_ASM_FLAGS += -f elf64
66+
KERNEL_ASM_FLAGS += -c $(X86_64_CFLAGS)
6867
KERNEL_ASM_FLAGS += -dVBE_WIDTH=$(vbe_width) -dVBE_HEIGHT=$(vbe_height) -dVBE_BPP=$(vbe_bpp)
6968
KERNEL_CFLAGS += -mno-red-zone
7069
KERNEL_INCLUDES += -I$(external_dir)/scalable-font2/
70+
LD_TARGET = elf_x86_64
7171

7272
###############################################################################
7373
# Arch-specific targets

0 commit comments

Comments
 (0)