Enable lto when building release
This commit is contained in:
parent
fa4ba08862
commit
bd0611f1e3
|
|
@ -50,36 +50,36 @@ jobs:
|
||||||
|
|
||||||
- name: Boot Test (Multiboot)
|
- name: Boot Test (Multiboot)
|
||||||
id: boot_test_mb
|
id: boot_test_mb
|
||||||
run: make run AUTO_TEST=boot ENABLE_KVM=0 BOOT_PROTOCOL=multiboot RELEASE_MODE=1
|
run: make run AUTO_TEST=boot ENABLE_KVM=0 BOOT_PROTOCOL=multiboot RELEASE=1
|
||||||
|
|
||||||
- name: Boot Test (Multiboot2)
|
- name: Boot Test (Multiboot2)
|
||||||
id: boot_test_mb2
|
id: boot_test_mb2
|
||||||
run: make run AUTO_TEST=boot ENABLE_KVM=0 BOOT_PROTOCOL=multiboot2 RELEASE_MODE=1
|
run: make run AUTO_TEST=boot ENABLE_KVM=0 BOOT_PROTOCOL=multiboot2 RELEASE=1
|
||||||
|
|
||||||
- name: Boot Test (MicroVM)
|
- name: Boot Test (MicroVM)
|
||||||
id: boot_test_microvm
|
id: boot_test_microvm
|
||||||
run: make run AUTO_TEST=boot ENABLE_KVM=0 SCHEME=microvm RELEASE_MODE=1
|
run: make run AUTO_TEST=boot ENABLE_KVM=0 SCHEME=microvm RELEASE=1
|
||||||
|
|
||||||
- name: Boot Test (Linux Legacy 32-bit Boot Protocol)
|
- name: Boot Test (Linux Legacy 32-bit Boot Protocol)
|
||||||
id: boot_test_linux_legacy32
|
id: boot_test_linux_legacy32
|
||||||
run: make run AUTO_TEST=boot ENABLE_KVM=0 BOOT_PROTOCOL=linux-legacy32 RELEASE_MODE=1
|
run: make run AUTO_TEST=boot ENABLE_KVM=0 BOOT_PROTOCOL=linux-legacy32 RELEASE=1
|
||||||
|
|
||||||
- name: Boot Test (Linux EFI Handover Boot Protocol)
|
- name: Boot Test (Linux EFI Handover Boot Protocol)
|
||||||
id: boot_test_linux_efi_handover64
|
id: boot_test_linux_efi_handover64
|
||||||
run: make run AUTO_TEST=boot ENABLE_KVM=0 BOOT_PROTOCOL=linux-efi-handover64 RELEASE_MODE=1
|
run: make run AUTO_TEST=boot ENABLE_KVM=0 BOOT_PROTOCOL=linux-efi-handover64 RELEASE=1
|
||||||
|
|
||||||
- name: Syscall Test (Linux EFI Handover Boot Protocol)
|
- name: Syscall Test (Linux EFI Handover Boot Protocol)
|
||||||
id: syscall_test
|
id: syscall_test
|
||||||
run: make run AUTO_TEST=syscall ENABLE_KVM=0 BOOT_PROTOCOL=linux-efi-handover64 RELEASE_MODE=1
|
run: make run AUTO_TEST=syscall ENABLE_KVM=0 BOOT_PROTOCOL=linux-efi-handover64 RELEASE=1
|
||||||
|
|
||||||
- name: Syscall Test at Ext2 (MicroVM)
|
- name: Syscall Test at Ext2 (MicroVM)
|
||||||
id: syscall_test_at_ext2
|
id: syscall_test_at_ext2
|
||||||
run: make run AUTO_TEST=syscall SYSCALL_TEST_DIR=/ext2 ENABLE_KVM=0 SCHEME=microvm RELEASE_MODE=1
|
run: make run AUTO_TEST=syscall SYSCALL_TEST_DIR=/ext2 ENABLE_KVM=0 SCHEME=microvm RELEASE=1
|
||||||
|
|
||||||
- name: Syscall Test at Exfat
|
- name: Syscall Test at Exfat
|
||||||
id: syscall_test_at_exfat_linux
|
id: syscall_test_at_exfat_linux
|
||||||
run: make run AUTO_TEST=syscall SYSCALL_TEST_DIR=/exfat EXTRA_BLOCKLISTS_DIRS=blocklists.exfat ENABLE_KVM=0 BOOT_PROTOCOL=linux-efi-handover64 RELEASE_MODE=1
|
run: make run AUTO_TEST=syscall SYSCALL_TEST_DIR=/exfat EXTRA_BLOCKLISTS_DIRS=blocklists.exfat ENABLE_KVM=0 BOOT_PROTOCOL=linux-efi-handover64 RELEASE=1
|
||||||
|
|
||||||
- name: Regression Test (Multiboot2)
|
- name: Regression Test (Multiboot2)
|
||||||
id: regression_test_linux
|
id: regression_test_linux
|
||||||
run: make run AUTO_TEST=regression ENABLE_KVM=0 BOOT_PROTOCOL=multiboot2 RELEASE_MODE=1
|
run: make run AUTO_TEST=regression ENABLE_KVM=0 BOOT_PROTOCOL=multiboot2 RELEASE=1
|
||||||
|
|
|
||||||
20
Cargo.toml
20
Cargo.toml
|
|
@ -36,3 +36,23 @@ exclude = [
|
||||||
"osdk",
|
"osdk",
|
||||||
"target/osdk/base",
|
"target/osdk/base",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# Cargo only looks at the profile settings
|
||||||
|
# in the Cargo.toml manifest at the root of the workspace
|
||||||
|
|
||||||
|
[profile.release]
|
||||||
|
lto = "thin"
|
||||||
|
|
||||||
|
# Release profile configuration with Link Time Optimization (LTO) enabled.
|
||||||
|
#
|
||||||
|
# This profile is optimized for maximum runtime performance,
|
||||||
|
# (achieving a 2% reduction in latency for the getpid system call).
|
||||||
|
# However, enabling LTO significantly increases compilation times,
|
||||||
|
# approximately doubling them compared to when LTO is not enabled.
|
||||||
|
[profile.release-lto]
|
||||||
|
inherits = "release"
|
||||||
|
lto = true
|
||||||
|
# lto can only be enabled when panic strategy is abort
|
||||||
|
panic = "abort"
|
||||||
|
# set codegen-units as the smallest number
|
||||||
|
codegen-units = 1
|
||||||
|
|
|
||||||
9
Makefile
9
Makefile
|
|
@ -8,7 +8,8 @@ BUILD_SYSCALL_TEST ?= 0
|
||||||
ENABLE_KVM ?= 1
|
ENABLE_KVM ?= 1
|
||||||
GDB_TCP_PORT ?= 1234
|
GDB_TCP_PORT ?= 1234
|
||||||
INTEL_TDX ?= 0
|
INTEL_TDX ?= 0
|
||||||
RELEASE_MODE ?= 0
|
RELEASE ?= 0
|
||||||
|
RELEASE_LTO ?= 0
|
||||||
SCHEME ?= ""
|
SCHEME ?= ""
|
||||||
# End of global options.
|
# End of global options.
|
||||||
|
|
||||||
|
|
@ -35,8 +36,10 @@ else ifeq ($(AUTO_TEST), boot)
|
||||||
CARGO_OSDK_ARGS += --init-args="/regression/boot_hello.sh"
|
CARGO_OSDK_ARGS += --init-args="/regression/boot_hello.sh"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(RELEASE_MODE), 1)
|
ifeq ($(RELEASE_LTO), 1)
|
||||||
CARGO_OSDK_ARGS += --profile release
|
CARGO_OSDK_ARGS += --profile release-lto
|
||||||
|
else ifeq ($(RELEASE), 1)
|
||||||
|
CARGO_OSDK_ARGS += --release
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(INTEL_TDX), 1)
|
ifeq ($(INTEL_TDX), 1)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue