size optimized examples build in flake, remove unstable compiler flags from makefile
dynamically linked bin is 16k
This commit is contained in:
parent
d98aec63b0
commit
579a68c77a
3 changed files with 84 additions and 28 deletions
|
@ -39,16 +39,12 @@ CARGO_OBJDIR := cargo/$(RUST_TARGET)/$(_profile)
|
|||
_rust_cli_profile := $(if $(filter $(_profile),debug),dev,$(_profile))
|
||||
|
||||
STRIPFLAGS += -s --strip-unneeded -R .comment -R .gnu.version -R .note -R .note.gnu.build-id -R .note.ABI-tag
|
||||
STATIC_LINK_LIBS += -lservicepoint_binding_c
|
||||
|
||||
size_optimized_CARGOFLAGS += -Zbuild-std="core,std,alloc,proc_macro,panic_abort" \
|
||||
-Zbuild-std-features="panic_immediate_abort"
|
||||
CARGOFLAGS += --manifest-path=$(REPO_ROOT)/Cargo.toml \
|
||||
--profile=$(_rust_cli_profile) \
|
||||
--no-default-features \
|
||||
--features=$(FEATURES) \
|
||||
--target=$(RUST_TARGET) \
|
||||
$($(_profile)_CARGOFLAGS) \
|
||||
--target-dir=cargo
|
||||
|
||||
CFLAGS += -Wall -Wextra -pedantic -fwhole-program -fPIE -pie
|
||||
|
@ -73,7 +69,7 @@ debug_CFLAGS += -Og
|
|||
static_CFLAGS += -static $(STATIC_LINK_LIBS)
|
||||
dynamic_CFLAGS += -Wl,-Bstatic $(STATIC_LINK_LIBS) -Wl,-Bdynamic
|
||||
|
||||
_servicepoint_cflags := -I $(REPO_ROOT)/include -L $(CARGO_OBJDIR)
|
||||
_servicepoint_cflags := $(pkg-config --libs servicepoint --cflags)
|
||||
CFLAGS += $($(_libc)_CFLAGS) $($(_profile)_CFLAGS) $($(_link_type)_CFLAGS) $(_servicepoint_cflags)
|
||||
ifeq ($(LTO), 1)
|
||||
CFLAGS += -flto
|
||||
|
@ -120,4 +116,4 @@ build-rust:
|
|||
$(CARGO) rustc $(CARGOFLAGS) -- $(RUSTFLAGS)
|
||||
|
||||
#----- Begin Boilerplate
|
||||
endif
|
||||
endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue