Browse Source

working openjdk builds on all archs

android-5
its-pointless 7 years ago
committed by Fredrik Fornwall
parent
commit
9a92118f5a
  1. 59
      disabled-packages/openjdk-9-jre-headless/build.sh
  2. 18
      disabled-packages/openjdk-9-jre-headless/generated-configure.sh.patch
  3. 66
      disabled-packages/openjdk-9-jre-headless/libpthread.patch
  4. 12
      disabled-packages/openjdk-9-jre-headless/osName.patch

59
disabled-packages/openjdk-9-jre-headless/build.sh

@ -1,9 +1,9 @@
TERMUX_PKG_HOMEPAGE=http://openjdk.java.net
TERMUX_PKG_DESCRIPTION="OpenJDK 9 Java Runtime Environment (prerelease)"
_jbuild=174
_jbuild=181
_hg_tag="jdk-9+${_jbuild}"
_jvm_dir="lib/jvm/openjdk-9"
TERMUX_PKG_VERSION="9.2017.6.24"
TERMUX_PKG_VERSION="9.2017.8.20"
TERMUX_PKG_MAINTAINER="Vishal Biswas @vishalbiswas"
TERMUX_PKG_HOMEPAGE=http://openjdk.java.net/projects/jdk9
TERMUX_PKG_DEPENDS="freetype, libpng, ca-certificates-java"
@ -22,26 +22,26 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
"
TERMUX_PKG_CLANG=no
TERMUX_PKG_RM_AFTER_INSTALL="$_jvm_dir/demo $_jvm_dir/sample"
_cups_ver=2.2.3
changesets=('b0ac0fef5b92'
'dc78a3dd6b3a'
'a81769cc0015'
'ee95c24502f3'
'a5d361b9d1f7'
'736412a8dcce'
'83f6eb009d8f'
'734b3209b6ed')
sha256sums=('b269c630374c181840c126f8e82cd799147b556482cad3231c577741d0718373'
'7da8245591a3ea3c6c7d0aea6cd2c653e0039a2ea5511ff2cea988223b02c388'
'021b9b8f943087fc7967fe3640d68ab989b791ed1133966a402e1b49f4c6154e'
'77200280da08f56dd298a748b99a8107dddd113872d619677e0a02eeee88bc84'
'435d2e98df810ce45c36af511acbf8cf9b19c68371f9692e95c6aeef2b8fd473'
'43a89436e6f9c11939c7d93a4daa748bc3155e8f1d6fc6e6507310b3addf31a2'
'c8341d99f315575a11d1f33b243f4cbdab25240caf53668eea8e09a9ecfaf2c5'
'52eeb4ea0c77054f7abb847f9798cedf653ac50de56a6e2d69b7277822738314'
'66701fe15838f2c892052c913bde1ba106bbee2e0a953c955a62ecacce76885f')
_cups_ver=2.2.4
changesets=('e5455438db96'
'5666eba44ac6'
'8076a7391ba0'
'17bb8a98d5e3'
'a1d64f45f9d5'
'364631d8ff2e'
'65bfdabaab9c'
'17cc754c8936')
sha256sums=('c759faa5bff4b3d7bcf87dce57e9d1a39600ef67ec68f96d6d12d07b1bf773ce'
'34518bf8b27aa893f834f8f81293ac0e04a210ee4f2e11bb2c89331f87912d96'
'3b649e34e2a1c8758c6311931d201a38432088ccb86a720afb1cb99fe193537f'
'bb330b8b516178304dc11c755994db20eccc696ae5c2a16b04a4a67b20b33b79'
'a213ebc4bf896c55855761891932a19f42ad5276d3fd155cfb604b27f4866d9d'
'0bc1953e9f23d59dafc415a7a37ff2da23cf8782e0532e253a6d7d63aa0ea954'
'739a5d275db4a2a81cf3c3ca17a78212b8c47092e5c10888b79e9599dd9dcc2d'
'fbc9b49a7f0fa1723e369d91068d51a11de40e931f281a3ed9650484b437cc7f'
'596d4db72651c335469ae5f37b0da72ac9f97d73e30838d787065f559dea98cc')
reponames=(dev corba hotspot jdk jaxws jaxp langtools nashorn cups)
@ -81,6 +81,8 @@ termux_step_replace_guess_scripts () {
termux_step_pre_configure () {
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-cups-include=$TERMUX_PKG_SRCDIR/cups-$_cups_ver"
ln -sf $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/libc.so $TERMUX_PKG_TMPDIR/libpthread.so
cat > "$TERMUX_STANDALONE_TOOLCHAIN/devkit.info" <<HERE
DEVKIT_NAME="Android ${TERMUX_ARCH^^}"
DEVKIT_TOOLCHAIN_PATH="\$DEVKIT_ROOT/$TERMUX_HOST_PLATFORM/bin"
@ -97,21 +99,24 @@ HERE
# enable features specific to some arches
if [ "$TERMUX_ARCH" == "aarch64" ] || [ "$TERMUX_ARCH" == "x86_64" ]; then JVM_FEATURES+=",jvmci,graal"; fi
test "$TERMUX_ARCH" == "aarch64" && CFLAGS="$CFLAGS -DUSE_LIBRARY_BASED_TLS_ONLY"
# remove sa_proc support
rm $TERMUX_PKG_SRCDIR/hotspot/make/lib/Lib-jdk.hotspot.agent.gmk
}
termux_step_configure () {
ARM64=""
if [ $TERMUX_ARCH = aarch64 ]; then
export ARM64=" --with-cpu-port=arm64"
fi
bash $TERMUX_PKG_SRCDIR/configure \
$ARM64 \
--prefix=$TERMUX_PREFIX \
--openjdk-target=$BUILD_TRIPLE \
--libexecdir=$TERMUX_PREFIX/libexec \
--with-devkit=$ANDROID_DEVKIT \
--with-extra-cflags="$CPPFLAGS $CFLAGS" \
--with-extra-cxxflags="$CPPFLAGS $CXXFLAGS" \
--with-extra-ldflags="$LDFLAGS" \
--with-extra-ldflags="-L$TERMUX_PKG_TMPDIR $LDFLAGS -ldl" \
--with-jvm-features="$JVM_FEATURES" \
$TERMUX_PKG_EXTRA_CONFIGURE_ARGS
}
@ -135,7 +140,7 @@ termux_step_post_make_install () {
rm -f $TERMUX_PREFIX/bin/$binary
echo "export JAVA_HOME=\$PREFIX/$_jvm_dir" > $TERMUX_PREFIX/bin/$binary
echo "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:\$JAVA_HOME/lib:\$JAVA_HOME/lib/jli" >> $TERMUX_PREFIX/bin/$binary
echo "\$JAVA_HOME/bin/$binary \"\$@\"" >> $TERMUX_PREFIX/bin/$binary
echo "exec \$JAVA_HOME/bin/$binary \"\$@\"" >> $TERMUX_PREFIX/bin/$binary
chmod u+x $TERMUX_PREFIX/bin/$binary
done

18
disabled-packages/openjdk-9-jre-headless/generated-configure.sh.patch

@ -1,23 +1,5 @@
--- ./common/autoconf/generated-configure.sh 2017-04-01 23:19:09.508381398 +0530
+++ ../generated-configure.sh 2017-04-02 17:35:37.210373866 +0530
@@ -51452,7 +51452,7 @@
# Set JVM_LIBS (per os)
if test "x$OPENJDK_TARGET_OS" = xlinux; then
- JVM_LIBS="$JVM_LIBS -lm -ldl -lpthread"
+ JVM_LIBS="$JVM_LIBS -lm -lc"
elif test "x$OPENJDK_TARGET_OS" = xandroid; then
JVM_LIBS="$JVM_LIBS -lm -llog"
elif test "x$OPENJDK_TARGET_OS" = xsolaris; then
@@ -52293,7 +52293,7 @@
# Set OPENJDK_BUILD_JVM_LIBS (per os)
if test "x$OPENJDK_BUILD_OS" = xlinux; then
- OPENJDK_BUILD_JVM_LIBS="$OPENJDK_BUILD_JVM_LIBS -lm -ldl -lpthread"
+ OPENJDK_BUILD_JVM_LIBS="$OPENJDK_BUILD_JVM_LIBS -lm -lc"
elif test "x$OPENJDK_BUILD_OS" = xandroid; then
OPENJDK_BUILD_JVM_LIBS="$OPENJDK_BUILD_JVM_LIBS -lm -llog"
elif test "x$OPENJDK_BUILD_OS" = xsolaris; then
@@ -53412,14 +53412,7 @@

66
disabled-packages/openjdk-9-jre-headless/libpthread.patch

@ -1,69 +1,3 @@
--- ./jdk/make/lib/NioLibraries.gmk 2017-03-30 20:45:48.000000000 +0530
+++ ../NioLibraries.gmk 2017-04-02 18:02:51.838192783 +0530
@@ -80,7 +80,7 @@
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
LIBS_unix := -ljava -lnet, \
- LIBS_linux := -lpthread $(LIBDL), \
+ LIBS_linux := -lc $(LIBDL), \
LIBS_solaris := -ljvm -lsocket -lposix4 $(LIBDL) \
-lsendfile -lc, \
LIBS_aix := $(LIBDL), \
--- ./jdk/make/lib/Lib-jdk.sctp.gmk 2017-03-30 20:45:48.000000000 +0530
+++ ../Lib-jdk.sctp.gmk 2017-04-02 18:04:18.014072129 +0530
@@ -50,7 +50,7 @@
$(call SET_SHARED_LIBRARY_ORIGIN), \
LDFLAGS := $(LDFLAGS_JDKLIB), \
LIBS_unix := -lnio -lnet -ljava -ljvm, \
- LIBS_linux := -lpthread $(LIBDL), \
+ LIBS_linux := -lc $(LIBDL), \
LIBS_solaris := -lsocket -lc, \
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libsctp, \
))
--- ./jdk/make/lib/Lib-jdk.jdwp.agent.gmk 2017-03-30 20:45:48.000000000 +0530
+++ ../Lib-jdk.jdwp.agent.gmk 2017-04-02 18:05:56.109871847 +0530
@@ -47,7 +47,7 @@
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
LDFLAGS_windows := -export:jdwpTransport_OnLoad, \
- LIBS_linux := -lpthread, \
+ LIBS_linux := -lc, \
LIBS_solaris := -lnsl -lsocket -lc, \
LIBS_windows := $(JDKLIB_LIBS) ws2_32.lib, \
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
--- ./jdk/make/lib/CoreLibraries.gmk 2017-03-30 20:45:48.000000000 +0530
+++ ../CoreLibraries.gmk 2017-04-02 18:06:45.519445303 +0530
@@ -407,7 +407,7 @@
-export:JLI_AddArgsFromEnvVar \
-export:JLI_GetAppArgIndex, \
LIBS_unix := $(LIBZ), \
- LIBS_linux := $(LIBDL) -lc -lpthread, \
+ LIBS_linux := $(LIBDL) -lc, \
LIBS_android := $(LIBDL) -lc -llog, \
LIBS_solaris := $(LIBDL) -lc, \
LIBS_aix := $(LIBDL),\
--- ./jdk/make/lib/NetworkingLibraries.gmk 2017-03-30 20:45:48.000000000 +0530
+++ ../NetworkingLibraries.gmk 2017-04-02 18:08:05.098770606 +0530
@@ -46,7 +46,7 @@
LDFLAGS_windows := -delayload:secur32.dll -delayload:iphlpapi.dll, \
LIBS_unix := -ljvm -ljava, \
LIBS_android := -llog, \
- LIBS_linux := $(LIBDL) -lpthread, \
+ LIBS_linux := -lc, \
LIBS_solaris := -lnsl -lsocket $(LIBDL) -lc, \
LIBS_aix := $(LIBDL),\
LIBS_windows := ws2_32.lib jvm.lib secur32.lib iphlpapi.lib winhttp.lib \
--- ./jdk/make/launcher/LauncherCommon.gmk 2017-03-30 20:45:48.000000000 +0530
+++ ../LauncherCommon.gmk 2017-04-02 18:09:02.258294282 +0530
@@ -201,7 +201,7 @@
LIBS := $(JDKEXE_LIBS) $$($1_LIBS), \
LIBS_unix := $$($1_LIBS_unix), \
LIBS_android := -llog -ljli $(LIBDL) -lc, \
- LIBS_linux := -lpthread -ljli $(LIBDL) -lc, \
+ LIBS_linux := -ljli $(LIBDL) -lc, \
LIBS_solaris := -ljli -lthread $(LIBDL) -lc, \
LIBS_windows := $$($1_WINDOWS_JLI_LIB) \
$(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib advapi32.lib \
--- ./jdk/make/lib/Awt2dLibraries.gmk 2017-03-30 20:45:48.000000000 +0530
+++ ../Awt2dLibraries.gmk 2017-04-02 18:36:12.582240305 +0530
@@ -145,7 +145,7 @@

12
disabled-packages/openjdk-9-jre-headless/osName.patch

@ -0,0 +1,12 @@
thanks @fornwall for finding this
--- ./jdk/src/java.base/unix/classes/java/lang/ProcessImpl.java 2017-03-30 20:45:48.000000000 +0530
+++ ../ProcessImpl.java 2017-04-01 23:04:39.565293249 +0530
@@ -157,7 +157,7 @@
static Platform get() {
String osName = GetPropertyAction.privilegedGetProperty("os.name");
- if (osName.equals("Linux")) { return LINUX; }
+ if (osName.equals("Linux") || osName.equals("Android")) { return LINUX; }
if (osName.contains("OS X")) { return BSD; }
if (osName.equals("SunOS")) { return SOLARIS; }
if (osName.equals("AIX")) { return AIX; }
Loading…
Cancel
Save