-
Notifications
You must be signed in to change notification settings - Fork 27
add changes that allow to build static libs for iOS #1
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -620,6 +620,10 @@ AC_DEFUN_ONCE([HOTSPOT_ENABLE_DISABLE_GTEST], | |
| else | ||
| AC_MSG_ERROR([--enable-gtest must be either yes or no]) | ||
| fi | ||
| if test "x$OPENJDK_TARGET_OS" = "xios" || test "x$OPENJDK_TARGET_OS" = "xandroid" || test "x$STATIC_BUILD" = "xtrue"; then | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. STATIC_LIB_BUILD instead of STATIC_BUILD |
||
| BUILD_GTEST="false" | ||
| fi | ||
|
|
||
|
|
||
| AC_SUBST(BUILD_GTEST) | ||
| ]) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -458,13 +458,20 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_STATIC_BUILD], | |
| AC_MSG_RESULT([yes]) | ||
| if test "x$OPENJDK_TARGET_OS" != xmacosx && \ | ||
| test "x$OPENJDK_TARGET_OS" != xlinux && \ | ||
| test "x$OPENJDK_TARGET_OS" != xwindows; then | ||
| test "x$OPENJDK_TARGET_OS" != xwindows && \ | ||
| test "x$OPENJDK_TARGET_OS" != xios; then | ||
| AC_MSG_ERROR([--enable-static-build is not supported for this os: $OPENJDK_TARGET_OS]) | ||
| fi | ||
| STATIC_BUILD_CFLAGS="-DSTATIC_BUILD=1" | ||
| CFLAGS_JDKLIB_EXTRA="$CFLAGS_JDKLIB_EXTRA $STATIC_BUILD_CFLAGS" | ||
| CXXFLAGS_JDKLIB_EXTRA="$CXXFLAGS_JDKLIB_EXTRA $STATIC_BUILD_CFLAGS" | ||
| STATIC_LIB_BUILD=true | ||
| if test "x$OPENJDK_TARGET_OS" = "xios"; then | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove these three lines.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove these 3 lines |
||
| STATIC_BUILD=true | ||
| fi | ||
| if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then | ||
| STATIC_BUILD=true | ||
| fi | ||
| elif test "x$enable_static_build" = "xno"; then | ||
| AC_MSG_CHECKING([if static build is enabled]) | ||
| AC_MSG_RESULT([no]) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,8 +40,8 @@ m4_include([lib-tests.m4]) | |
| AC_DEFUN_ONCE([LIB_DETERMINE_DEPENDENCIES], | ||
| [ | ||
| # Check if X11 is needed | ||
| if test "x$OPENJDK_TARGET_OS" = xwindows || test "x$OPENJDK_TARGET_OS" = xmacosx; then | ||
| # No X11 support on windows or macosx | ||
| if test "x$OPENJDK_TARGET_OS" = xwindows || test "x$OPENJDK_TARGET_OS" = xmacosx || test "x$OPENJDK_TARGET_OS" = xios || test "x$OPENJDK_TARGET_OS" = xandroid; then | ||
| # No X11 support on windows, macosx, ios and android | ||
| NEEDS_LIB_X11=false | ||
| else | ||
| # All other instances need X11, even if building headless only, libawt still | ||
|
|
@@ -50,8 +50,8 @@ AC_DEFUN_ONCE([LIB_DETERMINE_DEPENDENCIES], | |
| fi | ||
|
|
||
| # Check if fontconfig is needed | ||
| if test "x$OPENJDK_TARGET_OS" = xwindows || test "x$OPENJDK_TARGET_OS" = xmacosx; then | ||
| # No fontconfig support on windows or macosx | ||
| if test "x$OPENJDK_TARGET_OS" = xwindows || test "x$OPENJDK_TARGET_OS" = xmacosx || test "x$OPENJDK_TARGET_OS" = xios || test "x$OPENJDK_TARGET_OS" = xandroid; then | ||
| # No fontconfig support on windows, macosx, ios and android | ||
| NEEDS_LIB_FONTCONFIG=false | ||
| else | ||
| # All other instances need fontconfig, even if building headless only, | ||
|
|
@@ -60,7 +60,7 @@ AC_DEFUN_ONCE([LIB_DETERMINE_DEPENDENCIES], | |
| fi | ||
|
|
||
| # Check if cups is needed | ||
| if test "x$OPENJDK_TARGET_OS" = xwindows; then | ||
| if test "x$OPENJDK_TARGET_OS" = xwindows || test "x$STATIC_BUILD" = xtrue; then | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. STATIC_LIB_BUILD instead of STATIC_BUILD |
||
| # Windows have a separate print system | ||
| NEEDS_LIB_CUPS=false | ||
| else | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,6 +40,12 @@ endif | |
|
|
||
| # get the exported symbols from mapfiles and if there | ||
| # is no mapfile, get them from the archive | ||
| ifeq ($(call isTargetOs, linux), true) | ||
| MNM = $(NM) | ||
| else | ||
| MNM = $(NM) -m | ||
| endif | ||
|
|
||
| define GetSymbols | ||
| $(RM) $$(@D)/$$(basename $$(@F)).symbols; \ | ||
| if [ ! -z $$($1_MAPFILE) -a -e $$($1_MAPFILE) ]; then \ | ||
|
|
@@ -53,9 +59,9 @@ define GetSymbols | |
| $(CUT) -d ' ' -f 3 >> $$(@D)/$$(basename $$(@F)).symbols || true;\ | ||
| else \ | ||
| $(ECHO) "Getting symbols from nm"; \ | ||
| $(NM) -m $$($1_TARGET) | $(GREP) "__TEXT" | \ | ||
| $(MNM) $$($1_TARGET) | $(GREP) "__TEXT" | \ | ||
| $(EGREP) -v "non-external|private extern|__TEXT,__eh_frame" | \ | ||
| $(SED) -e 's/.* //' > $$(@D)/$$(basename $$(@F)).symbols; \ | ||
| $(SED) -e 's/.* //' > $$(@D)/$$(basename $$(@F)).symbols || true; \ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This keeps the build from failing if a specific file does not have any symbols. |
||
| fi | ||
| endef | ||
|
|
||
|
|
@@ -820,7 +826,7 @@ define SetupNativeCompilationBody | |
| $(CD) $$($1_OUTPUT_DIR) && \ | ||
| $$($1_OBJCOPY) --add-gnu-debuglink=$$($1_DEBUGINFO_FILES) $$($1_TARGET) | ||
|
|
||
| else ifeq ($(OPENJDK_TARGET_OS), macosx) | ||
| else ifneq ($(findstring $(OPENJDK_TARGET_OS), ios macosx), ) | ||
| $1_DEBUGINFO_FILES := \ | ||
| $$($1_OUTPUT_DIR)/$$($1_BASENAME).dSYM/Contents/Info.plist \ | ||
| $$($1_OUTPUT_DIR)/$$($1_BASENAME).dSYM/Contents/Resources/DWARF/$$($1_BASENAME) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -90,7 +90,7 @@ else ifeq ($(OPENJDK_TARGET_OS), solaris) | |
| if ($$3 ~ /$(FILTER_SYMBOLS_PATTERN)/) print $$3; \ | ||
| }' | ||
|
|
||
| else ifeq ($(OPENJDK_TARGET_OS), macosx) | ||
| else ifneq (, $(filter $(OPENJDK_TARGET_OS), ios macosx)) | ||
| # nm on macosx prints out "warning: nm: no name list" to stderr for | ||
| # files without symbols. Hide this, even at the expense of hiding real errors. | ||
| DUMP_SYMBOLS_CMD := $(NM) -Uj *.o 2> /dev/null | ||
|
|
@@ -153,7 +153,7 @@ $(JVM_OUTPUTDIR)/symbols: $(SYMBOLS_SRC) | |
| ################################################################################ | ||
| # Finally convert the symbol list into a platform-specific mapfile | ||
|
|
||
| ifeq ($(OPENJDK_TARGET_OS), macosx) | ||
| ifneq (, $(filter $(OPENJDK_TARGET_OS), ios macosx)) | ||
| # On macosx, we need to add a leading underscore | ||
| define create-mapfile-work | ||
| $(AWK) '{ if ($$0 ~ ".") { print " _" $$0 } }' < $^ > [email protected] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,10 +39,13 @@ include CoreLibraries.gmk | |
| ################################################################################ | ||
| # Create the network library | ||
|
|
||
| LIBNET_SRC_DIRS := $(call FindSrcDirsForComponent, java.base, net) | ||
|
|
||
| $(eval $(call SetupJdkLibrary, BUILD_LIBNET, \ | ||
| NAME := net, \ | ||
| OPTIMIZATION := LOW, \ | ||
| CFLAGS := $(CFLAGS_JDKLIB), \ | ||
| SRC := $(LIBNET_SRC_DIRS), \ | ||
| DISABLED_WARNINGS_gcc := format-nonliteral, \ | ||
| DISABLED_WARNINGS_clang := parentheses-equality constant-logical-operand, \ | ||
| DISABLED_WARNINGS_microsoft := 4244 4047 4133 4996, \ | ||
|
|
@@ -189,8 +192,22 @@ ifeq ($(STATIC_BUILD), true) | |
| $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)verify.symbols \ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should the above ifeq be STATIC_LIB_BUILD && iOS? We don't need .symbols files on any platform other than iOS. |
||
| $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)zip.symbols \ | ||
| $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)jimage.symbols \ | ||
| $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/server/$(LIBRARY_PREFIX)jvm.symbols \ | ||
| # | ||
|
|
||
| ifeq ($(call isTargetOs, ios), true) | ||
| # JAVA_BASE_EXPORT_SYMBOLS_SRC += \ | ||
| # $(SUPPORT_OUTPUTDIR)/modules_libs/java.base$(OPENJDK_TARGET_CPU_LIBDIR)/jli/$(LIBRARY_PREFIX)jli.symbols | ||
| endif | ||
|
|
||
| ifeq ($(call check-jvm-variant, minimal), true) | ||
| JAVA_BASE_EXPORT_SYMBOLS_SRC += \ | ||
| $(SUPPORT_OUTPUTDIR)/modules_libs/java.base$(OPENJDK_TARGET_CPU_LIBDIR)/minimal/$(LIBRARY_PREFIX)jvm.symbols | ||
| else ifeq ($(call check-jvm-variant, client), true) | ||
| JAVA_BASE_EXPORT_SYMBOLS_SRC += \ | ||
| $(SUPPORT_OUTPUTDIR)/modules_libs/java.base$(OPENJDK_TARGET_CPU_LIBDIR)/client/$(LIBRARY_PREFIX)jvm.symbols | ||
| else ifeq ($(call check-jvm-variant, server), true) | ||
| JAVA_BASE_EXPORT_SYMBOLS_SRC += \ | ||
| $(SUPPORT_OUTPUTDIR)/modules_libs/java.base$(OPENJDK_TARGET_CPU_LIBDIR)/server/$(LIBRARY_PREFIX)jvm.symbols | ||
| endif | ||
|
|
||
| JAVA_BASE_EXPORT_SYMBOL_FILE := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/java.base.symbols | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove these 4 lines.