From b4425db9d9e88afeb458005efdc2b51a7e5e5060 Mon Sep 17 00:00:00 2001 From: Alessandro Astone Date: Wed, 4 Oct 2023 23:31:26 +0200 Subject: [PATCH] asahi: Use the compat version of qsort_r Not all platforms define qsort_r, util_qsort_r takes care of that. CC: mesa-stable Acked-by: Alyssa Rosenzweig Part-of: (cherry picked from commit 4f48a140ac9dc2d1581faed21ac07914c6744cb5) --- .pick_status.json | 2 +- src/asahi/compiler/agx_register_allocate.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 2f716d8..ea66f97 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1234,7 +1234,7 @@ "description": "asahi: Use the compat version of qsort_r", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/asahi/compiler/agx_register_allocate.c b/src/asahi/compiler/agx_register_allocate.c index 18f3f57..1952dad 100644 --- a/src/asahi/compiler/agx_register_allocate.c +++ b/src/asahi/compiler/agx_register_allocate.c @@ -4,6 +4,7 @@ */ #include "util/u_dynarray.h" +#include "util/u_qsort.h" #include "agx_builder.h" #include "agx_compiler.h" #include "agx_debug.h" @@ -564,7 +565,7 @@ insert_copies_for_clobbered_killed(struct ra_ctx *rctx, unsigned reg, return; /* Sort by descending alignment so they are packed with natural alignment */ - qsort_r(vars, nr_vars, sizeof(vars[0]), sort_by_size, rctx->sizes); + util_qsort_r(vars, nr_vars, sizeof(vars[0]), sort_by_size, rctx->sizes); /* Reassign in the destination region */ unsigned base = reg; -- 2.7.4