From 3ac7f7621d521f27bca4dd44ebb3453157e03f03 Mon Sep 17 00:00:00 2001 From: xqyjlj Date: Wed, 25 Oct 2023 14:13:08 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20update=20toolchains?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +- .../a/aarch64-smart-musleabi/xmake.lua | 4 +- repo/packages/a/arm-smart-musleabi/xmake.lua | 4 +- repo/packages/p/pcre/xmake.lua | 8 +- .../r/riscv64gc-unknown-smart-musl/xmake.lua | 8 +- tools/ldscripts/aarch64/link.lds | 134 ------------------ tools/ldscripts/aarch64/link.so.lds | 89 ------------ tools/ldscripts/arm/cortex-a/link.lds | 134 ------------------ tools/ldscripts/arm/cortex-a/link.so.lds | 89 ------------ tools/ldscripts/i386/link.lds | 117 --------------- tools/ldscripts/riscv64/link.lds | 124 ---------------- .../modules/rt/private/build/rtflags.lua | 13 -- tools/scripts/rules/rt.cpp.lua | 2 - .../toolchains/aarch64-smart-musleabi.lua | 4 - .../scripts/toolchains/arm-smart-musleabi.lua | 4 - .../riscv64gc-unknown-smart-musl.lua | 3 - .../scripts/toolchains/x86_64-linux-musl.lua | 11 +- 17 files changed, 20 insertions(+), 731 deletions(-) delete mode 100644 tools/ldscripts/aarch64/link.lds delete mode 100644 tools/ldscripts/aarch64/link.so.lds delete mode 100644 tools/ldscripts/arm/cortex-a/link.lds delete mode 100644 tools/ldscripts/arm/cortex-a/link.so.lds delete mode 100644 tools/ldscripts/i386/link.lds delete mode 100644 tools/ldscripts/riscv64/link.lds diff --git a/.gitignore b/.gitignore index 31dc1a9..0b85467 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ build/ .xmake/ rootfs/ .vscode/ -private/ +/private +/prebuilt diff --git a/repo/packages/a/aarch64-smart-musleabi/xmake.lua b/repo/packages/a/aarch64-smart-musleabi/xmake.lua index 387b683..5b57496 100644 --- a/repo/packages/a/aarch64-smart-musleabi/xmake.lua +++ b/repo/packages/a/aarch64-smart-musleabi/xmake.lua @@ -36,7 +36,7 @@ do if (version and sha256) then add_versions(version, sha256) else - add_versions("188177", "01dae6cea76959e7a2684630ca1c295e71ca65a288b4787a6595e93d45edba1e") + add_versions("203958-15706d647d", "49571ae1228a50b1836e5580448e5fe597af6a3346bd6d7b3d21459c29f4c0b8") end elseif is_host("linux") then add_urls( @@ -45,7 +45,7 @@ do if (version and sha256) then add_versions(version, sha256) else - add_versions("188177", "e4e2720c0269eb0b00231f865abe2340f1e994490dfbc3d8617eee48098dbc1d") + add_versions("203958-15706d647d", "f76ea0fabe245b20585f3bf86003a76183a2cad6d07c939877f211439c94dc9f") end end diff --git a/repo/packages/a/arm-smart-musleabi/xmake.lua b/repo/packages/a/arm-smart-musleabi/xmake.lua index fb5664a..1aac552 100644 --- a/repo/packages/a/arm-smart-musleabi/xmake.lua +++ b/repo/packages/a/arm-smart-musleabi/xmake.lua @@ -36,7 +36,7 @@ do if (version and sha256) then add_versions(version, sha256) else - add_versions("174629", "c059a516917a5703456c8414eecb29f1456560ff60707c8a5b352f5ef58bdb72") + add_versions("203958-15706d647d", "79b0e2afef8475b689ba7477d25fb67eda123d4aa135aa2d50dbac4744bc1d05") end elseif is_host("linux") then add_urls( @@ -45,7 +45,7 @@ do if (version and sha256) then add_versions(version, sha256) else - add_versions("174629", "b187482fa807fbfd822eb79ee5a8c0e4e576ad3de4aa088d73b12e21c8de174a") + add_versions("203958-15706d647d", "69d0b888297ac8236c59d90c3affcd71f831f8dc9ac058dcdfb024006f955ce3") end end diff --git a/repo/packages/p/pcre/xmake.lua b/repo/packages/p/pcre/xmake.lua index c3d673d..e7e5bf8 100644 --- a/repo/packages/p/pcre/xmake.lua +++ b/repo/packages/p/pcre/xmake.lua @@ -66,14 +66,12 @@ do table.insert(configs, "-DPCRE_BUILD_PCRE" .. bitwidth .. "=ON") end - local instance = package:toolchain(info.toolchains) - local ld = instance:get("toolset")["ld"] - local cxx = instance:get("toolset")["cxx"] - instance:set("toolset", "ld", cxx) import("package.tools.cmake").install(package, configs, {buildir = "build", ldflags = ldflags}) - instance:set("toolset", "ld", ld) end) on_test(function(package) + local bitwidth = package:config("bitwidth") or "8" + local testfunc = string.format("pcre%s_compile", bitwidth ~= "8" and bitwidth or "") + assert(package:has_cfuncs(testfunc, {includes = "pcre.h"})) end) end diff --git a/repo/packages/r/riscv64gc-unknown-smart-musl/xmake.lua b/repo/packages/r/riscv64gc-unknown-smart-musl/xmake.lua index 13406b1..a305c61 100644 --- a/repo/packages/r/riscv64gc-unknown-smart-musl/xmake.lua +++ b/repo/packages/r/riscv64gc-unknown-smart-musl/xmake.lua @@ -31,21 +31,21 @@ do if is_host("windows") then add_urls( - "https://download-redirect.rt-thread.org/download/rt-smart/toolchains/riscv64-linux-musleabi_for_i686-w64-mingw32_$(version).zip") + "https://download-redirect.rt-thread.org/download/rt-smart/toolchains/riscv64gc-linux-musleabi_for_i686-w64-mingw32_$(version).zip") if (version and sha256) then add_versions(version, sha256) else - add_versions("180881", "7b385fe663559985d70936832dc0f6c017ce3bddbdbfaff673996cc3a20faf6c") + add_versions("203957-8a397096c1", "0c4a43bc40ddee60774ce384d13760d235e51fd70658c5da0503caec1dd511e4") end elseif is_host("linux") then add_urls( - "https://download-redirect.rt-thread.org/download/rt-smart/toolchains/riscv64-linux-musleabi_for_x86_64-pc-linux-gnu_$(version).tar.bz2") + "https://download-redirect.rt-thread.org/download/rt-smart/toolchains/riscv64gc-linux-musleabi_for_x86_64-pc-linux-gnu_$(version).tar.bz2") if (version and sha256) then add_versions(version, sha256) else - add_versions("180881", "21ad2cbd9b4e73e61efd8211b88c3989acaa033a374ac2f26b4e15a7ec7370b6") + add_versions("203957-8a397096c1", "19d9a73b1dff1d941953fcb673443259d89362c2e56d1d260af0cc503d9e9f5b") end end diff --git a/tools/ldscripts/aarch64/link.lds b/tools/ldscripts/aarch64/link.lds deleted file mode 100644 index 86f5b63..0000000 --- a/tools/ldscripts/aarch64/link.lds +++ /dev/null @@ -1,134 +0,0 @@ -/* Linker script to configure memory regions. */ - -/* Linker script to place sections and symbol values. Should be used together - * with other linker script that defines memory regions FLASH and RAM. - * It references following symbols, which must be defined in code: - * Reset_Handler : Entry of reset handler - * - * It defines following symbols, which code can use without definition: - * __exidx_start - * __exidx_end - * __etext - * __data_start__ - * __preinit_array_start - * __preinit_array_end - * __init_array_start - * __init_array_end - * __fini_array_start - * __fini_array_end - * __data_end__ - * __bss_start__ - * __bss_end__ - * __end__ - * end - * __HeapLimit - * __StackLimit - * __StackTop - * __stack - */ -ENTRY(_start) - -SECTIONS -{ - . = 0x200000; - - .text : - { - __text_start__ = .; - KEEP(*(.first)) - *(.text*) - - KEEP(*(.init)) - KEEP(*(.fini)) - - /* .ctors */ - *crtbegin.o(.ctors) - *crtbegin?.o(.ctors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) - *(SORT(.ctors.*)) - *(.ctors) - - /* .dtors */ - *crtbegin.o(.dtors) - *crtbegin?.o(.dtors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) - *(SORT(.dtors.*)) - *(.dtors) - - *(.rodata*) - - KEEP(*(.eh_frame*)) - } - - . = ALIGN(0x1000); /* must define page align after .text */ - - __exidx_start = .; - .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } - __exidx_end = .; - - .rela.dyn : - { - *(.rela.init) - *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) - *(.rela.fini) - *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) - *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) - *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) - *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) - *(.rela.ctors) - *(.rela.dtors) - *(.rela.got) - *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) - *(.rela.ifunc) - } - .rela.plt : - { - *(.rela.plt) - *(.rela.iplt) - } - .plt : ALIGN(16) { *(.plt) *(.iplt) } - .dynamic : { *(.dynamic) } - .got : { *(.got) *(.igot) } - .got.plt : { *(.got.plt) *(.igot.plt) } - - data : - { - __data_start__ = .; - - *(vtable) - *(.data*) - - . = ALIGN(8); - /* preinit data */ - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP(*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - - . = ALIGN(8); - /* init data */ - PROVIDE_HIDDEN (__init_array_start = .); - KEEP(*(SORT(.init_array.*))) - KEEP(*(.init_array)) - PROVIDE_HIDDEN (__init_array_end = .); - - . = ALIGN(8); - /* finit data */ - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP(*(SORT(.fini_array.*))) - KEEP(*(.fini_array)) - PROVIDE_HIDDEN (__fini_array_end = .); - - . = ALIGN(8); - /* All data end */ - __data_end__ = .; - } - - bss : - { - __bss_start__ = .; - *(.bss*) - *(COMMON) - *(.stack) - __bss_end__ = .; - } -} diff --git a/tools/ldscripts/aarch64/link.so.lds b/tools/ldscripts/aarch64/link.so.lds deleted file mode 100644 index cc58b84..0000000 --- a/tools/ldscripts/aarch64/link.so.lds +++ /dev/null @@ -1,89 +0,0 @@ -/* Linker script to configure memory regions. */ - -/* Linker script to place sections and symbol values. Should be used together - * with other linker script that defines memory regions FLASH and RAM. - * It references following symbols, which must be defined in code: - * Reset_Handler : Entry of reset handler - * - * It defines following symbols, which code can use without definition: - * __exidx_start - * __exidx_end - * __etext - * __data_start__ - * __preinit_array_start - * __preinit_array_end - * __init_array_start - * __init_array_end - * __fini_array_start - * __fini_array_end - * __data_end__ - * __bss_start__ - * __bss_end__ - * __end__ - * end - * __HeapLimit - * __StackLimit - * __StackTop - * __stack - */ -ENTRY(_start) - -SECTIONS -{ - . = 0x201000; - - .text : - { - __text_start__ = .; - KEEP(*(.first)) - *(.text*) - - KEEP(*(.init)) - KEEP(*(.fini)) - - /* .ctors */ - *crtbegin.o(.ctors) - *crtbegin?.o(.ctors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) - *(SORT(.ctors.*)) - *(.ctors) - - /* .dtors */ - *crtbegin.o(.dtors) - *crtbegin?.o(.dtors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) - *(SORT(.dtors.*)) - *(.dtors) - - *(.rodata*) - - KEEP(*(.eh_frame*)) - } - - . = ALIGN(0x1000); - - __exidx_start = .; - .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } - __exidx_end = .; - - data : - { - __data_start__ = .; - - *(vtable) - *(.data*) - - . = ALIGN(8); - /* All data end */ - __data_end__ = .; - } - - bss : - { - __bss_start__ = .; - *(.bss*) - *(COMMON) - *(.stack) - __bss_end__ = .; - } -} diff --git a/tools/ldscripts/arm/cortex-a/link.lds b/tools/ldscripts/arm/cortex-a/link.lds deleted file mode 100644 index 51558eb..0000000 --- a/tools/ldscripts/arm/cortex-a/link.lds +++ /dev/null @@ -1,134 +0,0 @@ -/* Linker script to configure memory regions. */ - -/* Linker script to place sections and symbol values. Should be used together - * with other linker script that defines memory regions FLASH and RAM. - * It references following symbols, which must be defined in code: - * Reset_Handler : Entry of reset handler - * - * It defines following symbols, which code can use without definition: - * __exidx_start - * __exidx_end - * __etext - * __data_start__ - * __preinit_array_start - * __preinit_array_end - * __init_array_start - * __init_array_end - * __fini_array_start - * __fini_array_end - * __data_end__ - * __bss_start__ - * __bss_end__ - * __end__ - * end - * __HeapLimit - * __StackLimit - * __StackTop - * __stack - */ -ENTRY(_start) - -SECTIONS -{ - . = 0x100000; - - .text : - { - __text_start__ = .; - KEEP(*(.first)) - *(.text*) - - KEEP(*(.init)) - KEEP(*(.fini)) - - /* .ctors */ - *crtbegin.o(.ctors) - *crtbegin?.o(.ctors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) - *(SORT(.ctors.*)) - *(.ctors) - - /* .dtors */ - *crtbegin.o(.dtors) - *crtbegin?.o(.dtors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) - *(SORT(.dtors.*)) - *(.dtors) - - *(.rodata*) - - KEEP(*(.eh_frame*)) - } - - . = ALIGN(0x1000); /* must define page align after .text */ - - __exidx_start = .; - .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } - __exidx_end = .; - - .rela.dyn : - { - *(.rela.init) - *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) - *(.rela.fini) - *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) - *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) - *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) - *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) - *(.rela.ctors) - *(.rela.dtors) - *(.rela.got) - *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) - *(.rela.ifunc) - } - .rela.plt : - { - *(.rela.plt) - *(.rela.iplt) - } - .plt : ALIGN(16) { *(.plt) *(.iplt) } - .dynamic : { *(.dynamic) } - .got : { *(.got) *(.igot) } - .got.plt : { *(.got.plt) *(.igot.plt) } - - data : - { - __data_start__ = .; - - *(vtable) - *(.data*) - - . = ALIGN(4); - /* preinit data */ - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP(*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - - . = ALIGN(4); - /* init data */ - PROVIDE_HIDDEN (__init_array_start = .); - KEEP(*(SORT(.init_array.*))) - KEEP(*(.init_array)) - PROVIDE_HIDDEN (__init_array_end = .); - - . = ALIGN(4); - /* finit data */ - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP(*(SORT(.fini_array.*))) - KEEP(*(.fini_array)) - PROVIDE_HIDDEN (__fini_array_end = .); - - . = ALIGN(4); - /* All data end */ - __data_end__ = .; - } - - bss : - { - __bss_start__ = .; - *(.bss*) - *(COMMON) - *(.stack) - __bss_end__ = .; - } -} diff --git a/tools/ldscripts/arm/cortex-a/link.so.lds b/tools/ldscripts/arm/cortex-a/link.so.lds deleted file mode 100644 index 80747e7..0000000 --- a/tools/ldscripts/arm/cortex-a/link.so.lds +++ /dev/null @@ -1,89 +0,0 @@ -/* Linker script to configure memory regions. */ - -/* Linker script to place sections and symbol values. Should be used together - * with other linker script that defines memory regions FLASH and RAM. - * It references following symbols, which must be defined in code: - * Reset_Handler : Entry of reset handler - * - * It defines following symbols, which code can use without definition: - * __exidx_start - * __exidx_end - * __etext - * __data_start__ - * __preinit_array_start - * __preinit_array_end - * __init_array_start - * __init_array_end - * __fini_array_start - * __fini_array_end - * __data_end__ - * __bss_start__ - * __bss_end__ - * __end__ - * end - * __HeapLimit - * __StackLimit - * __StackTop - * __stack - */ -ENTRY(_start) - -SECTIONS -{ - . = 0x201000; - - .text : - { - __text_start__ = .; - KEEP(*(.first)) - *(.text*) - - KEEP(*(.init)) - KEEP(*(.fini)) - - /* .ctors */ - *crtbegin.o(.ctors) - *crtbegin?.o(.ctors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) - *(SORT(.ctors.*)) - *(.ctors) - - /* .dtors */ - *crtbegin.o(.dtors) - *crtbegin?.o(.dtors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) - *(SORT(.dtors.*)) - *(.dtors) - - *(.rodata*) - - KEEP(*(.eh_frame*)) - } - - . = ALIGN(0x1000); - - __exidx_start = .; - .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } - __exidx_end = .; - - data : - { - __data_start__ = .; - - *(vtable) - *(.data*) - - . = ALIGN(4); - /* All data end */ - __data_end__ = .; - } - - bss : - { - __bss_start__ = .; - *(.bss*) - *(COMMON) - *(.stack) - __bss_end__ = .; - } -} diff --git a/tools/ldscripts/i386/link.lds b/tools/ldscripts/i386/link.lds deleted file mode 100644 index e055c13..0000000 --- a/tools/ldscripts/i386/link.lds +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (c) 2006-2021, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - * 2021/7/22 JasonHu The first version - */ - -OUTPUT_ARCH(i386) -ENTRY(_start) -SECTIONS -{ - . = 0x40000000; /* user start at 1G memory addr */ - - .text : - { - __text_start__ = .; - KEEP(*(.first)) - *(.text*) - - KEEP(*(.init)) - KEEP(*(.fini)) - - /* .ctors */ - *crtbegin.o(.ctors) - *crtbegin?.o(.ctors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) - *(SORT(.ctors.*)) - *(.ctors) - - /* .dtors */ - *crtbegin.o(.dtors) - *crtbegin?.o(.dtors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) - *(SORT(.dtors.*)) - *(.dtors) - - *(.rodata*) - - KEEP(*(.eh_frame*)) - } - - . = ALIGN(0x1000); /* must define page align after .text */ - - __exidx_start = .; - .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } - __exidx_end = .; - - .rela.dyn : - { - *(.rela.init) - *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) - *(.rela.fini) - *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) - *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) - *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) - *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) - *(.rela.ctors) - *(.rela.dtors) - *(.rela.got) - *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) - *(.rela.ifunc) - } - .rela.plt : - { - *(.rela.plt) - *(.rela.iplt) - } - .plt : ALIGN(16) { *(.plt) *(.iplt) } - .dynamic : { *(.dynamic) } - .got : { *(.got) *(.igot) } - .got.plt : { *(.got.plt) *(.igot.plt) } - - data : - { - __data_start__ = .; - - *(vtable) - *(.data*) - - . = ALIGN(4); - /* preinit data */ - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP(*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - - . = ALIGN(4); - /* init data */ - PROVIDE_HIDDEN (__init_array_start = .); - KEEP(*(SORT(.init_array.*))) - KEEP(*(.init_array)) - PROVIDE_HIDDEN (__init_array_end = .); - - . = ALIGN(4); - /* finit data */ - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP(*(SORT(.fini_array.*))) - KEEP(*(.fini_array)) - PROVIDE_HIDDEN (__fini_array_end = .); - - . = ALIGN(4); - /* All data end */ - __data_end__ = .; - } - - bss : - { - __bss_start__ = .; - *(.bss*) - *(COMMON) - *(.stack) - __bss_end__ = .; - } -} - diff --git a/tools/ldscripts/riscv64/link.lds b/tools/ldscripts/riscv64/link.lds deleted file mode 100644 index e229686..0000000 --- a/tools/ldscripts/riscv64/link.lds +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (c) 2006-2020, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - * 2020/12/12 bernard The first version - */ - -OUTPUT_ARCH( "riscv" ) - -ENTRY(_start) -SECTIONS -{ - /* - * 64bit userspace: 0x200000000 (default) - * 32bit userspace: 0xD0000000 - */ - . = 0x200000000; - - .text : - { - __text_start__ = .; - *(.start); - *(.text*) /* remaining code */ - - KEEP(*(.init)) - KEEP(*(.fini)) - - /* .ctors */ - *crtbegin.o(.ctors) - *crtbegin?.o(.ctors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) - *(SORT(.ctors.*)) - *(.ctors) - - /* .dtors */ - *crtbegin.o(.dtors) - *crtbegin?.o(.dtors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) - *(SORT(.dtors.*)) - *(.dtors) - - *(.rodata*) /* read-only data (constants) */ - - KEEP(*(.eh_frame*)) - - . = ALIGN(8); - _etext = .; - __text_end__ = .; - } - - . = ALIGN(0x1000); /* must define page align after .text */ - - .rela.dyn : - { - *(.rela.init) - *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) - *(.rela.fini) - *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) - *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) - *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) - *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) - *(.rela.ctors) - *(.rela.dtors) - *(.rela.got) - *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) - *(.rela.ifunc) - } - .rela.plt : - { - *(.rela.plt) - *(.rela.iplt) - } - .plt : ALIGN(16) { *(.plt) *(.iplt) } - .dynamic : { *(.dynamic) } - .got : { *(.got) *(.igot) } - .got.plt : { *(.got.plt) *(.igot.plt) } - - data : - { - __data_start__ = .; - - *(vtable) - *(.data*) - - . = ALIGN(8); - /* preinit data */ - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP(*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - - . = ALIGN(8); - /* init data */ - PROVIDE_HIDDEN (__init_array_start = .); - KEEP(*(SORT(.init_array.*))) - KEEP(*(.init_array)) - PROVIDE_HIDDEN (__init_array_end = .); - - . = ALIGN(8); - /* finit data */ - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP(*(SORT(.fini_array.*))) - KEEP(*(.fini_array)) - PROVIDE_HIDDEN (__fini_array_end = .); - - . = ALIGN(8); - /* All data end */ - __data_end__ = .; - } - - bss : - { - __bss_start__ = .; - *(.bss*) - *(COMMON) - *(.stack) - __bss_end__ = .; - } - - _end = .; -} - diff --git a/tools/scripts/modules/rt/private/build/rtflags.lua b/tools/scripts/modules/rt/private/build/rtflags.lua index 2067acf..b16bb9e 100644 --- a/tools/scripts/modules/rt/private/build/rtflags.lua +++ b/tools/scripts/modules/rt/private/build/rtflags.lua @@ -41,25 +41,12 @@ function get_ldscripts(shared) return {ldflags = {}} end - local rootdir = rt_utils.ldscripts_dir() - local arch = get_real_arch() local ldflags = {} - if arch == "arm" then - arch = "arm/cortex-a" - elseif string.startswith(arch, "riscv64") then - arch = "riscv64" - end - if not shared then - table.insert(ldflags, "-n") table.insert(ldflags, "--static") end - local linkerscript = path.join(rootdir, arch, "link" .. (shared and ".so" or "") .. ".lds") - table.insert(ldflags, "-T") - table.insert(ldflags, linkerscript) - return {ldflags = ldflags} end diff --git a/tools/scripts/rules/rt.cpp.lua b/tools/scripts/rules/rt.cpp.lua index dfeb1a5..52ec3bd 100644 --- a/tools/scripts/rules/rt.cpp.lua +++ b/tools/scripts/rules/rt.cpp.lua @@ -27,8 +27,6 @@ do import("rt.private.build.rtflags") local flags = rtflags.get_sdk() - local cxx, _ = target:tool("cxx") - target:set("toolset", "ld", cxx) if config.get("target_os") ~= "rt-smart" then return diff --git a/tools/scripts/toolchains/aarch64-smart-musleabi.lua b/tools/scripts/toolchains/aarch64-smart-musleabi.lua index d6b1afc..ec4f062 100644 --- a/tools/scripts/toolchains/aarch64-smart-musleabi.lua +++ b/tools/scripts/toolchains/aarch64-smart-musleabi.lua @@ -31,9 +31,6 @@ do import("rt.private.build.rtflags") toolchain:load_cross_toolchain() - toolchain:set("toolset", "cxx", "aarch64-linux-musleabi-g++") - toolchain:set("toolset", "ld", "aarch64-linux-musleabi-gcc") - toolchain:add("cxflags", "-march=armv8-a", {force = true}) local link_type = os.getenv("RT_XMAKE_LINK_TYPE") or "shared" @@ -44,7 +41,6 @@ do local ldscript = rtflags.get_ldscripts(true) toolchain:add("ldflags", ldscript.ldflags, {force = true}) end - toolchain:add("ldflags", "-Wl,--no-warn-rwx-segments", {force = true}) end) end toolchain_end() diff --git a/tools/scripts/toolchains/arm-smart-musleabi.lua b/tools/scripts/toolchains/arm-smart-musleabi.lua index 766801e..c823875 100644 --- a/tools/scripts/toolchains/arm-smart-musleabi.lua +++ b/tools/scripts/toolchains/arm-smart-musleabi.lua @@ -30,9 +30,6 @@ do import("rt.private.build.rtflags") toolchain:load_cross_toolchain() - toolchain:set("toolset", "cxx", "arm-linux-musleabi-g++") - toolchain:set("toolset", "ld", "arm-linux-musleabi-gcc") - toolchain:add("cxflags", "-march=armv7-a", "-marm", "-msoft-float", {force = true}) local link_type = os.getenv("RT_XMAKE_LINK_TYPE") or "shared" @@ -43,7 +40,6 @@ do local ldscript = rtflags.get_ldscripts(true) toolchain:add("ldflags", ldscript.ldflags, {force = true}) end - toolchain:add("ldflags", "-Wl,--no-warn-rwx-segments", {force = true}) end) end toolchain_end() diff --git a/tools/scripts/toolchains/riscv64gc-unknown-smart-musl.lua b/tools/scripts/toolchains/riscv64gc-unknown-smart-musl.lua index eb01aec..67e9454 100644 --- a/tools/scripts/toolchains/riscv64gc-unknown-smart-musl.lua +++ b/tools/scripts/toolchains/riscv64gc-unknown-smart-musl.lua @@ -30,9 +30,6 @@ do import("rt.private.build.rtflags") toolchain:load_cross_toolchain() - toolchain:set("toolset", "cxx", "riscv64-unknown-linux-musl-g++") - toolchain:set("toolset", "ld", "riscv64-unknown-linux-musl-gcc") - toolchain:add("cxflags", "-mcmodel=medany", "-march=rv64imafdc", "-mabi=lp64", {force = true}) local link_type = os.getenv("RT_XMAKE_LINK_TYPE") or "shared" diff --git a/tools/scripts/toolchains/x86_64-linux-musl.lua b/tools/scripts/toolchains/x86_64-linux-musl.lua index f0ec352..2c0a93e 100644 --- a/tools/scripts/toolchains/x86_64-linux-musl.lua +++ b/tools/scripts/toolchains/x86_64-linux-musl.lua @@ -27,10 +27,13 @@ do on_load(function(toolchain) toolchain:load_cross_toolchain() - toolchain:set("toolset", "cxx", "x86_64-linux-musl-g++") - toolchain:set("toolset", "ld", "x86_64-linux-musl-gcc") - - toolchain:add("ldflags", "--static", {force = true}) + local link_type = os.getenv("RT_XMAKE_LINK_TYPE") or "shared" + if link_type == "static" then + toolchain:add("ldflags", "--static", {force = true}) + else + toolchain:add("ldflags", string.format("-Wl,-rpath=%s/x86_64-linux-musl/lib", toolchain:sdkdir()), + {force = true}) + end end) end toolchain_end()