安装错误 Tengine1.5.0 MAC OS X

leon_rock 发布于 2013/08/13 01:05
阅读 3K+
收藏 0

@shudu 你好,想跟你请教个问题:

 "_d2i_SSL_SESSION", referenced from:
      _ngx_ssl_get_cached_session in ngx_event_openssl.o
  "_d2i_X509_bio", referenced from:
      _ngx_ssl_certificate in ngx_event_openssl.o
  "_i2a_ASN1_INTEGER", referenced from:
      _ngx_ssl_get_serial_number in ngx_event_openssl.o
  "_i2d_SSL_SESSION", referenced from:
      _ngx_ssl_get_session_id in ngx_event_openssl.o
      _ngx_ssl_new_session in ngx_event_openssl.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[1]: *** [objs/nginx] Error 1
make: *** [build] Error 2

加载中
1
xiaochen_w
xiaochen_w

对于mac os x - x86_64 系统,提供另外一个办法(如果export KERNEL_BITS=64不生效的话)

进入tengine目录
$ ./configure

手动修改 objs/Makefile: 
./config --prefix=/Users/xxx/Downloads/openssl-1.0.1e/.openssl no-shared  no-threads
改成
./Configure darwin64-x86_64-cc --prefix=/Users/xxx/Downloads/openssl-1.0.1e/.openssl no-shared  no-threads

$ make

---
(@
eyelee 已用这种方法编译通过)不过有点hack,暂时先这样,后续要再想办法跟进修改

0
shudu
shudu

Hi,请把你的安装步骤描述一下?谢谢!

leon_rock
leon_rock
pcre已经安装上去了,去掉openssl就没有问题。 ./configure --prefix=/usr/locale/tengine --with-openssl=/Users/yinjun622/Desktop/openssl-1.0.1e --with-pcre=/Users/yinjun622/Desktop/pcre-8.33 运行没有问题 make 运行报错
0
yaoweibin
yaoweibin
请问你编译时的configure选项是什么样的?
0
xiaochen_w
xiaochen_w

nginx-1.5.3,使用如下配置参数也会报类似错误:

./configure --with-http_ssl_module --with-openssl=~/Downloads/openssl-1.0.1e

错误信息:

......

  "_d2i_OCSP_RESPONSE", referenced from:
      _ngx_ssl_stapling in ngx_event_openssl_stapling.o
      _ngx_ssl_stapling_ocsp_handler in ngx_event_openssl_stapling.o
  "_d2i_SSL_SESSION", referenced from:
      _ngx_ssl_get_cached_session in ngx_event_openssl.o
  "_i2a_ASN1_INTEGER", referenced from:
      _ngx_ssl_get_serial_number in ngx_event_openssl.o
  "_i2d_OCSP_REQUEST", referenced from:
      _ngx_ssl_certificate_status_callback in ngx_event_openssl_stapling.o
  "_i2d_OCSP_RESPONSE", referenced from:
      _ngx_ssl_stapling in ngx_event_openssl_stapling.o
  "_i2d_SSL_SESSION", referenced from:
      _ngx_ssl_new_session in ngx_event_openssl.o
      _ngx_ssl_get_session_id in ngx_event_openssl.o
  "_sk_num", referenced from:
      _ngx_ssl_stapling in ngx_event_openssl_stapling.o
  "_sk_value", referenced from:
      _ngx_ssl_stapling in ngx_event_openssl_stapling.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [objs/nginx] Error 1
make: *** [build] Error 2

uname -a输出信息是 Darwin tomoyos-MacBook-Pro.local 12.4.0 Darwin Kernel Version 12.4.0: Wed May  1 17:57:12 PDT 2013; root:xnu-2050.24.15~1/RELEASE_X86_64 x86_64

0
mickelfeng
mickelfeng
缺少openssl库,路径弄对没
0
xiaochen_w
xiaochen_w

@eyelee  你可以试试下面的方法: 

$ export KERNEL_BITS=64  

$  ./configure --prefix=/usr/locale/tengine --with-openssl=/Users/yinjun622/Desktop/openssl-1.0.1e --with-pcre=/Users/yinjun622/Desktop/pcre-8.33

$ make

这个问题应该是 openssl/config脚本猜对你的系统是64位,但是 会根据$KERNEL_BITS来判断是否开启x86_64编译,默认 是不开启的(很奇怪的设置,虽然会给你5秒时间停止编译并手动开启),所以你生成的openssl库文件是32位的,最后静态链接到tengine/nginx会出错。目前看来没有很好的方法把x86_64的参数传到openssl配置文件中 (openssl/config 猜测os架构,设置编译的参数是32位还是64位,默认是32位,然后调用openssl/Configure生成Makefile)

