Files
pmaports-rtwo/device/archived/linux-samsung-coreprimeve3g/fix-recordmcount.patch
T
Aelin cfbc1de3c7 treewide: archive unmaintained packages under device/
Command to reproduce:
grep -L '^maintainer="[^"]\+"$' device/{main,community,testing,downstream}/*/APKBUILD | sed 's/\/APKBUILD//' | xargs -i sh -c 'sed -i "1s;^;# Archived: unmaintained\n;" {}/APKBUILD && mv {} device/archived/ && git add {} && git add device/archived/'

Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8883>
2026-06-22 19:26:47 +00:00

39 lines
1.3 KiB
Diff

This patch fixes the `R_METAG_NONE` error.
Found at: https://lore.kernel.org/patchwork/patch/696647/
The error message:
recordmcount.c: In function 'do_file':
scripts/recordmcount.c:351:28: error: 'R_METAG_ADDR32' undeclared (first use in this function)
351 | case EM_METAG: reltype = R_METAG_ADDR32;
| ^~~~~~~~~~~~~~
scripts/recordmcount.c:351:28: note: each undeclared identifier is reported only once for each function it appears in
scripts/recordmcount.c:353:20: error: 'R_METAG_NONE' undeclared (first use in this function); did you mean 'R_MIPS_NONE'?
353 | rel_type_nop = R_METAG_NONE;
| ^~~~~~~~~~~~
| R_MIPS_NONE
diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c
index e1675927..42396a7 100644
--- a/scripts/recordmcount.c
+++ b/scripts/recordmcount.c
@@ -33,10 +33,17 @@
#include <string.h>
#include <unistd.h>
+/*
+ * glibc synced up and added the metag number but didn't add the relocations.
+ * Work around this in a crude manner for now.
+ */
#ifndef EM_METAG
-/* Remove this when these make it to the standard system elf.h. */
#define EM_METAG 174
+#endif
+#ifndef R_METAG_ADDR32
#define R_METAG_ADDR32 2
+#endif
+#ifndef R_METAG_NONE
#define R_METAG_NONE 3
#endif