Andi Vajda
2015-10-28 03:46:01 UTC
Hi folks,
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.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
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 packages available via pip and easy_install do the same thing.m
M
This thread hasn't been updated in a long time and today it's affected mebuilding '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.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
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 packages available via pip and easy_install do the same thing.m
M
too on Mac OS X 10.10.3 with the latest Xcode 7 command line tools installed.
Searching the net, it seems that there is a combination of things at work here:
- first, there seems to be a bug with -Wl,-x as a linker flag passed to
the compiler and since this flag is not needed, removing it works the
problem around. See the responses in this thread:
http://stackoverflow.com/questions/26570125/error-installing-pylucene-jcc-on-osx
- second, in trying to create some kind of monkey patch for this, I looked
for where this flag was set: it is set in line 137 of setuptools'
build_ext.py file in this jolly code snippet:
try:
# XXX Help! I don't have any idea whether these are right...
_CONFIG_VARS['LDSHARED'] = "gcc -Wl,-x -dynamiclib -undefined dynamic_lookup"
_CONFIG_VARS['CCSHARED'] = " -dynamiclib"
_CONFIG_VARS['SO'] = ".dylib"
customize_compiler(compiler)
finally:
_CONFIG_VARS.clear()
_CONFIG_VARS.update(tmp)
In other words, it's ugly.
The simplest way around this is to edit build_ext.py to just remove the
-Wl,-x part of the LDSHARED flags being smashed here.
try:
# XXX Help! I don't have any idea whether these are right...
_CONFIG_VARS['LDSHARED'] = "gcc -dynamiclib -undefined dynamic_lookup"
_CONFIG_VARS['CCSHARED'] = " -dynamiclib"
_CONFIG_VARS['SO'] = ".dylib"
customize_compiler(compiler)
finally:
_CONFIG_VARS.clear()
_CONFIG_VARS.update(tmp)
In my install, the source to setuptools' build_ext.py is here:
$ find ../_install -type f -print0 | xargs -0 grep 'Wl,-x'
../_install/lib/python2.7/site-packages/setuptools/command/build_ext.py: _CONFIG_VARS['LDSHARED'] = "gcc -Wl,-x -dynamiclib -undefined dynamic_lookup"
I'm sorry this is so bad, words fail me too.
Andi..