Hi Andi, thanks for your reply.  Not only was it compiling against Java 8 
binaries, it was using Java 6 headers.  I took a look at helpers/darwin.py and 
noticed two problems with it:

1. It uses /usr/libexec/java_home to find the JDK and does not observe the 
JAVA_HOME environment variable.  I have Apple’s JDK 6 plus Oracle’s JDK 7 and 8 
on my system and /usr/libexec/java_home always return the path to Java 8.

2. JAVAHOME and JAVAFRAMEWORKS end up pointing to two different versions.  As I 
mentioned above, java_home will return the path to the latest JDK and 
JAVAFRAMEWORKS is hard-coded to look in Apple’s path which is for JDK 6 
headers.  The headers for Oracle’s JDKs are in $JAVA_HOME/include.

I modified setup.py to just use my JDK 7 installation.  The two modules compile 
the same as before, and the linker still dies.  I set JCC_LDFLAGS=-v and got 
this:

Thread model: posix
 
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld"
 -demangle -dynamic -dylib -dylib_compatibility_version 2.19 
-dylib_current_version 2.19 -arch x86_64 -dylib_install_name 
@rpath/libjcc.dylib -macosx_version_min 10.9.0 -undefined dynamic_lookup 
-undefined dynamic_lookup -o build/lib.macosx-10.9-intel-2.7/libjcc.dylib -x 
build/temp.macosx-10.9-intel-2.7/jcc/sources/jcc.o 
build/temp.macosx-10.9-intel-2.7/jcc/sources/JCCEnv.o -S -lc++ -lSystem 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/5.1/lib/darwin/libclang_rt.osx.a
ld: internal error: atom not found in 
symbolIndex(__ZN7JNIEnv_13CallIntMethodEP8_jobjectP10_jmethodIDz) for 
architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'g++' failed with exit status 1

CallIntMethod smells like it should be part of a JDK library, correct?  Should 
there be another library referenced in that linker command that isn’t?  My 
other thought is that maybe something is being deadstripped.

M

On Mar 28, 2014, at 3:05 AM, Andi Vajda <[email protected]> wrote:

> 
>> On Mar 28, 2014, at 5:58, Mike McCormick <[email protected]> wrote:
>> 
>> Hi folks,
>> 
>> I am trying to build jcc to install JModelica.  The linking process dies:
>> 
>> building 'jcc' extension
>> gcc -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -Qunused-arguments 
>> -dynamiclib -D_jcc_lib -DJCC_VER="2.19" 
>> -I/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/include 
>> -I/Library/Java/JavaVirtualMachines/jdk1.8.0
> 
> You're building against Java 8 which has not yet been tested with jcc. It may 
> work, or not.
> 
>> .jdk/Contents/Home/include/darwin -I_jcc -Ijcc/sources 
>> -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 
>> -c jcc/sources/jcc.cpp -o build/temp.macosx-10.9-intel-2.7/jcc/sources/jcc.o 
>> -DPYTHON -fno-strict-aliasing -Wno-write-strings
>> gcc -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -Qunused-arguments 
>> -dynamiclib -D_jcc_lib -DJCC_VER="2.19" 
>> -I/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/include 
>> -I/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/include/darwin
>>  -I_jcc -Ijcc/sources 
>> -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 
>> -c jcc/sources/JCCEnv.cpp -o 
>> build/temp.macosx-10.9-intel-2.7/jcc/sources/JCCEnv.o -DPYTHON 
>> -fno-strict-aliasing -Wno-write-strings
>> g++ -Wl,-x -dynamiclib -undefined dynamic_lookup -Qunused-arguments 
>> build/temp.macosx-10.9-intel-2.7/jcc/sources/jcc.o 
>> build/temp.macosx-10.9-intel-2.7/jcc/sources/JCCEnv.o -o 
>> build/lib.macosx-10.9-intel-2.7/libjcc.dylib 
>> -L/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib 
>> -ljava 
>> -L/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/server
>>  -ljvm -Wl,-rpath 
>> -Wl,/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib 
>> -Wl,-rpath 
>> -Wl,/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/server
>>  -Wl,-S -install_name @rpath/libjcc.dylib -current_version 2.19 
>> -compatibility_version 2.19
>> ld: internal error: atom not found in 
>> symbolIndex(__ZN7JNIEnv_13CallIntMethodEP8_jobjectP10_jmethodIDz) for 
>> architecture x86_64
>> clang: error: linker command failed with exit code 1 (use -v to see 
>> invocation)
>> error: command 'g++' failed with exit status 1
>> bash-3.2# 
>> 
>> I tried using Xcode and GCC and both stop with the same error at the same 
>> point in the process.  Any idea how to approach troubleshooting this?
> 
> The linker error could be due to a mismatch between header files version and 
> jre library version. Also, jdk 8 is still untested against jcc.
> 
> Andi..
> 
>> The packages available via pip and easy_install do the same thing.m
>> 
>> M
> 

Reply via email to