-
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?
Conversation
| $(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; \ |
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.
Why do we need || true here?
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.
This keeps the build from failing if a specific file does not have any symbols.
|
@bobvandette it would be great if you can review this PR as well. |
|
I previously reviewed this patch in the Mobile projects repository and was ok with it there. The biggest problem with integrating these changes here is that the static changes now conflict with the current set of patches in the labsjdk. There are now two different Makefile variables controlling static building. STATIC_LIB_BUILD and STATIC_BUILD. We are only interested in building the libs and don't want to produce a completely static JDK set of binaries. This patch needs to be updated with this in mind. The functionality that is not related to building libraries needs to be changed from #ifdef STATIC_BUILD to #ifdef FULL_STATIC_BUILD. There are examples of this in the code. |
| 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 |
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 three lines.
| fi | ||
| fi | ||
| if test "x$STATIC_BUILD" = xtrue; then |
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.
| 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 |
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 3 lines
| # 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 |
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.
STATIC_LIB_BUILD instead of STATIC_BUILD
| 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 |
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.
STATIC_LIB_BUILD instead of STATIC_BUILD
| $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)java.symbols \ | ||
| $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)net.symbols \ | ||
| $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)nio.symbols \ | ||
| $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)verify.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.
Should the above ifeq be STATIC_LIB_BUILD && iOS? We don't need .symbols files on any platform other than iOS.
|
@bobvandette what would be necessary for this change to be upstreamed? Our goal would be that all the changes done in this repo can be upstreamed. |
We are looking at implementing some form of the static library changes upstream. These static changes will most likely be a bit different than what you have today. The current implementation requires two builds of the JDK. We want to do this in a single build. (ie. Build shared and static libraries during a single build). Adding new supported platforms (iOS and Android) is a bit more complex. I've had discussions with Johan and put him in touch with the folks that handle porting and new platforms for OpenJDK. |
With these changes, the static libs for the core classes can be built for iOS
make java.base-libs java.prefs-libs jdk.crypto.cryptoki-libs jdk.crypto.ec-libs works