xiaochen_w
xiaochen_w
你在 openssl目录下直接 ./config试试看最后输出的信息是什么 最后一行,另外uname -a输出信息也给一下看看
leon_rock
leon_rock
export KERNEL_BITS=64 貌似没什么作用,还是一样的错误~~
0
leon_rock
leon_rock
"_X509_get_issuer_name", referenced from:
      _ngx_ssl_get_issuer_dn in ngx_event_openssl.o
  "_X509_get_pubkey", referenced from:
      _ngx_ssl_certificate in ngx_event_openssl.o
  "_X509_get_serialNumber", referenced from:
      _ngx_ssl_get_serial_number in ngx_event_openssl.o
  "_X509_get_subject_name", referenced from:
      _ngx_ssl_get_subject_dn in ngx_event_openssl.o
  "_X509_verify_cert_error_string", referenced from:
      _ngx_http_process_request in ngx_http_request.o
  "_d2i_SSL_SESSION", referenced from:
      _ngx_ssl_get_cached_session in ngx_event_openssl.o
  "_d2i_X509_bio", referenced from:
      _ngx_ssl_certificate in ngx_event_openssl.o
  "_i2a_ASN1_INTEGER", referenced from:
      _ngx_ssl_get_serial_number in ngx_event_openssl.o
  "_i2d_SSL_SESSION", referenced from:
      _ngx_ssl_get_session_id in ngx_event_openssl.o
      _ngx_ssl_new_session in ngx_event_openssl.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[1]: *** [objs/nginx] Error 1
make: *** [build] Error 2
0
leon_rock
leon_rock

@xiaochen_w   ./config输出信息

Operating system: i686-apple-darwinDarwin Kernel Version 12.4.0: Wed May 1 17:57:12 PDT 2013; root:xnu-2050.24.15~1/RELEASE_X86_64
WARNING! If you wish to build 64-bit library, then you have to
         invoke './Configure darwin64-x86_64-cc' *manually*.
         You have about 5 seconds to press Ctrl-C to abort.
Configuring for darwin-i386-cc
Configuring for darwin-i386-cc
    no-ec_nistp_64_gcc_128 [default]  OPENSSL_NO_EC_NISTP_64_GCC_128 (skip dir)
    no-gmp          [default]  OPENSSL_NO_GMP (skip dir)
    no-jpake        [experimental] OPENSSL_NO_JPAKE (skip dir)
    no-krb5         [krb5-flavor not specified] OPENSSL_NO_KRB5
    no-md2          [default]  OPENSSL_NO_MD2 (skip dir)
    no-rc5          [default]  OPENSSL_NO_RC5 (skip dir)
    no-rfc3779      [default]  OPENSSL_NO_RFC3779 (skip dir)
    no-sctp         [default]  OPENSSL_NO_SCTP (skip dir)
    no-shared       [default] 
    no-store        [experimental] OPENSSL_NO_STORE (skip dir)
    no-zlib         [default] 
    no-zlib-dynamic [default] 
