mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-01 05:58:05 +02:00
bin/symbols-check: Fix undefined symbol detection on macOS
Commite626636e90("bin/symbols-check: fix fields length condition before accessing fields") changed the condition from `or` to `and` to prevent potential IndexError when accessing fields[1]. However, this broke macOS because `nm -gP` outputs different field counts for undefined symbols: - Linux: `_symbol U` (2 fields) - macOS: `_symbol U 0 0` (4 fields) The condition `len(fields) == 2 and fields[1] == 'U'` only matched the Linux format, causing undefined symbols like _mesa_glapi_tls_Dispatch to be incorrectly reported as "unknown symbol exported" on macOS. Fix by using `len(fields) >= 2` to handle both platforms while still guarding against IndexError. Fixes:e626636e90("bin/symbols-check: fix fields length condition before accessing fields") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13451 Signed-off-by: Vinson Lee <vlee@freedesktop.org> (cherry picked from commit191e4b8fe0) Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39117>
This commit is contained in:
parent
a2290167f1
commit
b8f5e721f0
2 changed files with 2 additions and 2 deletions
|
|
@ -974,7 +974,7 @@
|
|||
"description": "bin/symbols-check: Fix undefined symbol detection on macOS",
|
||||
"nominated": true,
|
||||
"nomination_type": 2,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "e626636e90c39e897ccd99d5ef77f5b9f94e7989",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ def get_symbols_nm(nm, lib):
|
|||
if line.startswith(' '):
|
||||
continue
|
||||
fields = line.split()
|
||||
if len(fields) == 2 and fields[1] == 'U':
|
||||
if len(fields) >= 2 and fields[1] == 'U':
|
||||
continue
|
||||
symbol_name = fields[0]
|
||||
if platform_name == 'Linux' or platform_name == 'GNU' or platform_name.startswith('GNU/'):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue