Closed. This question is off-topic。它当前不接受答案。
                            
                        
                    
                
                            
                                
                
                        
                            
                        
                    
                        
                            想改善这个问题吗? Update the question,所以它是on-topic,用于堆栈溢出。
                        
                        5年前关闭。
                                                                                            
                
        
对armv5l执行openssl的交叉编译版本会导致以下错误消息。
如何解决这个问题:

Can't modify /usr/local/ssl/lib/libcrypto.so.1.0.0's text section. Use GCC option -fPIC for shared objects, please.


细节:

我使用了以下交叉编译器:
http://uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-armv5l.tar.bz2

我使用以下命令将openssl用于armv5l:

export PATH=/home/toff/workspaces/armv5l/cross-compiler-armv5l/bin:$PATH
export cross=armv5l-
export CFLAGS=-fPIC
./Configure linux-generic32 -DL_ENDIAN --openssldir=/lib -fPIC

make CC="${cross}gcc" AR="${cross}ar r" RANLIB="${cross}ranlib" LD="${cross}ld" MAKEDEFPROG="${cross}gcc" PROCESSOR=ARM

make CC="${cross}gcc" AR="${cross}ar r" RANLIB="${cross}ranlib" LD="${cross}ld" MAKEDEFPROG="${cross}gcc" PROCESSOR=ARM INSTALL_PREFIX=/tmp/package-root install


如果我查找Makefile,似乎配置了-fPIC:

CFLAG= -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DL_ENDIAN -fPIC -DTERMIO -O3 -fomit-frame-pointer -Wall

最佳答案

CFLAGCFLAGS不同。应该是CFLAGS

而且,一旦修复,无论您从shell中export是什么,CFLAGS都会在makefile中被覆盖。

09-25 20:22