From 07d0b5b9f1690d7abab1e321f541bcad11733900 Mon Sep 17 00:00:00 2001 From: Scott Duensing Date: Sat, 27 Apr 2024 20:35:38 -0500 Subject: [PATCH] Working on binary installers for various hosts. --- .gitignore | 5 + build-llvm-mos.sh | 18 ++- distro/f256-install-linux.sh | 57 +++++++++ distro/f256-install-windows.bat | 94 +++++++++++++++ .../mos-platform/CMakeLists.txt | 81 ------------- .../{f256k => f256}/CMakeLists.txt | 10 +- .../mos-platform/{f256k => f256}/clang.cfg | 2 +- .../mos-platform/f256/link.ld | 113 ++++++++++++++++++ .../mos-platform/f256/output.ld | 1 + .../mos-platform/f256k/link.ld | 50 -------- .../mos-platform/f256k/settings.ld | 1 - 11 files changed, 293 insertions(+), 139 deletions(-) create mode 100755 distro/f256-install-linux.sh create mode 100644 distro/f256-install-windows.bat delete mode 100644 llvm-mos-sdk-patches/mos-platform/CMakeLists.txt rename llvm-mos-sdk-patches/mos-platform/{f256k => f256}/CMakeLists.txt (55%) rename llvm-mos-sdk-patches/mos-platform/{f256k => f256}/clang.cfg (70%) create mode 100644 llvm-mos-sdk-patches/mos-platform/f256/link.ld create mode 100644 llvm-mos-sdk-patches/mos-platform/f256/output.ld delete mode 100644 llvm-mos-sdk-patches/mos-platform/f256k/link.ld delete mode 100644 llvm-mos-sdk-patches/mos-platform/f256k/settings.ld diff --git a/.gitignore b/.gitignore index dd0b28d..40e9886 100644 --- a/.gitignore +++ b/.gitignore @@ -45,6 +45,11 @@ generated/ overlay overlayhelper f256lib.h +/distro/llvm-mos + +# These aren't for public use or aren't ready. +build-foenix-ide.sh +/test.sh # Dumb QtCreator junk build-*/ diff --git a/build-llvm-mos.sh b/build-llvm-mos.sh index 6750dc6..9ac4808 100755 --- a/build-llvm-mos.sh +++ b/build-llvm-mos.sh @@ -23,7 +23,8 @@ # -INSTALL=$(pwd)/llvm-mos +ROOT=$(pwd) +INSTALL=${ROOT}/llvm-mos if [[ ! -d llvm-mos-source ]] || [[ "${1,,}" == "all" ]]; then sudo apt-get install -y cmake ninja-build @@ -47,7 +48,12 @@ if [[ ! -d llvm-mos-sdk-source ]]; then git clone https://github.com/llvm-mos/llvm-mos-sdk.git llvm-mos-sdk-source fi +LIST=llvm-mos-sdk-source/mos-platform/CMakeLists.txt cp -Rf llvm-mos-sdk-patches/* llvm-mos-sdk-source/. +if [[ ! -e ${LIST}.original ]]; then + cp -f ${LIST} ${LIST}.original + echo "add_subdirectory(f256)" >> ${LIST} +fi pushd llvm-mos-sdk-source if [[ -d .builddir ]]; then @@ -60,6 +66,16 @@ pushd llvm-mos-sdk-source -DCMAKE_INSTALL_PREFIX=${INSTALL} \ .. ninja install + + mkdir -p distro + pushd distro + mkdir -p llvm-mos/mos-platform/f256 + mkdir -p llvm-mos/bin + cp -Rf ${INSTALL}/mos-platform/f256/* llvm-mos/mos-platform/f256/. + cp -f ${INSTALL}/bin/mos-f256.cfg llvm-mos/bin/. + tar cJf llvm-mos-f256.tar.xz llvm-mos + 7z a llvm-mos-f256.7z llvm-mos + popd popd popd diff --git a/distro/f256-install-linux.sh b/distro/f256-install-linux.sh new file mode 100755 index 0000000..20c5267 --- /dev/null +++ b/distro/f256-install-linux.sh @@ -0,0 +1,57 @@ +#!/bin/bash + +# +# Copyright (c) 2024 Scott Duensing, scott@kangaroopunch.com +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + + +REMOTE1=https://github.com/llvm-mos/llvm-mos-sdk/releases/latest/download/llvm-mos-linux.tar.xz +LOCAL1=llvm-mos-linux.tar.xz + +REMOTE2=https://kangaroopunch.com/files/serve/shared/llvm-mos-f256.tar.xz +LOCAL2=llvm-mos-f256.tar.xz + + +if [[ -d $(basename -s .tar.xz ${LOCAL1}) ]]; then + echo "You already have an llvm-mos directory. Exiting." + exit 1 +fi + +CURL=$(which curl) +if [[ $? == 0 ]]; then + ${CURL} -L ${REMOTE1} > ${LOCAL1} + ${CURL} -L ${REMOTE2} > ${LOCAL2} +else + WGET=$(which wget) + if [[ $? == 0 ]]; then + wget ${REMOTE1} + wget ${REMOTE2} + else + echo "Unable to locate curl or wget. Exiting." + exit 1 + fi +fi + +tar xf ${LOCAL1} +rm ${LOCAL1} + +tar xf ${LOCAL2} +rm ${LOCAL2} diff --git a/distro/f256-install-windows.bat b/distro/f256-install-windows.bat new file mode 100644 index 0000000..b9c079f --- /dev/null +++ b/distro/f256-install-windows.bat @@ -0,0 +1,94 @@ +@echo off +goto top + + +# +# Copyright (c) 2024 Scott Duensing, scott@kangaroopunch.com +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + + +:top + + +set REMOTE1=https://github.com/llvm-mos/llvm-mos-sdk/releases/latest/download/llvm-mos-windows.7z +set LOCAL1=llvm-mos-windows.7z + +set REMOTE2=https://kangaroopunch.com/files/serve/shared/llvm-mos-f256.7z +set LOCAL2=llvm-mos-f256.7z + +set REMOTE3=https://aka.ms/vs/16/release/vc_redist.x64.exe +set LOCAL3=vc_redist.x64.exe + + +if exist llvm-mos\ ( + echo You already have an llvm-mos directory. Exiting. + exit /B +) + +where /q curl.exe +if errorlevel 1 ( + where /q bitsadmin.exe + if errorlevel 1 ( + echo Unable to locate curl or bitsadmin. Exiting. + exit /B + ) else ( + bitsadmin.exe /transfer GoGoWindows /download /priority normal %REMOTE1% "%~dp0%LOCAL1%" + bitsadmin.exe /transfer GoGoWindows /download /priority normal %REMOTE2% "%~dp0%LOCAL2%" + bitsadmin.exe /transfer GoGoWindows /download /priority normal %REMOTE3% "%~dp0%LOCAL3%" + ) +) else ( + curl.exe -L %REMOTE1% > %LOCAL1% + curl.exe -L %REMOTE2% > %LOCAL2% + curl.exe -L %REMOTE2% > %LOCAL3% +) + +%LOCAL3% /install /passive + +if exist "%ProgramFiles%\7-Zip\7z.exe" ( + "%ProgramFiles%\7-Zip\7z.exe" x %LOCAL1% + "%ProgramFiles%\7-Zip\7z.exe" x %LOCAL2% +) else ( + if exist "%ProgramFiles%\WinRAR\UnRAR.exe" ( + "%ProgramFiles%\WinRAR\UnRAR.exe" x %LOCAL1% + "%ProgramFiles%\WinRAR\UnRAR.exe" x %LOCAL2% + ) else ( + echo Unable to find 7-Zip or WinRAR. Exiting. + del %LOCAL1% + del %LOCAL2% + del %LOCAL3% + exit /B + ) +) + +del %LOCAL1% +del %LOCAL2% +del %LOCAL3% + +echo @"%%~dp0mos-clang++.exe" --config mos-f256.cfg %%* > llvm-mos/bin/mos-f256-clang++.bat +echo @"%%~dp0mos-clang-cpp.exe" --config mos-f256.cfg %%* > llvm-mos/bin/mos-f256-clang-cpp.bat +echo @"%%~dp0mos-clang.exe" --config mos-f256.cfg %%* > llvm-mos/bin/mos-f256-clang.bat + +echo. +echo Installation complete! +echo. +echo It is recommended that you add the following to your PATH: +echo %~dp0llvm-mos\bin +echo. diff --git a/llvm-mos-sdk-patches/mos-platform/CMakeLists.txt b/llvm-mos-sdk-patches/mos-platform/CMakeLists.txt deleted file mode 100644 index 60bf2b8..0000000 --- a/llvm-mos-sdk-patches/mos-platform/CMakeLists.txt +++ /dev/null @@ -1,81 +0,0 @@ -include(platform) - -if (CMAKE_CROSSCOMPILING) - add_compile_options(-flto) -else() - # Make nested build directory cross-compiling to MOS, but using this - # CMakeLists.txt. - ExternalProject_Add(mos-platform - SOURCE_DIR ${CMAKE_SOURCE_DIR} - BINARY_DIR build - INSTALL_DIR build/install - STAMP_DIR build/stamp - TMP_DIR build/tmp - DOWNLOAD_DIR build - CMAKE_ARGS - -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} - -DCMAKE_INSTALL_PREFIX= - -DCMAKE_TOOLCHAIN_FILE=${CMAKE_SOURCE_DIR}/cmake/llvm-mos-toolchain.cmake - -DCMAKE_C_COMPILER=${LLVM_MOS_C_COMPILER} - -DCMAKE_CXX_COMPILER=${LLVM_MOS_CXX_COMPILER} - -DCMAKE_ASM_COMPILER=${LLVM_MOS_ASM_COMPILER} - -DCMAKE_C_FLAGS=${LLVM_MOS_ARCH_FLAGS} - -DCMAKE_CXX_FLAGS=${LLVM_MOS_ARCH_FLAGS} - -DCMAKE_ASM_FLAGS=${LLVM_MOS_ARCH_FLAGS} - -DCMAKE_EXPORT_COMPILE_COMMANDS=${CMAKE_EXPORT_COMPILE_COMMANDS} - USES_TERMINAL_CONFIGURE On - USES_TERMINAL_BUILD On - USES_TERMINAL_INSTALL On - BUILD_ALWAYS On) - ExternalProject_Get_Property(mos-platform INSTALL_DIR) - install(DIRECTORY ${INSTALL_DIR}/ DESTINATION .) - - # Clean the build directories with the host project. - set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY - ADDITIONAL_CLEAN_FILES build ../examples) - - find_package(Doxygen OPTIONAL_COMPONENTS dot) - if (Doxygen_FOUND) - set(DOXYGEN_FILE_PATTERNS *) - set(DOXYGEN_EXTENSION_MAPPING no_extension=C++) - set(DOXYGEN_EXTRACT_ALL YES) - set(DOXYGEN_EXCLUDE_SYMBOLS __*) - set(DOXYGEN_EXCLUDE_PATTERNS *.c *.cc *.s *.S *.cfg *.ld *.awk __*) - doxygen_add_docs(doxygen .) - endif() -endif() - -add_subdirectory(common) -add_subdirectory(atari2600-common) -add_subdirectory(atari2600-4k) -add_subdirectory(atari2600-3e) -add_subdirectory(atari8-common) -add_subdirectory(atari8-dos) -add_subdirectory(atari8-cart-std) -add_subdirectory(atari8-cart-xegs) -add_subdirectory(commodore) -add_subdirectory(c64) -add_subdirectory(c128) -add_subdirectory(cpm65) -add_subdirectory(cx16) -add_subdirectory(eater) -add_subdirectory(f256k) -add_subdirectory(mega65) -add_subdirectory(sim) -add_subdirectory(nes) -add_subdirectory(nes-action53) -add_subdirectory(nes-cnrom) -add_subdirectory(nes-gtrom) -add_subdirectory(nes-nrom) -add_subdirectory(nes-mmc1) -add_subdirectory(nes-mmc3) -add_subdirectory(nes-unrom) -add_subdirectory(nes-unrom-512) -add_subdirectory(osi-c1p) -add_subdirectory(dodo) -add_subdirectory(pet) -add_subdirectory(rpc8e) -add_subdirectory(pce-common) -add_subdirectory(pce) -add_subdirectory(pce-cd) -add_subdirectory(vic20) diff --git a/llvm-mos-sdk-patches/mos-platform/f256k/CMakeLists.txt b/llvm-mos-sdk-patches/mos-platform/f256/CMakeLists.txt similarity index 55% rename from llvm-mos-sdk-patches/mos-platform/f256k/CMakeLists.txt rename to llvm-mos-sdk-patches/mos-platform/f256/CMakeLists.txt index 5fed33b..5ab7bac 100644 --- a/llvm-mos-sdk-patches/mos-platform/f256k/CMakeLists.txt +++ b/llvm-mos-sdk-patches/mos-platform/f256/CMakeLists.txt @@ -1,4 +1,4 @@ -platform(f256k COMPLETE PARENT common) +platform(f256 COMPLETE PARENT common) if(NOT CMAKE_CROSSCOMPILING) return() @@ -8,11 +8,11 @@ file(READ clang.cfg CONFIG) install(FILES link.ld - settings.ld + output.ld TYPE LIB) -add_platform_library(f256k-crt0) -merge_libraries(f256k-crt0 +add_platform_library(f256-crt0) +merge_libraries(f256-crt0 common-crt0 common-init-stack common-copy-zp-data @@ -20,4 +20,4 @@ merge_libraries(f256k-crt0 common-exit-loop ) -target_compile_options(f256k-crt0 PUBLIC -mcpu=mosw65c02) +target_compile_options(f256-crt0 PUBLIC -mcpu=mosw65c02) diff --git a/llvm-mos-sdk-patches/mos-platform/f256k/clang.cfg b/llvm-mos-sdk-patches/mos-platform/f256/clang.cfg similarity index 70% rename from llvm-mos-sdk-patches/mos-platform/f256k/clang.cfg rename to llvm-mos-sdk-patches/mos-platform/f256/clang.cfg index 96e3500..4540025 100644 --- a/llvm-mos-sdk-patches/mos-platform/f256k/clang.cfg +++ b/llvm-mos-sdk-patches/mos-platform/f256/clang.cfg @@ -1,3 +1,3 @@ -mlto-zp=192 --D__F256K__ +-D__F256__ -mcpu=mosw65c02 diff --git a/llvm-mos-sdk-patches/mos-platform/f256/link.ld b/llvm-mos-sdk-patches/mos-platform/f256/link.ld new file mode 100644 index 0000000..3877c7c --- /dev/null +++ b/llvm-mos-sdk-patches/mos-platform/f256/link.ld @@ -0,0 +1,113 @@ +/* fake C Stack */ +PROVIDE(__stack = 0xA000); +/* entry point to my program - 0x200 to 0x2ff are command line arguments */ +PROVIDE(__f256_start = 0x300); +/* page size of a block of memory */ +PROVIDE(__BLOCK_SIZE = 0x2000); +/* swappable block address */ +PROVIDE(__SLOT_ADDR = 0xA000); + +/* f256k uses first 16 bytes of ZP for mmu control? */ +__rc0 = 0x10; +INCLUDE imag-regs.ld +ASSERT(__rc0 == 0x10, "Inconsistent zero page map.") +ASSERT(__rc31 == 0x2f, "Inconsistent zero page map.") + +MEMORY { + /* kernel uses 0xf0-0xff for parameter passing */ + zp : ORIGIN = __rc31 + 1, LENGTH = 0xF0 - (__rc31 + 1) + ram (rw) : ORIGIN = __f256_start, LENGTH = __stack-__f256_start +} + +/* LMAs */ +__block8_lma = ( 8<<24)|__SLOT_ADDR; +__block9_lma = ( 9<<24)|__SLOT_ADDR; +__block10_lma = (10<<24)|__SLOT_ADDR; +__block11_lma = (11<<24)|__SLOT_ADDR; +__block12_lma = (12<<24)|__SLOT_ADDR; +__block13_lma = (13<<24)|__SLOT_ADDR; +__block14_lma = (14<<24)|__SLOT_ADDR; +__block15_lma = (15<<24)|__SLOT_ADDR; +__block16_lma = (16<<24)|__SLOT_ADDR; +__block17_lma = (17<<24)|__SLOT_ADDR; +__block18_lma = (18<<24)|__SLOT_ADDR; +__block19_lma = (19<<24)|__SLOT_ADDR; +__block20_lma = (20<<24)|__SLOT_ADDR; +__block21_lma = (21<<24)|__SLOT_ADDR; +__block22_lma = (22<<24)|__SLOT_ADDR; +__block23_lma = (23<<24)|__SLOT_ADDR; + +/* Stash preloaded binary data */ +__binarydata_lma = 0x54000; /* Block 42 */ +__BINARYDATA_SIZE = 0x2C000; /* Size of A2-3D2, 3D/2D data area, and 2 bitmaps. */ + +MEMORY { + block8 : ORIGIN = __block8_lma, LENGTH = __BLOCK_SIZE + block9 : ORIGIN = __block9_lma, LENGTH = __BLOCK_SIZE + block10 : ORIGIN = __block10_lma, LENGTH = __BLOCK_SIZE + block11 : ORIGIN = __block11_lma, LENGTH = __BLOCK_SIZE + block12 : ORIGIN = __block12_lma, LENGTH = __BLOCK_SIZE + block13 : ORIGIN = __block13_lma, LENGTH = __BLOCK_SIZE + block14 : ORIGIN = __block14_lma, LENGTH = __BLOCK_SIZE + block15 : ORIGIN = __block15_lma, LENGTH = __BLOCK_SIZE + block16 : ORIGIN = __block16_lma, LENGTH = __BLOCK_SIZE + block17 : ORIGIN = __block17_lma, LENGTH = __BLOCK_SIZE + block18 : ORIGIN = __block18_lma, LENGTH = __BLOCK_SIZE + block19 : ORIGIN = __block19_lma, LENGTH = __BLOCK_SIZE + block20 : ORIGIN = __block20_lma, LENGTH = __BLOCK_SIZE + block21 : ORIGIN = __block21_lma, LENGTH = __BLOCK_SIZE + block22 : ORIGIN = __block22_lma, LENGTH = __BLOCK_SIZE + block23 : ORIGIN = __block23_lma, LENGTH = __BLOCK_SIZE +/* binarydata : ORIGIN = __binarydata_lma, LENGTH = __BINARYDATA_SIZE */ +} + +REGION_ALIAS("c_writeable", ram) +REGION_ALIAS("c_readonly", ram) + +SECTIONS { + INCLUDE c.ld + .block8 : { *(.block8 .block8.*) } >block8 end_block8 = .; + .block9 : { *(.block9 .block9.*) } >block9 end_block9 = .; + .block10 : { *(.block10 .block10.*) } >block10 end_block10 = .; + .block11 : { *(.block11 .block11.*) } >block11 end_block11 = .; + .block12 : { *(.block12 .block12.*) } >block12 end_block12 = .; + .block13 : { *(.block13 .block13.*) } >block13 end_block13 = .; + .block14 : { *(.block14 .block14.*) } >block14 end_block14 = .; + .block15 : { *(.block15 .block15.*) } >block15 end_block15 = .; + .block16 : { *(.block16 .block16.*) } >block16 end_block16 = .; + .block17 : { *(.block17 .block17.*) } >block17 end_block17 = .; + .block18 : { *(.block18 .block18.*) } >block18 end_block18 = .; + .block19 : { *(.block19 .block19.*) } >block19 end_block19 = .; + .block20 : { *(.block20 .block20.*) } >block20 end_block20 = .; + .block21 : { *(.block21 .block21.*) } >block21 end_block21 = .; + .block22 : { *(.block22 .block22.*) } >block22 end_block22 = .; + .block23 : { *(.block23 .block23.*) } >block23 end_block23 = .; +/* .binarydata : { *(.binarydata .binarydata.*) } >binarydata end_binarydata = .; */ +} + +OUTPUT_FORMAT { + BYTE(0x5A) /* pgZ */ + + /* RAM Segment */ + SHORT(ORIGIN(ram)) /* where to load it, 24 bits */ + BYTE(0x00) + SHORT(__bss_start-ORIGIN(ram)) /* size to load */ + BYTE(0x00) + TRIM(ram) + + /* Overlay Segments */ + INCLUDE output.ld + + /* Binary Data */ +/* + SHORT(ORIGIN(binarydata)) + BYTE(ORIGIN(binarydata)>>16) + SHORT(end_binarydata - __binarydata_lma) + BYTE((end_binarydata - __binarydata_lma)>>16) + TRIM(binarydata) +*/ + + /* Launch the program, at _start */ + SHORT(_start) + LONG(0) +} diff --git a/llvm-mos-sdk-patches/mos-platform/f256/output.ld b/llvm-mos-sdk-patches/mos-platform/f256/output.ld new file mode 100644 index 0000000..f856485 --- /dev/null +++ b/llvm-mos-sdk-patches/mos-platform/f256/output.ld @@ -0,0 +1 @@ +/* This is generated by the overlay tool. */ diff --git a/llvm-mos-sdk-patches/mos-platform/f256k/link.ld b/llvm-mos-sdk-patches/mos-platform/f256k/link.ld deleted file mode 100644 index 91bd964..0000000 --- a/llvm-mos-sdk-patches/mos-platform/f256k/link.ld +++ /dev/null @@ -1,50 +0,0 @@ -INCLUDE settings.ld - -/* f256k uses first 16 bytes of ZP for mmu control? */ -__rc0 = 0x10; -INCLUDE imag-regs.ld -ASSERT(__rc0 == 0x10, "Inconsistent zero page map.") -ASSERT(__rc31 == 0x2f, "Inconsistent zero page map.") - - -MEMORY { - /* kernel uses 0xf0-0xff for parameter passing */ - zp : ORIGIN = __rc31 + 1, LENGTH = 0xF0 - (__rc31 + 1) - /* We leave slots 5-7 untouched for paging space and the microkernel */ - ram (rw) : ORIGIN = __f256_start, LENGTH = 0xA000-__f256_start -} - - -REGION_ALIAS("c_readonly", ram) -REGION_ALIAS("c_writeable", ram) - - -/* NOTE: c.ld has zp.ld before text.ld. - * If the compiler decides to put data into the zeropage (.zp.data), - * then it would appear in our output binary before the .text section. - * And because the text section is our starting point, the zeropage - * data pushes our _start address up by some indeterminate amount, which - * is a pain. - * So, here I've just done the same as c.ld, but reordered things so the - * .zp data appears _after_ our .text section. - * (the zeropage data copied into the zeropage at startup by the crt - * copy-zp-data, I think) - */ -SECTIONS { - INCLUDE text.ld - INCLUDE zp.ld - INCLUDE rodata.ld - INCLUDE data.ld - INCLUDE bss.ld - INCLUDE noinit.ld -} - - -/* Set initial soft stack address to just above last ram address. (It grows down.) */ -__stack = ORIGIN(ram) + LENGTH(ram); - - -/* Bare Binary */ -OUTPUT_FORMAT { - TRIM(ram) -} diff --git a/llvm-mos-sdk-patches/mos-platform/f256k/settings.ld b/llvm-mos-sdk-patches/mos-platform/f256k/settings.ld deleted file mode 100644 index 97cd8be..0000000 --- a/llvm-mos-sdk-patches/mos-platform/f256k/settings.ld +++ /dev/null @@ -1 +0,0 @@ -__f256_start = 0x0300;