QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 5296|回复: 5

Openssl 编译

[复制链接]
发表于 2006-8-21 14:26:25 | 显示全部楼层 |阅读模式
各位大侠,怎样编译openssl库啊?

我从网上找到一篇文章,http://www.ucdot.org/article.pl? ... amp;amp;mode=thread
按照这篇文章打上补丁,编译出错。

文章内容如下:
Firstly,  download the patches from:

http://ftp.snapgear.org/pub/patches/openssl-0.9.7c.diff
http://ftp.snapgear.org/pub/patches/openssl-0.9.7c_linux_include.diff
http://ftp.snapgear.org/pub/patches/openssl-0.9.7c_makefile.diff


The patch is in 3 parts.

Installing openssl:

    cd lib
    tar zxvf ~/tmp/openssl-0.9.7c.tar.gz
    mv openssl-0.9.7c libssl
    cd libssl
    patch -p1 < ~/tmp/openssl.diff

The kernel needs to be patched because the way we set up our include
paths means that the openssl components in the kernel conflict with the ones in the openssl directory.

    cd linux-2.4.x/include/openssl
    patch -p0 < ~/tmp/openssl_linux_include.diff

Also you may want to use the openssl application.  This small patch
fixes the makefile in that directory.

    cd user/openssl
    patch -p0 < openssl_makefile.diff

You should be able to compile and build everything now :-)


我用make lib_only编译的结果如下:
make[4]: Leaving directory `/uClinux-dist/lib/libssl/crypto'
make[3]: Leaving directory `/uClinux-dist/lib/libssl'
+ arm-elf-gcc -nodefaultlibs -O2 -g -fomit-frame-pointer -fno-builtin -DEMBED -I/uClinux-dist/lib/uClibc/include -I/uClinux-dist -Dlinux -D__linux__ -D__uClinux__ -Dunix -I/uClinux-dist/linux-2.4.x/include -Wl,-elf2flt -s -shared -o libcrypto.so.0.9.7 -Wl,-S,-soname=libcrypto.so.0 -Wl,--whole-archive libcrypto.a -Wl,--no-whole-archive -L/uClinux-dist/lib/uClibc/lib -lc -lgcc
libcrypto.so.0.9.7.elf2flt: In function `__uClibc_start_main':
libcrypto.so.0.9.7.elf2flt(.text+0x9759c): undefined reference to `main'

collect2: ld returned 1 exit status
make[2]: *** [linux-shared] Error 1
make[2]: Leaving directory `/uClinux-dist/lib/libssl'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/uClinux-dist/lib'
make: *** [lib_only] Error 2


有人成功添加ssl库吗?
发表于 2006-8-21 22:40:31 | 显示全部楼层
貌似很常见的问题,可就是不知道怎么搞定了,
回复

使用道具 举报

发表于 2006-8-22 23:27:06 | 显示全部楼层
如果 DISABLE_SHARED_SSL=1 没有添加报的错和你的是一样的
把它添加在config.arch里面就可以了
你再试一下吧
回复

使用道具 举报

 楼主| 发表于 2006-8-23 08:43:19 | 显示全部楼层
多谢lumit-support-1。将DISABLE_SHARED_SSL=1添加到config.arch之
后,编译确实通过。

  但是根据http://www.ucdot.org/article.pl?sid=03/10/23/2249235&mode=thread所述,
这一句是可不要的,除非是不想共享的openssl库。原文是这样的:

BTW if you don't want shared openssl libs add the following to your
config.arch at the top level:

    DISABLE_SHARED_SSL=1

为什么不加这一句不行呢?
回复

使用道具 举报

发表于 2006-8-23 23:18:01 | 显示全部楼层
uClinux下用的是静态库,编译成动态库不行
ld连的也是静态库,如果是动态的链接的时候就会报错了啊
回复

使用道具 举报

 楼主| 发表于 2006-8-24 10:01:35 | 显示全部楼层
多谢lumit-support-1大侠。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-4-19 14:01 , Processed in 0.072640 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表