diff options
| author | Lakshmi Shanmugam | 2021-03-24 18:44:08 +0000 |
|---|---|---|
| committer | Lakshmi Shanmugam | 2021-03-25 22:11:44 +0000 |
| commit | 6e4c842e6df4b797affc08b98ad0d2b12b3e739d (patch) | |
| tree | 3339f152008fffb475d1facfb48dc61b96707fbb | |
| parent | e63fa44404b3a1f16859ebd087bb95669ddb4a9e (diff) | |
| download | rt.equinox.bundles-6e4c842e6df4b797affc08b98ad0d2b12b3e739d.tar.gz rt.equinox.bundles-6e4c842e6df4b797affc08b98ad0d2b12b3e739d.tar.xz rt.equinox.bundles-6e4c842e6df4b797affc08b98ad0d2b12b3e739d.zip | |
Bug 572113 - Build native library in equinox.security for arm64
Changes to build universal library for arm64 and x86_64, also cleanup
xcode project.
- clean-up unused archs and add arm64
- For jni.h: JavaVM framework is not available since XCode 12.2, so use
header from the installed Java. Pass value to xcode using
JAVA_HOME.
- Change <jni.h> to "jni.h" as it's not in the Framework and set
ALWAYS_SEARCH_USER_PATHS = NO
- Fix ALWAYS_SEARCH_USER_PATHS is deprecated warning
- setPassword() in C code returns void, remove String return type in
OSXProvider.setPassword() as this causes NPE.
- Skip signing during xcode build using CODE_SIGN_IDENTITY = "" and
CODE_SIGN_STYLE = Manual
Change-Id: Ib045f1966115ec1e27aecba44d58ae046a3bd16d
Signed-off-by: Lakshmi Shanmugam <lshanmug@in.ibm.com>
5 files changed, 22 insertions, 15 deletions
diff --git a/bundles/org.eclipse.equinox.security.macosx/keystoreNative/build.xml b/bundles/org.eclipse.equinox.security.macosx/keystoreNative/build.xml index 5170127f0..394b7ca3f 100644 --- a/bundles/org.eclipse.equinox.security.macosx/keystoreNative/build.xml +++ b/bundles/org.eclipse.equinox.security.macosx/keystoreNative/build.xml @@ -40,7 +40,7 @@ <target name="compile" depends="init" description="Compile JNI Wrapper code"> <javac srcdir="${src}" destdir="${bin}" - source="1.3" target="1.2" + source="1.8" target="1.8" includeAntRuntime="no" classpathref="lib.path" debug="${compile.debug}"> </javac> @@ -60,9 +60,12 @@ <!-- Note: this target requires that Xcode Tools be installed --> <target name="nativelib" depends="jar"> + <exec executable="/usr/libexec/java_home" outputproperty="JAVA_HOME"/> + <echo>JAVA_HOME is ${JAVA_HOME}"</echo> <exec executable="/usr/bin/xcodebuild"> <arg line="-project ${native.project}"/> <arg line="-target ${native.target}"/> + <arg line="JAVA_HOME=${JAVA_HOME}"/> </exec> <copy file="${curr_build_dir}/${native.library}" toDir="${bin}" failonerror="true" verbose="true"/> </target> diff --git a/bundles/org.eclipse.equinox.security.macosx/keystoreNative/keystoreNative.h b/bundles/org.eclipse.equinox.security.macosx/keystoreNative/keystoreNative.h index 8badb76b2..cf82275fa 100644 --- a/bundles/org.eclipse.equinox.security.macosx/keystoreNative/keystoreNative.h +++ b/bundles/org.eclipse.equinox.security.macosx/keystoreNative/keystoreNative.h @@ -13,7 +13,7 @@ *******************************************************************************/ /* DO NOT EDIT THIS FILE - it is machine generated */ -#include <jni.h> +#include "jni.h" /* Header for class org_eclipse_equinox_internal_security_osx_OSXProvider */ #ifndef _Included_org_eclipse_equinox_internal_security_osx_OSXProvider diff --git a/bundles/org.eclipse.equinox.security.macosx/keystoreNative/keystoreNative.xcodeproj/project.pbxproj b/bundles/org.eclipse.equinox.security.macosx/keystoreNative/keystoreNative.xcodeproj/project.pbxproj index c2cd25f38..c449b20e1 100644 --- a/bundles/org.eclipse.equinox.security.macosx/keystoreNative/keystoreNative.xcodeproj/project.pbxproj +++ b/bundles/org.eclipse.equinox.security.macosx/keystoreNative/keystoreNative.xcodeproj/project.pbxproj @@ -141,6 +141,8 @@ 4CEBA75D08679E4D0015D03E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CODE_SIGN_STYLE = Manual; ZERO_LINK = NO; }; name = Debug; @@ -148,8 +150,12 @@ 4CEBA75E08679E4D0015D03E /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)"; - ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "ppc i386 ppc64 x86_64"; + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_ARM_INTEL_64_BIT_XCODE_12)"; + ARCHS_STANDARD_ARM_INTEL_64_BIT_XCODE_12 = "x86_64 arm64"; + CODE_SIGN_STYLE = Manual; + MACOSX_DEPLOYMENT_TARGET = 10.10; + "USER_HEADER_SEARCH_PATHS[arch=*]" = "$(JAVA_HOME)/include $(JAVA_HOME)/include/darwin"; ZERO_LINK = NO; }; name = Release; @@ -158,6 +164,7 @@ isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(NATIVE_ARCH)"; + CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -166,12 +173,9 @@ GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_MODEL_TUNING = G5; GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "/System/Library/Frameworks/JavaVM.framework/Headers/**", - "${TARGET_BUILD_DIR}/Headers/**", - ); + HEADER_SEARCH_PATHS = "${TARGET_BUILD_DIR}/Headers/**"; HEADER_SEARCH_PATHS_QUOTED_1 = "\"${OBJROOT}/Headers\""; - HEADER_SEARCH_PATHS_QUOTED_2 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/JavaVM.framework/Headers\""; + HEADER_SEARCH_PATHS_QUOTED_2 = ""; HEADER_SEARCH_PATHS_QUOTED_3 = "\"$(CONFIGURATION_BUILD_DIR)/Headers\""; INSTALL_PATH = /usr/local/lib; LIBRARY_STYLE = DYNAMIC; @@ -195,10 +199,10 @@ isa = XCBuildConfiguration; buildSettings = { ARCHS = ( - ppc, - i386, + arm64, x86_64, ); + CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -212,8 +216,8 @@ "$(HEADER_SEARCH_PATHS_QUOTED_4)", ); HEADER_SEARCH_PATHS_QUOTED_1 = "\"${OBJROOT}/Headers\""; - HEADER_SEARCH_PATHS_QUOTED_2 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/JavaVM.framework/Headers\""; - HEADER_SEARCH_PATHS_QUOTED_3 = "\"/System/Library/Frameworks/JavaVM.framework/Headers\"/**"; + HEADER_SEARCH_PATHS_QUOTED_2 = ""; + HEADER_SEARCH_PATHS_QUOTED_3 = ""; HEADER_SEARCH_PATHS_QUOTED_4 = "\"${TARGET_BUILD_DIR}/Headers\"/**"; INSTALL_PATH = /usr/local/lib; LIBRARY_STYLE = DYNAMIC; diff --git a/bundles/org.eclipse.equinox.security.macosx/keystoreNative/src/keystoreNativejnilib.c b/bundles/org.eclipse.equinox.security.macosx/keystoreNative/src/keystoreNativejnilib.c index b8f865889..5d64a2a41 100644 --- a/bundles/org.eclipse.equinox.security.macosx/keystoreNative/src/keystoreNativejnilib.c +++ b/bundles/org.eclipse.equinox.security.macosx/keystoreNative/src/keystoreNativejnilib.c @@ -12,7 +12,7 @@ * IBM Corporation - initial API and implementation *******************************************************************************/ -#include <jni.h> +#include "jni.h" #include "keystoreNative.h" #include <CoreFoundation/CoreFoundation.h> #include <Security/Security.h> diff --git a/bundles/org.eclipse.equinox.security.macosx/src/org/eclipse/equinox/internal/security/osx/OSXProvider.java b/bundles/org.eclipse.equinox.security.macosx/src/org/eclipse/equinox/internal/security/osx/OSXProvider.java index 23b716ebc..9dc33cc15 100644 --- a/bundles/org.eclipse.equinox.security.macosx/src/org/eclipse/equinox/internal/security/osx/OSXProvider.java +++ b/bundles/org.eclipse.equinox.security.macosx/src/org/eclipse/equinox/internal/security/osx/OSXProvider.java @@ -33,7 +33,7 @@ public class OSXProvider extends PasswordProvider { private native String getPassword(String service, String account) throws SecurityException; - private native String setPassword(String serviceName, String accountName, String password) throws SecurityException; + private native void setPassword(String serviceName, String accountName, String password) throws SecurityException; @Override public PBEKeySpec getPassword(IPreferencesContainer container, int passwordType) { |
