LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 842|回复: 8

Glibc問題請教.

[复制链接]
发表于 2005-4-13 11:07:10 | 显示全部楼层 |阅读模式
如何在redhat9(glibc-2.3.2)上編譯出合glibc-2.2.0使用的程序呢? 如rfinput. thx
发表于 2005-4-13 11:16:17 | 显示全部楼层
编译器的词法分析和语法分析在gcc 3.3以前都差不多吧。(恨死gcc 3.4了,我以前用的程序,大部分在3.4下都编不过 T_T)
glibc里的库文件的接口可能稍稍有些变化。自己看着把软件的源代码改改呗。我现在就经常做这种事。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-4-13 11:29:30 | 显示全部楼层
謝謝你先.
但現在的問題是有一舊機器, 它是運行glibc-2.2.0 相等於redhat7.3, 但想在不安裝redhat7.3下的情況, 能不能在redhat9上編譯出redhat7.3能運行的程序呢.
回复 支持 反对

使用道具 举报

发表于 2005-4-13 11:53:04 | 显示全部楼层
你的RH7.3和RH9上的CPU都是x86的吗?
如果是的,无论gcc2.3还是2.2编出来的对于相同CPU架构程序,都可以在它们上面跑。
关键是source在编译的时候会用到一些库文件,运行时也一样。
你要确保RH7.3上也有这个软件运行时需要用到的库文件。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-4-13 12:02:37 | 显示全部楼层
但我試過了, 在redhat9上編譯後放到此機器上, 但當運行時就出現 /lib/libc.so.6 (Glibc2.3) 錯誤, 機器是運行 glibc-2.2.0, 請問有沒有參數在編譯時向下glibc相容的呢.
再謝謝.
回复 支持 反对

使用道具 举报

发表于 2005-4-13 14:15:01 | 显示全部楼层
Sorry, but I'm pretty confused.
If you need to run your gcc-2.3.x built program in a glibc-2.2 environment, what you need is to backport some gcc-2.3.x feature to glibc-2.2. this is not "向下相容", it's 向"shang"相容.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-4-13 14:45:36 | 显示全部楼层
Mybe I make some confused.
I have a machine that running an embedded system and it is running glibc-2.2.0.
Now I need to build a new software for this machine, so in the right way, I need to install a new linux system with glibc-2.2.0 (host system) and then built the software on this system that port the software into that machine.
But now I want to ask, do I have another way or the build that software on different glibc version linux? such as glibc-2.3.0.
Thanks.
回复 支持 反对

使用道具 举报

发表于 2005-4-13 17:42:04 | 显示全部楼层
这样啊。。我不知道gcc有没有这种选项。或者你可以试试在编译连接时使用静态库?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-4-14 11:19:34 | 显示全部楼层
Dear echofrompat,
thanks for your help and your comment.
thanks.
回复 支持 反对

使用道具 举报

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

本版积分规则

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