From 7afa51d9eaf2bf51f6e843af5a2b08d31a6eb210 Mon Sep 17 00:00:00 2001 From: pointer-to-bios Date: Mon, 22 Jan 2024 17:24:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86rust=E7=9A=84=E6=89=80=E6=9C=89?= =?UTF-8?q?=E6=AE=B5=E6=94=BE=E5=9C=A8kend=E5=89=8D=EF=BC=8C=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0release=E6=A8=A1=E5=BC=8F=E4=B8=8Brustc=E7=9A=84?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Makefile | 7 +++++-- src/metaverse.lds | 42 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/src/Makefile b/src/Makefile index cbfd441..fe78fe8 100644 --- a/src/Makefile +++ b/src/Makefile @@ -26,8 +26,11 @@ RSCFLAGS = --emit obj --crate-type lib \ -L crate="${PWD}/../rustlib/${ARCH}/src/" \ -C code-model=large \ -C relocation-model=static \ - -C embed-bitcode=no \ - -C opt-level=z + -C embed-bitcode=no + +ifdef release + RSCFLAGS := -O +endif ifeq (${ARCH},x86_64) RSCFLAGS := ${RSCFLAGS} -C target-feature=-sse,-avx diff --git a/src/metaverse.lds b/src/metaverse.lds index 7bb371b..c1e7568 100644 --- a/src/metaverse.lds +++ b/src/metaverse.lds @@ -62,8 +62,48 @@ SECTIONS { {} .igot.plt : {} + .tbss : + { + *(.tbss) + } + .tdata : + { + *(.tdata) + } + .debug_line : + { + *(.debug_line) + } + .debug_abbrev : + { + *(.debug_abbrev) + } + .debug_info : + { + *(.debug_info) + } + .debug_str : + { + *(.debug_str) + } + .debug_aranges : + { + *(.debug_aranges) + } + .debug_ranges : + { + *(.debug_ranges) + } + .debug_pubnames : + { + *(.debug_pubnames) + } + .debug_pubtypes : + { + *(.debug_pubtypes) + } .kend : { *(.kend) } -} \ No newline at end of file +}