Skip to content

Commit 8285e73

Browse files
committed
fix: Specify minimum alignment for ResStringPool_span to fix SIGBUS on ARMv7
Apparently, a SIGSEGV is also fixed by that.
1 parent fa1b651 commit 8285e73

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

patches/androidfw.patch

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,19 @@ index cae2d0bc16b3..13c5f8fc84e8 100644
1212
#include <binder/TextOutput.h>
1313

1414
#endif
15+
diff --git a/src/base/libs/androidfw/include/androidfw/ResourceTypes.h b/libs/androidfw/include/androidfw/ResourceTypes.h
16+
index 3d66244646d5..2d27c34a9154 100644
17+
--- a/src/base/libs/androidfw/include/androidfw/ResourceTypes.h
18+
+++ b/src/base/libs/androidfw/include/androidfw/ResourceTypes.h
19+
@@ -500,7 +500,7 @@ struct ResStringPool_span
20+
21+
// The range of characters in the string that this span applies to.
22+
uint32_t firstChar, lastChar;
23+
-};
24+
+} __attribute__((__packed__, aligned(1)));
25+
26+
/**
27+
* Convenience class for accessing data in a ResStringPool resource.
1528
diff --git a/src/base/libs/androidfw/include/androidfw/StringPiece.h b/src/base/libs/androidfw/include/androidfw/StringPiece.h
1629
index 921877dc4982..27e27e1c2b94 100644
1730
--- a/src/base/libs/androidfw/include/androidfw/StringPiece.h

0 commit comments

Comments
 (0)