CMake IA64 FPIC problem: Difference between revisions

From KitwarePublic
Jump to navigationJump to search
No edit summary
(Replace content with link to new CMake community wiki)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
bar.c:
{{CMake/Template/Moved}}
int i = 0;
void bar()
  {
  i = 5;
  }


foo.c:
This page has moved [https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/platform_dependent_issues/IA64-FPIC-problem here].
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.
 
{{CMake/Template/Footer}}

Latest revision as of 15:41, 30 April 2018


The CMake community Wiki has moved to the Kitware GitLab Instance.

This page has moved here.