From 13fdddc36db36288dc995a76d187ba7035e5743f Mon Sep 17 00:00:00 2001 From: Alexander Myltsev Date: Wed, 1 Feb 2023 14:51:48 +0400 Subject: [PATCH 1/6] Add "make diag". --- Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Makefile b/Makefile index 5a10743..0563102 100644 --- a/Makefile +++ b/Makefile @@ -41,6 +41,13 @@ ejudge.sh: image.bin echo >>$@ "exec qemu-system-i386 -nographic -drive format=raw,file=image.bin -serial mon:stdio" chmod +x $@ +diag: + -uname -a + -$(CC) --version + -$(LD) -v + -gcc --version + -ld -v + debug-boot-nox: image.bin mbr.elf qemu-system-i386 -nographic -drive format=raw,file=$< -s -S & $(GDB) mbr.elf \ From f6199e50ae34a7b03f4392b2d05b3692849752a5 Mon Sep 17 00:00:00 2001 From: Alexander Myltsev Date: Sat, 3 Feb 2024 14:59:25 +0400 Subject: [PATCH 2/6] Add -mno-sse. --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 0563102..b4ec599 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,7 @@ OBJCOPY=x86_64-elf-objcopy endif CFLAGS = -fno-pic -ffreestanding -static -fno-builtin -fno-strict-aliasing \ + -mno-sse \ -Wall -ggdb -m32 -Werror -fno-omit-frame-pointer CFLAGS += $(shell $(CC) -fno-stack-protector -E -x c /dev/null >/dev/null 2>&1 && echo -fno-stack-protector) ASMFLAGS = -m32 -ffreestanding -c -g From 855c1c6cc15fa70034db0d622ad7f1d01c767e4b Mon Sep 17 00:00:00 2001 From: Alexander Myltsev Date: Sat, 3 Feb 2024 15:09:53 +0400 Subject: [PATCH 3/6] CI for MacOS. --- .github/workflows/build.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ed11560..a3a7894 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,3 +21,12 @@ jobs: run: sudo apt-get install -y lld - name: LLVM build run: make LLVM=on image.bin + macos: + runs-on: macos-latest + steps: + - uses: actions/checkout@v3 + - name: install llvm + run: brew install llvm + - name: LLVM build + run: make LLVM=on image.bin + From 094510ed8fd2a7ae9760c7c53c5687e0970c16f7 Mon Sep 17 00:00:00 2001 From: Alexander Myltsev Date: Sat, 3 Feb 2024 15:19:05 +0400 Subject: [PATCH 4/6] Find keg-only Homebrew ld.lld. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b4ec599..a9ab49c 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ ASMFLAGS = -m32 -ffreestanding -c -g ifeq ($(LLVM),on) #AS=llvm-as -LD=ld.lld +LD=PATH=/usr/local/opt/llvm/bin:$(PATH) ld.lld CC=clang CFLAGS += -target elf-i386 ASMFLAGS = -target elf-i386 -ffreestanding -c -g From d78af27c5ca34ab6b7ccce0f61105ed32f028ecd Mon Sep 17 00:00:00 2001 From: Alexander Myltsev Date: Sat, 3 Feb 2024 15:21:09 +0400 Subject: [PATCH 5/6] Switch to checkout v4. --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a3a7894..7f6b3e9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,13 +10,13 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: build disk image run: make image.bin llvm: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install lld run: sudo apt-get install -y lld - name: LLVM build @@ -24,7 +24,7 @@ jobs: macos: runs-on: macos-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: install llvm run: brew install llvm - name: LLVM build From 4f5e265a89b131b595dab1b8928134ead155f9a2 Mon Sep 17 00:00:00 2001 From: Alexander Myltsev Date: Sat, 3 Feb 2024 15:23:20 +0400 Subject: [PATCH 6/6] Install x86_64-elf-binutils. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7f6b3e9..0fa8221 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: install llvm - run: brew install llvm + run: brew install llvm x86_64-elf-binutils x86_64-elf-gcc - name: LLVM build run: make LLVM=on image.bin