CMake IA64 FPIC problem: Difference between revisions
From KitwarePublic
Jump to navigationJump to search
No edit summary |
No edit summary |
||
Line 29: | Line 29: | ||
works. | works. | ||
{{CMake/Template/Footer}} | {{CMake/Template/Footer}} |
Revision as of 16:43, 13 December 2005
bar.c:
int i = 0; void bar() { i = 5; }
foo.c:
extern void bar(); void foo() { bar(); }
Compiled with
rm -f libbar.a *.o gcc -c bar.c ar cr libbar.a bar.o gcc -c foo.c gcc -shared -o libfoo.so foo.o -L. -lbar
Will fail:
/usr/bin/ld: bar.o: @gprel relocation against dynamic symbol i collect2: ld returned 1 exit status
But, putting:
gcc -fPIC -c bar.c
works.