mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 09:08:10 +02:00
zink: relax build-id length assertion for Mach-O
`disk_cache_init` asserts `build_id_len == BUILD_ID_EXPECTED_HASH_LENGTH`
(20, the size of a GNU build-id SHA1 on ELF). Mach-O has no GNU
build-id; the closest equivalent is `LC_UUID`, which is 16 bytes.
`build_id_length()` therefore returns a non-20 value on macOS and the
assert fires as soon as `ENABLE_SHADER_CACHE` is on.
Relax the assertion to `<=` so any non-empty build id of acceptable
length is accepted while still catching impossibly long ones. The hash
only needs *some* unique-per-build identifier; the actual byte count
hashed is whatever `build_id_length()` returned.
Cc: mesa-stable
Suggested-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Louis Montagne <louis@askem.eu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41361>
(cherry picked from commit 14992361a4)
This commit is contained in:
parent
4b70cf7cd0
commit
293433602e
2 changed files with 2 additions and 2 deletions
|
|
@ -704,7 +704,7 @@
|
|||
"description": "zink: relax build-id length assertion for Mach-O",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -318,7 +318,7 @@ disk_cache_init(struct zink_screen *screen)
|
|||
const struct build_id_note *note =
|
||||
build_id_find_nhdr_for_addr(disk_cache_init);
|
||||
unsigned build_id_len = build_id_length(note);
|
||||
assert(note && build_id_len == BUILD_ID_EXPECTED_HASH_LENGTH);
|
||||
assert(note && build_id_len <= BUILD_ID_EXPECTED_HASH_LENGTH);
|
||||
_mesa_blake3_update(&ctx, build_id_data(note), build_id_len);
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue