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".
 
I looked into the config files and echo-ed out stuff in the makefiles
(esp Makefile.in in uClibc/librt) only to find out the CC variable is
set to arm_v6_be_uclibc-gcc only. Using this compile the os files are
created.
I hardcoded "CC:= arm_v6_be_uclibc-gcc -fPIC"
and then re-compiled uClibc and the program as well and it ran perfectly
well.
 
Now how and where do i make the config files to have fPIC set for the
cross compiler??
 
All help appreciated.
 
cheers
- Ben.
 
_______________________________________________
uClibc mailing list
uClibc@uclibc.org
http://busybox.net/cgi-bin/mailman/listinfo/uclibc

Reply via email to