set fPIC option for librt

Khem Raj raj.khem at gmail.com
Fri Sep 12 00:13:59 UTC 2008


On (11/09/08 19:32), JACOB BENJAMIN-VGH684 wrote:
> Hello ppl,
> I am totally new to uClibc. I did search for my problem in the archives
> but could not really find a solution.
>  
> My problem:
> I wrote a simple program :
> 
> 	#include <time.h>
> 	#include <stdio.h>
> 	 
> 	int main()
> 	{
> 	    timer_t tid;
> 	    if(timer_create(CLOCK_REALTIME, NULL, &tid) == 0)
> 	        printf("timer created\n");
> 	    else
> 	        printf("timer create failed\n");
> 	    timer_delete(tid);
> 	    return 0;
> 	}
> 	
> 
> I cross compiled it with:
>         arm_v6_be_uclibc-gcc timerUse.c -lrt 
>  
> and ran the resultant a.out on a monta vista box
> I got an error saying something to the effect of "Can't modify text
> section. Use GCC option -fPIC for shared objects, please".

This means that there are TEXTRELS in the shared libraries, uclibc rejects it by default. If you have FORCE_SHAREABLE_TEXT_SEGMENTS set in your .config then unset it and recompile uclibc and see if it works.

-Khem



More information about the uClibc mailing list