grendizerufo / nvidia-texture-tools

Automatically exported from code.google.com/p/nvidia-texture-tools
Other
0 stars 0 forks source link

linux x86_64 compile error: relocation R_X86_64_32S against `a local symbol' ... #74

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. ./configure --prefix=/usr/local --release
2. make

What is the expected output? What do you see instead?
expected output: compiled successfully 
error: 

Linking CXX shared library libnvtt.so
/usr/bin/ld: squish/libsquish.a(fastclusterfit.cpp.o): relocation
R_X86_64_32S against `a local symbol' can not be used when making a shared
object; recompile with -fPIC
squish/libsquish.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[3]: *** [src/nvtt/libnvtt.so] Error 1
make[2]: *** [src/nvtt/CMakeFiles/nvtt.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [all] Error 2

What version of the product are you using? On what operating system?

nvidia-texture-tools-2.0.5

Linux x61s 2.6.28-4-generic #5-Ubuntu SMP Fri Dec 26 22:48:55 UTC 2008
x86_64 GNU/Linux

gcc -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
4.3.2-1ubuntu11' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --enable-nls
--with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3
--enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc
--enable-mpfr --enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.3.2 (Ubuntu 4.3.2-1ubuntu11)

Please provide any additional information below.

workaround:

diff --git a/nvidia-texture-tools/src/nvtt/squish/CMakeLists.txt
b/nvidia-texture-tools-works/src/nvtt/squish/CMakeLists.txt
index b98f2a7..640d71b 100644
--- a/nvidia-texture-tools/src/nvtt/squish/CMakeLists.txt
+++ b/nvidia-texture-tools-works/src/nvtt/squish/CMakeLists.txt
@@ -32,7 +32,7 @@ SET(SQUISH_SRCS
        simd_sse.h
        simd_ve.h)

-ADD_LIBRARY(squish STATIC ${SQUISH_SRCS})
+ADD_LIBRARY(squish SHARED ${SQUISH_SRCS})

 # libpng
 #FIND_PACKAGE(PNG)

Original issue reported on code.google.com by alexande...@gmail.com on 3 Jan 2009 at 10:34

GoogleCodeExporter commented 9 years ago
Alternative solution: add line
SET_TARGET_PROPERTIES(squish PROPERTIES COMPILE_FLAGS -fPIC)
to CMakeLists.txt after ADD_LIBRARY

Original comment by frank.ri...@gmail.com on 9 Jan 2009 at 4:53

GoogleCodeExporter commented 9 years ago
Thanks, the alternative solution is preferred. I don't think that compiling 
squish
dynamically is a good idea, since my local version squish has been modified
significantly and is not compatible with the official one.

Original comment by cast...@gmail.com on 10 Jan 2009 at 1:21

GoogleCodeExporter commented 9 years ago
This is now fixed in revision 805.

http://code.google.com/p/nvidia-texture-tools/source/detail?r=805

Original comment by cast...@gmail.com on 10 Jan 2009 at 1:29