mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
Kernel: Make new kernel build process work on macOS
Use objcopy from the toolchain so that the changes introduced in
7236584
will succeed on macOS.
Fixes #8768.
This commit is contained in:
parent
3b5b7c5e65
commit
e4f05a9046
Notes:
sideshowbarker
2024-07-18 08:59:11 +09:00
Author: https://github.com/gunnarbeutner Commit: https://github.com/SerenityOS/serenity/commit/e4f05a90469 Pull-request: https://github.com/SerenityOS/serenity/pull/8764 Issue: https://github.com/SerenityOS/serenity/issues/8768
3 changed files with 5 additions and 3 deletions
|
@ -167,6 +167,7 @@ else()
|
|||
set(CMAKE_RANLIB ${TOOLCHAIN_PREFIX}gcc-ranlib)
|
||||
set(CMAKE_STRIP ${TOOLCHAIN_PREFIX}strip)
|
||||
set(CMAKE_AR ${TOOLCHAIN_PREFIX}gcc-ar)
|
||||
set(CMAKE_OBJCOPY ${TOOLCHAIN_PREFIX}objcopy)
|
||||
endif()
|
||||
|
||||
foreach(lang ASM C CXX OBJC OBJCXX)
|
||||
|
|
|
@ -413,9 +413,9 @@ add_dependencies(${KERNEL_TARGET} kernel_heap)
|
|||
|
||||
add_custom_command(
|
||||
TARGET ${KERNEL_TARGET} POST_BUILD
|
||||
COMMAND ${TOOLCHAIN_PREFIX}objcopy -O elf32-i386 ${CMAKE_CURRENT_BINARY_DIR}/${KERNEL_TARGET} ${CMAKE_CURRENT_BINARY_DIR}/Kernel
|
||||
COMMAND ${CMAKE_OBJCOPY} -O elf32-i386 ${CMAKE_CURRENT_BINARY_DIR}/${KERNEL_TARGET} ${CMAKE_CURRENT_BINARY_DIR}/Kernel
|
||||
COMMAND sh ${CMAKE_CURRENT_SOURCE_DIR}/mkmap.sh
|
||||
COMMAND sh ${CMAKE_CURRENT_SOURCE_DIR}/embedmap.sh
|
||||
COMMAND ${CMAKE_COMMAND} -E env OBJCOPY=${CMAKE_OBJCOPY} sh ${CMAKE_CURRENT_SOURCE_DIR}/embedmap.sh
|
||||
BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/Kernel ${CMAKE_CURRENT_BINARY_DIR}/kernel.map
|
||||
)
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#!/bin/sh
|
||||
tmp=$(mktemp)
|
||||
(cat kernel.map; printf '%b' '\0') > "$tmp"
|
||||
objcopy --update-section .ksyms="$tmp" Kernel
|
||||
OBJCOPY="${OBJCOPY:-objcopy}"
|
||||
"$OBJCOPY" --update-section .ksyms="$tmp" Kernel
|
||||
rm -f "$tmp"
|
||||
|
|
Loading…
Reference in a new issue