Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

native build fails on OS X #173

Closed
rzeigler opened this issue Jan 5, 2013 · 9 comments
Closed

native build fails on OS X #173

rzeigler opened this issue Jan 5, 2013 · 9 comments

Comments

@rzeigler
Copy link

rzeigler commented Jan 5, 2013

OS X 10.8 with XCode 4.5 tools
Here is the build log:

[exec] gcc -dynamiclib -o /Users/zeiglerr/Code/jna/build-d64/native/libjnidispatch.jnilib -framework JavaVM -compatibility_version 3 -current_version 3.5.0 -mmacosx-version-min=10.3 -install_name libjnidispatch.jnilib /Users/zeiglerr/Code/jna/build-d64/native/dispatch.o /Users/zeiglerr/Code/jna/build-d64/native/callback.o /Users/zeiglerr/Code/jna/build-d64/native/libffi/.libs/libffi.a
[exec] ld: warning: could not create compact unwind for _ffi_call_unix64: does not use RBP or RSP based frame
[exec] Undefined symbols for architecture x86_64:
[exec] "_objc_msgSend_fixup", referenced from:
[exec] l_objc_msgSend_fixup_autorelease in dispatch.o
[exec] ld: symbol(s) not found for architecture x86_64
[exec] collect2: ld returned 1 exit status
[exec] make: *** [/Users/zeiglerr/Code/jna/build-d64/native/libjnidispatch.jnilib] Error 1

@twall
Copy link
Contributor

twall commented Jan 5, 2013

I'm using gcc 4.2.1 on OSX 10.6.8 (Xcode 3.2.6).

feel free to make a PR with a fix.

longer-term we need a solution for working with whatever environment OSX ends up with once apple stops making the JavaVM framework available.

On Jan 5, 2013, at 10:22 AM, arzig wrote:

OS X 10.8 with XCode 4.5 tools
Here is the build log:

[exec] gcc -dynamiclib -o /Users/zeiglerr/Code/jna/build-d64/native/libjnidispatch.jnilib -framework JavaVM -compatibility_version 3 -current_version 3.5.0 -mmacosx-version-min=10.3 -install_name libjnidispatch.jnilib /Users/zeiglerr/Code/jna/build-d64/native/dispatch.o /Users/zeiglerr/Code/jna/build-d64/native/callback.o /Users/zeiglerr/Code/jna/build-d64/native/libffi/.libs/libffi.a
[exec] ld: warning: could not create compact unwind for _ffi_call_unix64: does not use RBP or RSP based frame
[exec] Undefined symbols for architecture x86_64:
[exec] "_objc_msgSend_fixup", referenced from:
[exec] l_objc_msgSend_fixup_autorelease in dispatch.o
[exec] ld: symbol(s) not found for architecture x86_64
[exec] collect2: ld returned 1 exit status
[exec] make: *** [/Users/zeiglerr/Code/jna/build-d64/native/libjnidispatch.jnilib] Error 1


Reply to this email directly or view it on GitHub.

@mkjellman
Copy link

same issue with the current gcc for XCode (4.6.1) is i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00) on 10.8.3 with Oracle sourced JDK, which is currently build 1.7.0_17-b02.

[exec] gcc -W -Wall -Wno-unused -Wno-parentheses -x objective-c -O2 -fno-omit-frame-pointer -fno-strict-aliasing -D_REENTRANT -DTARGET_RT_MAC_CFM=0 -DFFI_MMAP_EXEC_WRIT -I/System/Library/Frameworks/JavaVM.framework/Headers -I"/Users/mkjellman/Documents/jna/build-d64/native" -I/Users/mkjellman/Documents/jna/build-d64/native/libffi/include -DJNA_JNI_VERSION='"3.5.0"' -DCHECKSUM='"60417f69d77e4d8d693b43391a4a5b91"' -c callback.c -o /Users/mkjellman/Documents/jna/build-d64/native/callback.o [exec] ld: warning: could not create compact unwind for _ffi_call_unix64: does not use RBP or RSP based frame [exec] Undefined symbols for architecture x86_64: [exec] "_objc_msgSend_fixup", referenced from: [exec] l_objc_msgSend_fixup_autorelease in dispatch.o [exec] ld: symbol(s) not found for architecture x86_64 [exec] collect2: ld returned 1 exit status [exec] make: *** [/Users/mkjellman/Documents/jna/build-d64/native/libjnidispatch.jnilib] Error 1

