Skip to content

Commit

Permalink
Reduce the size of the executable file (#16)
Browse files Browse the repository at this point in the history
* Update deps/musl
* Use -Oz
  • Loading branch information
mohanson authored Sep 25, 2024
1 parent 6682f5f commit c158de3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ jobs:
with:
submodules: recursive
- name: Install LLVM and Clang
run: brew install llvm@18
run: |
brew install coreutils
brew install llvm@18
- name: Build
run: export PATH="/opt/homebrew/opt/llvm/bin:$PATH" && make all
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ ifeq ($(UNAME), Darwin)
endif

CFLAGS := --target=riscv64 -march=rv64imc_zba_zbb_zbc_zbs
CFLAGS += -g -Os \
-Wall -Werror -Wno-nonnull -Wno-unused-function \
-nostdinc -nostdlib \
-fdata-sections -ffunction-sections
CFLAGS += -g -Oz \
-Wall -Werror -Wno-nonnull -Wno-unused-function \
-nostdinc -nostdlib \
-fdata-sections -ffunction-sections

CFLAGS += -I deps/ckb-c-stdlib
CFLAGS += -I include -I include/c-stdlib
Expand Down Expand Up @@ -80,7 +80,8 @@ clean:
rm -f build/ckb-js-vm
rm -f build/ckb-js-vm.debug
cd tests/ckb_js_tests && make clean
make -C deps/compiler-rt-builtins-riscv clean
cd deps/compiler-rt-builtins-riscv && make clean
cd deps/musl && rm -rf obj release

STYLE := "{BasedOnStyle: Google, TabWidth: 4, IndentWidth: 4, UseTab: Never, SortIncludes: false, ColumnLimit: 120}"

Expand Down
2 changes: 1 addition & 1 deletion deps/musl
Submodule musl updated 1 files
+2 −0 ckb/build.sh

0 comments on commit c158de3

Please sign in to comment.