浏览代码

Kernel: Embed the right symbol count into the kernel.map file on macOS

On macOS the wc tool prefixes its output with a bunch of spaces which
resulted in us incorrectly using "00000000" as the symbol count.

Fixes #9080.
Gunnar Beutner 4 年之前
父节点
当前提交
a68d912dc0
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Kernel/mkmap.sh

+ 1 - 1
Kernel/mkmap.sh

@@ -1,6 +1,6 @@
 #!/bin/sh
 tmp=$(mktemp)
 nm -n Kernel | grep -vE \\.Lubsan_data | awk '{ if ($2 != "a") print; }' | uniq > "$tmp"
-printf "%08x\n" "$(wc -l "$tmp" | cut -f1 -d' ')" > kernel.map
+printf "%08x\n" "$(wc -l "$tmp" | awk '{print $1}')" > kernel.map
 c++filt < "$tmp" >> kernel.map
 rm -f "$tmp"