从网上下载rtl819x-SDK-v3.2.3.tar.gz
解压后在目录rtl819x-SDK-v3.2.3/rtl819x/users下的Makefile中110行开始
CC = $(CROSS_COMPILE)gcc
CXX = $(CROSS_COMPILE)g++
LD = $(CROSS_COMPILE)gcc
AR = $(CROSS_COMPILE)ar
RANLIB = $(CROSS_COMPILE)ranlib
STRIP = $(CROSS_COMPILE)strip
SSTRIP = $(CROSS_COMPILE)sstrip
其设置LD变量时为LD = $(CROSS_COMPILE)gcc
产生的结果是希望增加一些使用configure的开源代码时
在configure阶段
...
checking whether the rsdk-linux-gcc linker (rsdk-linux-gcc) supports shared libraries... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... unsupported
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... no
checking whether to build shared libraries... no
...
检查链接器的时候检查的是rsdk-linux-gcc
结果是其不支持动态库
这样开源代码编译就得不到共享库了
直接改LD变量其他程序链接会报错
解决办法是在新增开源代码configure前加上LD="rsdk-linux-ld"
即
LD="rsdk-linux-ld" ./configure --host=mips-linux
工具链下软链接rsdk-linux-ld即指向mips-linux-ld