Visitar URL original
native build fails on OS X · Issue #173 · java-native-access/jna · GitHub
Skip to content

native build fails on OS X #173

Closed
Closed

Description

@rzeigler

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

Activity

  1. twall commented on Jan 5, 2013

    @twall
    Contributor

    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.

  2. mkjellman commented on Mar 26, 2013

    @mkjellman

    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

  3. mkjellman commented on Mar 27, 2013

    @mkjellman

    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

  4. twall commented on Apr 3, 2013

    @twall
    Contributor

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

  5. twall commented on Apr 3, 2013

    @twall
    Contributor

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

  6. twall commented on Apr 8, 2013

    @twall
    Contributor

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

  7. mkjellman commented on Apr 8, 2013

    @mkjellman

    @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.

  8. mkjellman commented on Apr 8, 2013

    @mkjellman

    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

  9. twall commented on Apr 9, 2013

    @twall
    Contributor

    Please file issues for web start and load tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions