OpenWrt Forum Archive

Topic: linking PIC files with non-PIC files

The content of this topic has been archived on 5 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi guys.

I want to invoke getenv in dev.c under net/core/, when compile I got the error msgs below. Seems the main problem is " linking PIC files with non-PIC files" . Anyone has idea about that ?? Thank you in advance!

mipsel-linux-ld: /opt/brcm/hndtools-mipsel-uclibc/lib/libc.a(getenv.o): linking PIC files with non-PIC files
Bad value: failed to merge target specific data of file /opt/brcm/hndtools-mipsel-uclibc/lib/libc.a(getenv.o)
mipsel-linux-ld: /opt/brcm/hndtools-mipsel-uclibc/lib/libc.a(__uClibc_main.o): linking PIC files with non-PIC files
Bad value: failed to merge target specific data of file /opt/brcm/hndtools-mipsel-uclibc/lib/libc.a(__uClibc_main.o)
mipsel-linux-ld: /opt/brcm/hndtools-mipsel-uclibc/lib/libc.a(atexit.o): linking PIC files with non-PIC files
Bad value: failed to merge target specific data of file /opt/brcm/hndtools-mipsel-uclibc/lib/libc.a(atexit.o)
mipsel-linux-ld: /opt/brcm/hndtools-mipsel-uclibc/lib/libc.a(__exit_handler.o): linking PIC files with non-PIC files
Bad value: failed to merge target specific data of file /opt/brcm/hndtools-mipsel-uclibc/lib/libc.a(__exit_handler.o)
mipsel-linux-ld: /opt/brcm/hndtools-mipsel-uclibc/lib/libc.a(exit.o): linking PIC files with non-PIC files
Bad value: failed to merge target specific data of file /opt/brcm/hndtools-mipsel-uclibc/lib/libc.a(exit.o)
mipsel-linux-ld: /opt/brcm/hndtools-mipsel-uclibc/lib/libc.a(malloc.o): linking PIC files with non-PIC files
Bad value: failed to merge target specific data of file /opt/brcm/hndtools-mipsel-uclibc/lib/libc.a(malloc.o)
mipsel-linux-ld: /opt/brcm/hndtools-mipsel-uclibc/lib/libc.a(realloc.o): linking PIC files with non-PIC files
Bad value: failed to merge target specific data of file /opt/brcm/hndtools-mipsel-uclibc/lib/libc.a(realloc.o)
mipsel-linux-ld: /opt/brcm/hndtools-mipsel-uclibc/lib/libc.a(_exit.o): linking PIC files with non-PIC files
Bad value: failed to merge target specific data of file /opt/brcm/hndtools-mipsel-uclibc/lib/libc.a(_exit.o)
mipsel-linux-ld: /opt/brcm/hndtools-mipsel-uclibc/lib/libc.a(sbrk.o): linking PIC files with non-PIC files
Bad value: failed to merge target specific data of file /opt/brcm/hndtools-mipsel-uclibc/lib/libc.a(sbrk.o)
mipsel-linux-ld: /opt/brcm/hndtools-mipsel-uclibc/lib/libc.a(brk.o): linking PIC files with non-PIC files
Bad value: failed to merge target specific data of file /opt/brcm/hndtools-mipsel-uclibc/lib/libc.a(brk.o)
mipsel-linux-ld: /opt/brcm/hndtools-mipsel-uclibc/lib/libc.a(__errno_location.o): linking PIC files with non-PIC files
Bad value: failed to merge target specific data of file /opt/brcm/hndtools-mipsel-uclibc/lib/libc.a(__errno_location.o)
mipsel-linux-ld: /opt/brcm/hndtools-mipsel-uclibc/lib/libc.a(weaks.o): linking PIC files with non-PIC files
Bad value: failed to merge target specific data of file /opt/brcm/hndtools-mipsel-uclibc/lib/libc.a(weaks.o)
/opt/brcm/hndtools-mipsel-uclibc/lib/libc.a(__uClibc_main.o): In function `__uClibc_start_main':
__uClibc_main.o(.text+0x1e0): undefined reference to `main'

It's a friendly reminder that you can't link libc functions into the kernel (Userspace is PIC while kernel is non-PIC on mips[el]).

Thank you very much~~

Is it possible that I find, or compile a non-PIC libc.a, then link it?

Realy need your help

Hello,

  I am looking for linksys-wlconf.tar.gz. Can anyone tell me where i can find the same.

Thanx vanathi

The discussion might have continued from here.