From 62854f5eff7353f0eb97428884b53c9ef4fe308f Mon Sep 17 00:00:00 2001 From: Graham Sanderson Date: Thu, 7 Oct 2021 08:17:32 -0500 Subject: [PATCH] shrink max-page-size for linker to more sensible 4096 by default (#587) --- src/rp2_common/pico_standard_link/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/rp2_common/pico_standard_link/CMakeLists.txt b/src/rp2_common/pico_standard_link/CMakeLists.txt index 78de372..a730540 100644 --- a/src/rp2_common/pico_standard_link/CMakeLists.txt +++ b/src/rp2_common/pico_standard_link/CMakeLists.txt @@ -79,6 +79,10 @@ if (NOT TARGET pico_standard_link) # boot_stage2 will be linked if PICO_NO_FLASH would be defined to 0 target_link_libraries(pico_standard_link INTERFACE $<$,no_flash>,1,$,$>>>>:$>,$,bs2_default>_library>) + # PICO_CMAKE_CONFIG: PICO_USE_DEFAULT_MAX_PAGE_SIZE, Don't shrink linker max page to 4096, type=bool, default=0, advanced=true, group=pico_standard_link + if (NOT PICO_USE_DEFAULT_MAX_PAGE_SIZE) + target_link_options(pico_standard_link INTERFACE "LINKER:-z,max-page-size=4096") + endif() # done in compiler now #target_link_options(pico_standard_link INTERFACE "LINKER:--build-id=none")