CMake IA64 FPIC problem: Difference between revisions

From KitwarePublic
Jump to navigationJump to search
(Add explicit preformat markup)
(Replace content with link to new CMake community wiki)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
bar.c:
{{CMake/Template/Moved}}
<pre>
int i = 0;
void bar()
  {
  i = 5;
  }
</pre>


foo.c:
This page has moved [https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/platform_dependent_issues/IA64-FPIC-problem here].
<pre>
extern void bar();
void foo()
  {
  bar();
  }
</pre>
 
Compiled with
 
<pre>
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
</pre>
 
Will fail:
<pre>
/usr/bin/ld: bar.o: @gprel relocation against dynamic symbol i collect2: ld returned 1 exit status
</pre>
 
But, putting:
 
<pre>
gcc -fPIC -c bar.c
</pre>
 
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.