Move and add example to Bazel docs for changing linker scripts

This commit is contained in:
William Vinnicombe 2026-03-06 12:04:33 +00:00
parent 72adb670c1
commit e47fe099bd
3 changed files with 9 additions and 18 deletions

View file

@ -33,15 +33,6 @@ use_linker_script_file(
script = "memmap_no_flash.ld",
)
# It's possible to set linker scripts globally or on a per-binary basis.
#
# Setting globally:
# * Set --@pico-sdk//bazel/config:PICO_DEFAULT_LINKER_SCRIPT to point to your
# desired linker script.
#
# Setting per-binary:
# * Set --@pico-sdk//bazel/config:PICO_DEFAULT_LINKER_SCRIPT=@pico-sdk//bazel:empty_cc_lib
# * Manually add your desired linker script to each cc_binary.
cc_library(
name = "default_linker_script",
target_compatible_with = ["//bazel/constraint:rp2040"],

View file

@ -32,15 +32,6 @@ use_linker_script_file(
script = "memmap_no_flash.ld",
)
# It's possible to set linker scripts globally or on a per-binary basis.
#
# Setting globally:
# * Set --@pico-sdk//bazel/config:PICO_DEFAULT_LINKER_SCRIPT to point to your
# desired linker script.
#
# Setting per-binary:
# * Set --@pico-sdk//bazel/config:PICO_DEFAULT_LINKER_SCRIPT=@pico-sdk//bazel:empty_cc_lib
# * Manually add your desired linker script to each cc_binary.
cc_library(
name = "default_linker_script",
target_compatible_with = ["//bazel/constraint:rp2350"],

View file

@ -18,6 +18,15 @@ generated_pico_flash_region(
}),
)
# It's possible to set linker scripts globally or on a per-binary basis.
#
# Setting globally:
# * Set --@pico-sdk//bazel/config:PICO_DEFAULT_LINKER_SCRIPT to point to your
# desired linker script (eg @pico-sdk//src/pico_standard_link:no_flash_linker_script)
#
# Setting per-binary:
# * Set --@pico-sdk//bazel/config:PICO_DEFAULT_LINKER_SCRIPT=@pico-sdk//bazel:empty_cc_lib
# * Manually add your desired linker script to each cc_binary.
alias(
name = "default_linker_script",
actual = select({