ac/rgp: define EM_AMDGPU if missing for compatibility
authorJan Beich <jbeich@FreeBSD.org>
Sat, 20 Feb 2021 13:27:02 +0000 (13:27 +0000)
committerMarge Bot <eric+marge@anholt.net>
Tue, 23 Feb 2021 15:19:41 +0000 (15:19 +0000)
EM_AMDGPU isn't defined on DragonFly, FreeBSD, OpenBSD, so use the
same workaround as ac_rtld.c.

src/amd/common/ac_rgp_elf_object_pack.c:382:24: error: use of undeclared identifier 'EM_AMDGPU'
   elf_hdr.e_machine = EM_AMDGPU;
                       ^

Fixes: 110bb2c77dd3 ("ac/rgp: add helper function to write rgp elf oject")
Reviewed-by: Mauro Rossi <issor.oruam@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9169>

src/amd/common/ac_rgp_elf_object_pack.c

index 3d8c620..b7575dd 100644 (file)
 #include "ac_rgp.h"
 #include "main/macros.h"
 
+#ifndef EM_AMDGPU
+// Old distributions may not have this enum constant
+#define EM_AMDGPU 224
+#endif
 
 char shader_stage_api_string[6][10] = {
    ".vertex",      /* vertex */