IsMK1MF=0
CC            =cc
CFLAG         =-DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -arch i386 -O3 -fomit-frame-pointer -DL_ENDIAN -DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DRMD160_ASM -DAES_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM
EX_LIBS       =
CPUID_OBJ     =x86cpuid.o
BN_ASM        =bn-586.o co-586.o x86-mont.o x86-gf2m.o
DES_ENC       =des-586.o crypt586.o
AES_ENC       =aes-586.o vpaes-x86.o aesni-x86.o
BF_ENC        =bf-586.o
CAST_ENC      =c_enc.o
RC4_ENC       =rc4-586.o
RC5_ENC       =rc5-586.o
MD5_OBJ_ASM   =md5-586.o
SHA1_OBJ_ASM  =sha1-586.o sha256-586.o sha512-586.o
RMD160_OBJ_ASM=rmd-586.o
CMLL_ENC      =cmll-x86.o
MODES_OBJ     =ghash-x86.o
ENGINES_OBJ   =
PROCESSOR     =
RANLIB        =/usr/bin/ranlib
ARFLAGS       =
PERL          =/usr/bin/perl
THIRTY_TWO_BIT mode
DES_UNROLL used
BN_LLONG mode
RC4_CHUNK is unsigned long
BF_PTR used
e_os2.h => include/openssl/e_os2.h
making links in crypto...
crypto.h => ../include/openssl/crypto.h
opensslv.h => ../include/openssl/opensslv.h
opensslconf.h => ../include/openssl/opensslconf.h
ebcdic.h => ../include/openssl/ebcdic.h
symhacks.h => ../include/openssl/symhacks.h
ossl_typ.h => ../include/openssl/ossl_typ.h
making links in crypto/objects...
objects.h => ../../include/openssl/objects.h
obj_mac.h => ../../include/openssl/obj_mac.h
making links in crypto/md4...
md4.h => ../../include/openssl/md4.h
md4test.c => ../../test/md4test.c
md4.c => ../../apps/md4.c
making links in crypto/md5...
md5.h => ../../include/openssl/md5.h
md5test.c => ../../test/md5test.c
making links in crypto/sha...
sha.h => ../../include/openssl/sha.h
shatest.c => ../../test/shatest.c
sha1test.c => ../../test/sha1test.c
sha256t.c => ../../test/sha256t.c
sha512t.c => ../../test/sha512t.c
making links in crypto/mdc2...
mdc2.h => ../../include/openssl/mdc2.h
mdc2test.c => ../../test/mdc2test.c
making links in crypto/hmac...
hmac.h => ../../include/openssl/hmac.h
hmactest.c => ../../test/hmactest.c
making links in crypto/ripemd...
ripemd.h => ../../include/openssl/ripemd.h
rmdtest.c => ../../test/rmdtest.c
making links in crypto/whrlpool...
whrlpool.h => ../../include/openssl/whrlpool.h
wp_test.c => ../../test/wp_test.c
making links in crypto/des...
des.h => ../../include/openssl/des.h
des_old.h => ../../include/openssl/des_old.h
destest.c => ../../test/destest.c
making links in crypto/aes...
aes.h => ../../include/openssl/aes.h
making links in crypto/rc2...
rc2.h => ../../include/openssl/rc2.h
rc2test.c => ../../test/rc2test.c
making links in crypto/rc4...
rc4.h => ../../include/openssl/rc4.h
rc4test.c => ../../test/rc4test.c
making links in crypto/idea...
idea.h => ../../include/openssl/idea.h
ideatest.c => ../../test/ideatest.c
making links in crypto/bf...
blowfish.h => ../../include/openssl/blowfish.h
bftest.c => ../../test/bftest.c
making links in crypto/cast...
cast.h => ../../include/openssl/cast.h
casttest.c => ../../test/casttest.c
making links in crypto/camellia...
camellia.h => ../../include/openssl/camellia.h
making links in crypto/seed...
seed.h => ../../include/openssl/seed.h
making links in crypto/modes...
modes.h => ../../include/openssl/modes.h
making links in crypto/bn...
bn.h => ../../include/openssl/bn.h
bntest.c => ../../test/bntest.c
exptest.c => ../../test/exptest.c
making links in crypto/ec...
ec.h => ../../include/openssl/ec.h
ectest.c => ../../test/ectest.c
making links in crypto/rsa...
rsa.h => ../../include/openssl/rsa.h
rsa_test.c => ../../test/rsa_test.c
making links in crypto/dsa...
dsa.h => ../../include/openssl/dsa.h
dsatest.c => ../../test/dsatest.c
making links in crypto/ecdsa...
ecdsa.h => ../../include/openssl/ecdsa.h
ecdsatest.c => ../../test/ecdsatest.c
making links in crypto/dh...
dh.h => ../../include/openssl/dh.h
dhtest.c => ../../test/dhtest.c
making links in crypto/ecdh...
ecdh.h => ../../include/openssl/ecdh.h
ecdhtest.c => ../../test/ecdhtest.c
making links in crypto/dso...
dso.h => ../../include/openssl/dso.h
making links in crypto/engine...
engine.h => ../../include/openssl/engine.h
enginetest.c => ../../test/enginetest.c
making links in crypto/buffer...
buffer.h => ../../include/openssl/buffer.h
making links in crypto/bio...
bio.h => ../../include/openssl/bio.h
making links in crypto/stack...
stack.h => ../../include/openssl/stack.h
safestack.h => ../../include/openssl/safestack.h
making links in crypto/lhash...
lhash.h => ../../include/openssl/lhash.h
making links in crypto/rand...
rand.h => ../../include/openssl/rand.h
randtest.c => ../../test/randtest.c
making links in crypto/err...
err.h => ../../include/openssl/err.h
making links in crypto/evp...
evp.h => ../../include/openssl/evp.h
evp_test.c => ../../test/evp_test.c
[ ! -f evptests.txt ] || cp evptests.txt ../../test
making links in crypto/asn1...
asn1.h => ../../include/openssl/asn1.h
asn1_mac.h => ../../include/openssl/asn1_mac.h
asn1t.h => ../../include/openssl/asn1t.h
making links in crypto/pem...
pem.h => ../../include/openssl/pem.h
pem2.h => ../../include/openssl/pem2.h
making links in crypto/x509...
x509.h => ../../include/openssl/x509.h
x509_vfy.h => ../../include/openssl/x509_vfy.h
making links in crypto/x509v3...
x509v3.h => ../../include/openssl/x509v3.h
making links in crypto/conf...
conf.h => ../../include/openssl/conf.h
conf_api.h => ../../include/openssl/conf_api.h
making links in crypto/txt_db...
txt_db.h => ../../include/openssl/txt_db.h
making links in crypto/pkcs7...
pkcs7.h => ../../include/openssl/pkcs7.h
making links in crypto/pkcs12...
pkcs12.h => ../../include/openssl/pkcs12.h
making links in crypto/comp...
comp.h => ../../include/openssl/comp.h
making links in crypto/ocsp...
ocsp.h => ../../include/openssl/ocsp.h
making links in crypto/ui...
ui.h => ../../include/openssl/ui.h
ui_compat.h => ../../include/openssl/ui_compat.h
making links in crypto/krb5...
krb5_asn.h => ../../include/openssl/krb5_asn.h
making links in crypto/cms...
cms.h => ../../include/openssl/cms.h
making links in crypto/pqueue...
pqueue.h => ../../include/openssl/pqueue.h
making links in crypto/ts...
ts.h => ../../include/openssl/ts.h
making links in crypto/srp...
srp.h => ../../include/openssl/srp.h
srptest.c => ../../test/srptest.c
making links in crypto/cmac...
cmac.h => ../../include/openssl/cmac.h
making links in ssl...
ssl.h => ../include/openssl/ssl.h
ssl2.h => ../include/openssl/ssl2.h
ssl3.h => ../include/openssl/ssl3.h
ssl23.h => ../include/openssl/ssl23.h
tls1.h => ../include/openssl/tls1.h
dtls1.h => ../include/openssl/dtls1.h
kssl.h => ../include/openssl/kssl.h
srtp.h => ../include/openssl/srtp.h
ssltest.c => ../test/ssltest.c
making links in engines...
making links in engines/ccgost...
make[2]: Nothing to be done for `links'.
making links in apps...
make[1]: Nothing to be done for `links'.
making links in test...
make[1]: Nothing to be done for `links'.
making links in tools...
make[1]: Nothing to be done for `links'.
generating dummy tests (if needed)...
make[1]: Nothing to be done for `generate'.

Configured for darwin-i386-cc.

xiaochen_w
xiaochen_w
最后一行是Configured for darwin-i386-cc. 如果你是x86_64系统,最后要输出 Configured for darwin64-x86_64-cc才可以的,要不编译后生成的就是 32
0
leon_rock
leon_rock

引用来自“xiaochen_w”的答案

@eyelee  你可以试试下面的方法: 

$ export KERNEL_BITS=64  

$  ./configure --prefix=/usr/locale/tengine --with-openssl=/Users/yinjun622/Desktop/openssl-1.0.1e --with-pcre=/Users/yinjun622/Desktop/pcre-8.33

$ make

这个问题应该是 openssl/config脚本猜对你的系统是64位,但是 会根据$KERNEL_BITS来判断是否开启x86_64编译,默认 是不开启的(很奇怪的设置,虽然会给你5秒时间停止编译并手动开启),所以你生成的openssl库文件是32位的,最后静态链接到tengine/nginx会出错。目前看来没有很好的方法把x86_64的参数传到openssl配置文件中 (openssl/config 猜测os架构,设置编译的参数是32位还是64位,默认是32位,然后调用openssl/Configure生成Makefile)

macbook os x x86_64环境下

$ export KERNEL_BITS=64 

$ ./configure --prefix=/usr/local/tengine --with-openssl=xxx --with-pcre=xxx

然后到 ../tengine/objs/下,打开Makefile

找到: ./config --prefix=xxx.openssl no-shared        (注释:XXX是已的openssl路径)

把该段的 ./config 改成 ./Configure darwin64-x86_64-cc 其他后面参数不变,保存

然后再make就编译通过了

感谢 @xiaochen_w 的帮助

0
leon_rock
leon_rock

引用来自“xiaochen_w”的答案

对于mac os x - x86_64 系统,提供另外一个办法(如果export KERNEL_BITS=64不生效的话)

进入tengine目录
$ ./configure

手动修改 objs/Makefile: 
./config --prefix=/Users/xxx/Downloads/openssl-1.0.1e/.openssl no-shared  no-threads
改成
./Configure darwin64-x86_64-cc --prefix=/Users/xxx/Downloads/openssl-1.0.1e/.openssl no-shared  no-threads

$ make

---
(@
eyelee 已用这种方法编译通过)不过有点hack,暂时先这样,后续要再想办法跟进修改

感谢 @xiaochen_w
返回顶部
顶部