jmlien/acd2d

libFIST : recompile with -fPIC

Closed this issue · 1 comments

While trying to make the repo, I get the following error with the FIST library.

g++ -std=c++11 -MMD -W -O3 -Wno-deprecated -Wno-unused-parameter -I. -Isrc -Isrc/mathtool -Isrc/hull -Isrc/edge_visibility -Igui -Igui/GL -I./libs/FIST -fPIC  -o acd2d_gui src/acd2d_data.o src/acd2d_concavity.o src/acd2d_core.o src/mathtool/acd2d_Basic.o src/hull/acd2d_hull_use_qhull.o src/hull/acd2d_hull.o src/edge_visibility/acd2d_edge_visibility.o src/edge_visibility/acd2d_ev_function.o gui/acd2d_drawPS.o gui/acd2d_main_gui.o gui/acd2d_stat.o gui/GL/gliTexture.o gui/GL/gliFont.o gui/GL/gli.o gui/GL/gliDump.o gui/GL/gl2ps.o -Wl,-rpath,/usr/X11R6/lib -L/usr/X11R6/lib -L/usr/local/lib -lXext -lX11 -lXt  -lglut -lGLU -lGL -lm  -L./libs/FIST -lFIST.linux64 
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(api_functions.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(compute.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(data.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(desperate.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(ear_clip.o): relocation R_X86_64_32 against symbol `numerics_h_p' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(elapsed.o): relocation R_X86_64_32 against symbol `__gxx_personality_v0@@CXXABI_1.3' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(grid.o): relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(heap.o): relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(io.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(list.o): relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(memory.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(misc.o): relocation R_X86_64_32 against symbol `__gxx_personality_v0@@CXXABI_1.3' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(numerics.o): relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(orientation.o): relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(quads.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(sgo.o): relocation R_X86_64_32 against `.bss' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(simple.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(statistics.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(triangulate.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(vertex.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(write_ipe.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(bottleneck.o): relocation R_X86_64_32 against symbol `numerics_h_p' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(bridge.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(clean_data.o): relocation R_X86_64_32 against symbol `_Z6p_compPKvS0_' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(degenerate.o): relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(ipe_io.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./libs/FIST/libFIST.linux64.a(project.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Makefile:90: recipe for target 'acd2d_gui' failed
make: *** [acd2d_gui] Error 1

From what I understand, the compilation requires the shared object for the FIST library. How can I generate the shared object for FIST?

Solved it by adding -no-pie in the CFLAGS inside the Makefile