如何设置gcc 4.3默认规格文件? [英] How to set gcc 4.3 default specs file?

查看:150
本文介绍了如何设置gcc 4.3默认规格文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用gcc版本4.3.2时,我将看到如何使用以下命令生成规范:

When using gcc version 4.3.2, I see how to generate specs using:

$ /usr/local/gcc-4.3.2/bin/gcc -v
Using built-in specs

到与libgcc相同的目录:

Now changing to the same directory as libgcc:

cd /usr/local/gcc-4.3.2/lib/gcc/x86_64-unknown-linux-gnu/4.3.2
/usr/local/gcc-4.3.2/bin/gcc -dumpspecs > specs

我有一个填充的规范文件,我可以修改。但是,一旦完成,我仍然看到:

I have a populated specs file that I can modify. However, once that is done I still see that:

$ /usr/local/gcc-4.3.2/bin/gcc -v
Using built-in specs

如何告诉gcc使用该specs文件默认情况下,而不是强制我通过 -specs 参数每次编译?我想要匹配另一个系统,我得到以下:

How do I tell gcc to use that specs file by default rather than forcing me to pass a -specs parameter every compile? I would like it to match another system I have where I get the following:

$ /usr/local/gcc-4.3.2/bin/gcc -v
Reading specs from /usr/local/gcc-4.3.2/lib/gcc/i686-pc-linux-gnu/4.3.2/specs</code>

正如你所看到的,两个系统之间的主要区别是现有的设置是32位我现在试图匹配在64位系统上。 Linux的版本是相同的,我编译相同版本的gcc。 (与两个系统gcc 4.3.2是第二个gcc安装,4.1.2用于编译4.3.2)

As you can see, the major difference between the two systems is that the existing setup is 32-bit and I am now trying to match that on a 64-bit system. The version of Linux is otherwise the same and I am compiling the same version of gcc. (With both systems gcc 4.3.2 is the second gcc installation, with 4.1.2 being used to compile 4.3.2)

推荐答案

正如Johannes Schaub - litb的strace建议暗示的那样,这是编译器查找文件的问题。事实证明,非工作安装在.bashrc中设置了一个环境变量,导致了混乱。

As hinted at by the strace suggestion by Johannes Schaub - litb, it was a problem with where the compiler was looking for the file. As it turns out, the non-working installation had an environment variable set in the .bashrc that was causing the confusion.

specs文件的正确位置确实是同样的目录,libgcc是在。只是确定你在看这里。

The correct location for the specs file is indeed the same directory that libgcc is in. Just be sure you're looking there.

这篇关于如何设置gcc 4.3默认规格文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