summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2013-03-29 11:10:58 +0900
committerTakeshi Abe <tabe@fixedpoint.jp>2013-03-29 11:10:58 +0900
commit385566e4ba57d803921a13306ead66f354cee0a2 (patch)
treeebd7e07577b7ab2a0f2044a9c390e00f3c0f26fd /cmake
parent03a41b1ad2cdf85daef73c1b5cb8037b5468c6ba (diff)
downloadlibgd-385566e4ba57d803921a13306ead66f354cee0a2.tar.gz
emit position-independent code for linking it to the shared library
Background: when linking libimagequant built in the source tree on my machine (Debian wheezy amd64 / gcc 4.7.2), I got the following message. > [ 36%] Building C object src/CMakeFiles/gd.dir/gdhelpers.c.o > [ 37%] Building C object src/CMakeFiles/gd.dir/gdkanji.c.o > [ 38%] Building C object src/CMakeFiles/gd.dir/gdtables.c.o > [ 39%] Building C object src/CMakeFiles/gd.dir/gdxpm.c.o > [ 40%] Building C object src/CMakeFiles/gd.dir/wbmp.c.o > Linking CXX shared library libgd.so > /usr/bin/ld: ../libimagequant/libimagequant.a(libimagequant.o): relocation R_X86_64_32S against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC > ../libimagequant/libimagequant.a: could not read symbols: Bad value > collect2: error: ld returned 1 exit status > make[2]: *** [src/libgd.so] Error 1 > make[1]: *** [src/CMakeFiles/gd.dir/all] Error 2 > make: *** [all] Error 2
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/FindLIQ.cmake2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmake/modules/FindLIQ.cmake b/cmake/modules/FindLIQ.cmake
index 19f490d..08713f5 100644
--- a/cmake/modules/FindLIQ.cmake
+++ b/cmake/modules/FindLIQ.cmake
@@ -44,7 +44,7 @@ ELSE (LIQ_FOUND)
INSTALL_DIR libimagequant
INSTALL_COMMAND true
CONFIGURE_COMMAND true
- BUILD_COMMAND make static
+ BUILD_COMMAND make static CFLAGSADD='-fPIC'
)
SET(LIQ_FOUND "SORTOF")