mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 13:36:13 +03:00
Kernel: Use the toolchain's nm
in mkmap.sh
By using the binary from our build of binutils, we can be sure that `nm` supports demangling symbols, so we can avoid spawning a separate `c++filt` process.
This commit is contained in:
parent
9d3623f0e8
commit
7608af13cd
Notes:
sideshowbarker
2024-07-18 00:41:35 +09:00
Author: https://github.com/BertalanD Commit: https://github.com/SerenityOS/serenity/commit/7608af13cd6 Pull-request: https://github.com/SerenityOS/serenity/pull/11508
@ -517,7 +517,7 @@ endif()
|
||||
|
||||
add_custom_command(
|
||||
TARGET Kernel POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E env CXXFILT=${SERENITY_CXXFILT} sh ${CMAKE_CURRENT_SOURCE_DIR}/mkmap.sh
|
||||
COMMAND ${CMAKE_COMMAND} -E env NM=${CMAKE_NM} sh ${CMAKE_CURRENT_SOURCE_DIR}/mkmap.sh
|
||||
COMMAND ${CMAKE_COMMAND} -E env OBJCOPY=${CMAKE_OBJCOPY} sh ${CMAKE_CURRENT_SOURCE_DIR}/embedmap.sh
|
||||
COMMAND ${CMAKE_OBJCOPY} --only-keep-debug Kernel Kernel.debug
|
||||
COMMAND ${CMAKE_OBJCOPY} --strip-debug Kernel
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
tmp=$(mktemp)
|
||||
nm -n Kernel | grep -vE \\.Lubsan_data | awk '{ if ($2 != "a") print; }' | uniq > "$tmp"
|
||||
NM="${NM:-nm}"
|
||||
"$NM" -C -n Kernel | grep -vE \\.Lubsan_data | awk '{ if ($2 != "a") print; }' | uniq > "$tmp"
|
||||
printf "%08x\n" "$(wc -l "$tmp" | awk '{print $1}')" > kernel.map
|
||||
CXXFILT="${CXXFILT:-c++filt}"
|
||||
"$CXXFILT" < "$tmp" >> kernel.map
|
||||
cat "$tmp" >> kernel.map
|
||||
rm -f "$tmp"
|
||||
|
Loading…
Reference in New Issue
Block a user