@mkjellman
Copy link

This should fix things

diff --git a/native/Makefile b/native/Makefile
index 03fd09b..9fb1cc3 100644
--- a/native/Makefile
+++ b/native/Makefile
@@ -118,7 +118,7 @@ NDK_PLATFORM?=/Developer/Applications/android-ndk-r7c/platforms/android-14
 JAVA_INCLUDES=
 CINCLUDES+=-I"$(NDK_PLATFORM)/arch-arm/usr/include" # -I/usr/include
 LIBS=-nostdlib -L"$(NDK_PLATFORM)/arch-arm/usr/lib/" -lgcc -lc -ldl -lm
-LDFLAGS+=-Wl,-shared,-Bsymbolic
+LDFLAGS+=-Wl,-shared,-Bsymbolic,-no_pie,-no_compact_unwind
 FFI_ENV=CPP="$(CPP)" CC="$(CC)" CFLAGS="$(COPT) $(CDEBUG) $(CINCLUDES)" CPPFLAGS="$(CDEFINES) $(CINCLUDES)" LIBS="$(LIBS)" RANLIB="$(RANLIB)"
 FFI_CONFIG=--enable-static --disable-shared --with-pic=yes --host=arm-linux-eabi
 endif
@@ -308,6 +308,8 @@ LDFLAGS=$(ARCHFLAGS) -dynamiclib -o $@ -framework JavaVM \
   -compatibility_version $(shell echo ${JNA_JNI_VERSION}|sed 's/^\([0-9][0-9]*\).*/\1/g') \
   -current_version $(JNA_JNI_VERSION) \
   -mmacosx-version-min=10.3 \
+  -framework Foundation \
+  -Wl,-no_compact_unwind,-no_pie \
   -install_name ${@F} \
   $(SYSLIBROOT)
 # JAWT linkage handled by -framework JavaVM

The WebStartTest tests are failing when using the Oracle JDK. For some reason the JDK is looking in ~/Library/Caches/Java/ instead of ~/Library/Application\ Support/Oracle/Java/Deployment/deployment.properties

After that it appears that java webstart isn't exported or something. java.io.IOException: javaws executable not found I'm just skipping these test for now but leaving that as an FYI

juretta pushed a commit to juretta/jna that referenced this issue Apr 2, 2013
@twall
Copy link
Contributor

twall commented Apr 3, 2013

I'm guessing the changes to the android-arm target were inadvertent...

@twall
Copy link
Contributor

twall commented Apr 3, 2013

Does this work for you without -no_pie? That option seems superfluous to me.

@twall
Copy link
Contributor

twall commented Apr 8, 2013

Should be addressed in a676e3a (close this issue if it works).

@mkjellman
Copy link

@twall, so sorry i meant to follow up on this and it fell to the bottom of my inbox. I'm checking right now. the changes to the andriod-arm target were in fact inadvertent.

@mkjellman
Copy link

this ticket does fix native builds. although, the WebStartTest and LibraryLoadTest junit tests still fail (but that is already in another filed/should be handled in another bug)

WebStartTest is failing to find jwaw in the correct path
LibraryLoadTest is failing to find the compiled native .dylib (Expected JNA native library)/can't load JAWT

@twall
Copy link
Contributor

twall commented Apr 9, 2013

Please file issues for web start and load tests.

@twall twall closed this as completed Apr 9, 2013
mstyura pushed a commit to mstyura/jna that referenced this issue Sep 9, 2024
Motivation:

As we statically link against boringssl and quiche we should include the license material in the jar for attribution.

Modifications:

Add license material

Result:

Do proper attribution
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants