su - dbra
su root
cd /dbra/app/softs/ruby-1.8.6-p114/ext/openssl
rm -rf *.o,openssl.so,Makefile
ruby extconf.rb --with-openssl-dir=/dbra/app/lib/openssl
make
make install
ossl_asn1.c:727: 警告:传递参数 1 (属于 ‘ASN1_get_object’)时在不兼容的指针类型间转换
gcc -I. -I. -I/dbra/app/lib/ruby/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/dbra/app/lib/openssl/include -fPIC -g -O2 -c ossl_x509cert.c
gcc -I. -I. -I/dbra/app/lib/ruby/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/dbra/app/lib/openssl/include -fPIC -g -O2 -c ossl_x509req.c
gcc -I. -I. -I/dbra/app/lib/ruby/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/dbra/app/lib/openssl/include -fPIC -g -O2 -c ossl_pkey_rsa.c
gcc -I. -I. -I/dbra/app/lib/ruby/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/dbra/app/lib/openssl/include -fPIC -g -O2 -c ossl_pkey_dsa.c
ossl_pkey_dsa.c: In function ‘ossl_dsa_initialize’:
ossl_pkey_dsa.c:141: 警告:传递参数 1 (属于 ‘PEM_ASN1_read_bio’)时在不兼容的指针类型间转换
ossl_pkey_dsa.c:141: 警告:传递参数 4 (属于 ‘PEM_ASN1_read_bio’)时在不兼容的指针类型间转换
ossl_pkey_dsa.c: In function ‘ossl_dsa_to_public_key’:
ossl_pkey_dsa.c:313: 警告:传递参数 2 (属于 ‘ASN1_dup’)时在不兼容的指针类型间转换
gcc -I. -I. -I/dbra/app/lib/ruby/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/dbra/app/lib/openssl/include -fPIC -g -O2 -c ossl_hmac.c
gcc -shared -o openssl.so ossl_engine.o ossl_bio.o ossl_config.o ossl_x509revoked.o ossl_bn.o ossl_cipher.o ossl_x509.o ossl_pkcs7.o ossl_x509ext.o ossl_rand.o ossl.o ossl_pkey_dh.o openssl_missing.o ossl_ssl.o ossl_x509attr.o ossl_x509name.o ossl_digest.o ossl_x509store.o ossl_pkcs12.o ossl_ns_spki.o ossl_x509crl.o ossl_ocsp.o ossl_pkey.o ossl_asn1.o ossl_x509cert.o ossl_x509req.o ossl_pkey_rsa.o ossl_pkey_dsa.o ossl_hmac.o -L'.' -L'/dbra/app/lib/ruby/lib' -Wl,-R'/dbra/app/lib/ruby/lib' -L'/dbra/app/lib/openssl/lib' -Wl,-R'/dbra/app/lib/openssl/lib' -L. -rdynamic -Wl,-export-dynamic -lssl -lcrypto -ldl -lcrypt -lm -lc
/usr/bin/ld: /dbra/app/lib/openssl/lib/libssl.a(s2_meth.o): relocation R_X86_64_32 [b]against `a local symbol' can not be used when making a shared object; recompile with -fPIC [/b]
/dbra/app/lib/openssl/lib/libssl.a: could not read symbols: Bad value
collect2: ld 返回 1
make: *** [openssl.so] 错误 1
解决办法:重新编译openssl
引用
./config -fPIC --prefix=/dbra/app/lib/openssl enable-shared
如果还不行就
make clean
./config -fPIC --prefix=/usr enable-shared
安装在/usr目录下就省去了链接。
su root
cd /dbra/app/softs/ruby-1.8.6-p114/ext/openssl
rm -rf *.o,openssl.so,Makefile
ruby extconf.rb --with-openssl-dir=/dbra/app/lib/openssl
make
make install
ossl_asn1.c:727: 警告:传递参数 1 (属于 ‘ASN1_get_object’)时在不兼容的指针类型间转换
gcc -I. -I. -I/dbra/app/lib/ruby/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/dbra/app/lib/openssl/include -fPIC -g -O2 -c ossl_x509cert.c
gcc -I. -I. -I/dbra/app/lib/ruby/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/dbra/app/lib/openssl/include -fPIC -g -O2 -c ossl_x509req.c
gcc -I. -I. -I/dbra/app/lib/ruby/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/dbra/app/lib/openssl/include -fPIC -g -O2 -c ossl_pkey_rsa.c
gcc -I. -I. -I/dbra/app/lib/ruby/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/dbra/app/lib/openssl/include -fPIC -g -O2 -c ossl_pkey_dsa.c
ossl_pkey_dsa.c: In function ‘ossl_dsa_initialize’:
ossl_pkey_dsa.c:141: 警告:传递参数 1 (属于 ‘PEM_ASN1_read_bio’)时在不兼容的指针类型间转换
ossl_pkey_dsa.c:141: 警告:传递参数 4 (属于 ‘PEM_ASN1_read_bio’)时在不兼容的指针类型间转换
ossl_pkey_dsa.c: In function ‘ossl_dsa_to_public_key’:
ossl_pkey_dsa.c:313: 警告:传递参数 2 (属于 ‘ASN1_dup’)时在不兼容的指针类型间转换
gcc -I. -I. -I/dbra/app/lib/ruby/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/dbra/app/lib/openssl/include -fPIC -g -O2 -c ossl_hmac.c
gcc -shared -o openssl.so ossl_engine.o ossl_bio.o ossl_config.o ossl_x509revoked.o ossl_bn.o ossl_cipher.o ossl_x509.o ossl_pkcs7.o ossl_x509ext.o ossl_rand.o ossl.o ossl_pkey_dh.o openssl_missing.o ossl_ssl.o ossl_x509attr.o ossl_x509name.o ossl_digest.o ossl_x509store.o ossl_pkcs12.o ossl_ns_spki.o ossl_x509crl.o ossl_ocsp.o ossl_pkey.o ossl_asn1.o ossl_x509cert.o ossl_x509req.o ossl_pkey_rsa.o ossl_pkey_dsa.o ossl_hmac.o -L'.' -L'/dbra/app/lib/ruby/lib' -Wl,-R'/dbra/app/lib/ruby/lib' -L'/dbra/app/lib/openssl/lib' -Wl,-R'/dbra/app/lib/openssl/lib' -L. -rdynamic -Wl,-export-dynamic -lssl -lcrypto -ldl -lcrypt -lm -lc
/usr/bin/ld: /dbra/app/lib/openssl/lib/libssl.a(s2_meth.o): relocation R_X86_64_32 [b]against `a local symbol' can not be used when making a shared object; recompile with -fPIC [/b]
/dbra/app/lib/openssl/lib/libssl.a: could not read symbols: Bad value
collect2: ld 返回 1
make: *** [openssl.so] 错误 1
解决办法:重新编译openssl
引用
./config -fPIC --prefix=/dbra/app/lib/openssl enable-shared
如果还不行就
make clean
./config -fPIC --prefix=/usr enable-shared
安装在/usr目录下就省去了链接。