Skip to content

Commit ff78b05

Browse files
committed
fix crash in Posix_getaddrinfo for ProGuarded Android build
Posix_getaddrinfo needs to access fields in libcore.io.StructAddrinfo via JNI, so we tell ProGuard to preserve them. This commit also includes a minor indentation tweek in README.md and removes -fno-rtti from lzma-build-cflags to avoid a warning from GCC.
1 parent bbf3382 commit ff78b05

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ setting the boot classpath to "[bootJar]".
507507
$ cat >embedded-jar-main.cpp <<EOF
508508
#include "stdint.h"
509509
#include "jni.h"
510-
#include "stdlib.h"
510+
#include "stdlib.h"
511511

512512
#if (defined __MINGW32__) || (defined _MSC_VER)
513513
# define EXPORT __declspec(dllexport)

android.pro

+3-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@
3434
-keep class java.net.Socket
3535
-keep class java.net.SocketImpl
3636
-keep class java.lang.String
37-
-keep class libcore.io.StructAddrinfo
37+
-keep class libcore.io.StructAddrinfo {
38+
<fields>;
39+
}
3840
-keep class libcore.io.StructFlock
3941
-keep class libcore.io.StructGroupReq
4042
-keep class libcore.io.StructLinger

makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1294,8 +1294,8 @@ ifneq ($(lzma),)
12941294

12951295
lzma-encoder = $(build)/lzma/lzma
12961296

1297-
lzma-build-cflags = -D_7ZIP_ST -D__STDC_CONSTANT_MACROS -fno-rtti \
1298-
-fno-exceptions -I$(lzma)/C
1297+
lzma-build-cflags = -D_7ZIP_ST -D__STDC_CONSTANT_MACROS \
1298+
-fno-exceptions -fPIC -I$(lzma)/C
12991299

13001300
lzma-cflags = $(lzma-build-cflags) $(classpath-extra-cflags)
13011301

0 commit comments

Comments
 (0)