diff options
| author | 2025-09-21 00:03:01 +1000 | |
|---|---|---|
| committer | 2025-09-21 00:03:01 +1000 | |
| commit | 30a1363797fa2542afb7bb9a7540d752cbf9c7c8 (patch) | |
| tree | 080395d6e9d4e9cd2232a5cc7d68df614fe696da /scripts | |
| parent | b83095e578176c41b1768748461bce3e389d6f55 (diff) | |
Improved support for building on Windows arm64.
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/build/llvm-objdump-filter.py | 26 | ||||
| -rw-r--r-- | scripts/src/main.lua | 21 | ||||
| -rw-r--r-- | scripts/src/osd/modules.lua | 8 |
3 files changed, 47 insertions, 8 deletions
diff --git a/scripts/build/llvm-objdump-filter.py b/scripts/build/llvm-objdump-filter.py new file mode 100755 index 00000000000..e09e974de46 --- /dev/null +++ b/scripts/build/llvm-objdump-filter.py @@ -0,0 +1,26 @@ +#!/usr/bin/python3 +## +## license:BSD-3-Clause +## copyright-holders:Vas Crabb + +import re +import sys + + +sections = frozenset([int(x) + 1 for x in sys.argv[1:]]) +sym_pattern = re.compile('^\\[ *(0|[1-9][0-9]*)\\]\\(sec +(-?[1-9][0-9]*)\\).+') +aux_pattern = re.compile('^[A-Z]+ +.+') + +ignored_section = False +for line in sys.stdin: + sym_match = sym_pattern.match(line) + if sym_match: + if int(sym_match.group(2)) in sections: + ignored_section = False + sys.stdout.write(line) + else: + ignored_section = True + else: + aux_match = aux_pattern.match(line) + if (not aux_match) or (not ignored_section): + sys.stdout.write(line) diff --git a/scripts/src/main.lua b/scripts/src/main.lua index 63e460f4709..239e9d9c239 100644 --- a/scripts/src/main.lua +++ b/scripts/src/main.lua @@ -48,11 +48,24 @@ end } if _OPTIONS["SYMBOLS"] then + local llvm_obdjump = false + local objdump_ver = backtick('objdump --version') + if string.match(objdump_ver, 'LLVM version ') then + llvm_obdjump = true + end + configuration { "mingw*" } - postbuildcommands { - "$(SILENT) echo Dumping symbols.", - "$(SILENT) objdump --section=.text --syms --demangle $(TARGET) >$(subst .exe,.sym,$(TARGET))" - } + if llvm_obdjump then + postbuildcommands { + "$(SILENT) echo Dumping symbols.", + "$(SILENT) objdump --syms --demangle $(TARGET) | python scripts/build/llvm-objdump-filter.py `objdump --section-headers $(TARGET) | sed -r -e 's/ *(0|[1-9][0-9]*) +\.text +[0-9a-f]+ +[0-9a-f]+ +[^ ].*/\1/;t;d'` | c++filt >$(subst .exe,.sym,$(TARGET))" + } + else + postbuildcommands { + "$(SILENT) echo Dumping symbols.", + "$(SILENT) objdump --section=.text --syms --demangle $(TARGET) >$(subst .exe,.sym,$(TARGET))" + } + end end configuration { "Release" } diff --git a/scripts/src/osd/modules.lua b/scripts/src/osd/modules.lua index 7010d3c9b22..4b796a1f5b4 100644 --- a/scripts/src/osd/modules.lua +++ b/scripts/src/osd/modules.lua @@ -405,8 +405,8 @@ function qtdebuggerbuild() MOC = "moc" else if _OPTIONS["QT_HOME"]~=nil then - MOCTST = backtick(_OPTIONS["QT_HOME"] .. "/bin/moc --version 2>/dev/null") - if (MOCTST=='') then + local MOCTST = backtick(_OPTIONS["QT_HOME"] .. "/bin/moc --version 2>/dev/null") + if MOCTST=='' then local qt_host_libexecs = backtick(_OPTIONS["QT_HOME"] .. "/bin/qmake -query QT_HOST_LIBEXECS") if not string.starts(qt_host_libexecs,"/") then qt_host_libexecs = _OPTIONS["QT_HOME"] .. "/libexec" @@ -422,8 +422,8 @@ function qtdebuggerbuild() MOC = _OPTIONS["QT_HOME"] .. "/bin/moc" end else - MOCTST = backtick("which moc-qt5 2>/dev/null") - if (MOCTST=='') then + local MOCTST = backtick("which moc-qt5 2>/dev/null") + if MOCTST=='' then MOCTST = backtick("which moc 2>/dev/null") end if MOCTST=='' then |
