diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..f8a1690 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,14 @@ +name: ci +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] +jobs: + build-linux: + runs-on: ubuntu-latest + container: swiftlang/swift:nightly-main-jammy + steps: + - uses: actions/checkout@v4 + - run: apt-get update && apt-get install --no-install-recommends -y make llvm + - run: make diff --git a/Makefile b/Makefile index cc800c0..458d3cb 100644 --- a/Makefile +++ b/Makefile @@ -7,8 +7,8 @@ SWIFT := swift AS := clang -x assembler ASFLAGS := -target $(TRIPLE) -c LD := clang -fuse-ld=lld -LDFLAGS := -nostdlib -Wl,-gc-sections -static -lgcc -OBJCOPY := objcopy +LDFLAGS := -target $(TRIPLE) -nostdlib -Wl,-gc-sections -static +OBJCOPY := llvm-objcopy QEMU := qemu-system-aarch64 .PHONY: all diff --git a/Package.swift b/Package.swift index bddb59f..670933d 100644 --- a/Package.swift +++ b/Package.swift @@ -16,6 +16,7 @@ let package = Package( swiftSettings: [ .enableExperimentalFeature("Embedded"), .unsafeFlags(["-Xfrontend", "-no-allocations"]), + .unsafeFlags(["-Xfrontend", "-function-sections"]), .unsafeFlags(["-Xfrontend", "-disable-stack-protector"]), .unsafeFlags(["-swift-version", "6"]), .define("RASPI3"), diff --git a/README.md b/README.md index 136c7fd..5f172e3 100644 --- a/README.md +++ b/README.md @@ -8,10 +8,10 @@ An operating system written in Swift. - Arch Linux: `sudo pacman -S make` - Fedora: `sudo dnf install make` - Ubuntu: `sudo apt install make` -- GNU Binutils - - Arch Linux: `sudo pacman -S binutils` - - Fedora: `sudo dnf install binutils` - - Ubuntu: `sudo apt install binutils` +- llvm-objcopy + - Arch Linux: `sudo pacman -S llvm` + - Fedora: `sudo dnf install llvm` + - Ubuntu: `sudo apt install llvm` - QEMU - Arch Linux: `sudo pacman -S qemu-system-aarch64` - Fedora: `sudo dnf install qemu-system-aarch64-core`