Linux下编译相关

这篇博客探讨了Linux编译过程中的一些关键概念,包括configure中的--build, --host, --target的区别,以及-Wl和-rpath链接选项的作用。同时提到了编译警告""Clock skew detected""的根源及解决方法。" 63776284,6244032,模拟与数字图像的区别与特性,"['图像处理', '数字图像', '模拟图像', '像素', '分辨率']
摘要由CSDN通过智能技术生成

1. configure中的--build, --host, --target含义.

Basically, $build* refer to the system compilation is being performed on,$host* refer to the system compiled binaries are to run on and $target* refer to the system compiled binaries will handle. As such $target* usually have a meaning a meaning for developemt tool only. So far packages that make use of $target* I know of are binutils, gcc, gdb and ksymoops (a Linux run-time error disassembler).


2. -Wl 和-rpath的作用.

     -Wl,option [`man gcc`]
           Pass option as an option to the linker.  If option contains commas, it is split into multiple options at the commas.  You can use this syntax to pass an argument
           to the option.  For example, -Wl,-Map,output.map passes -Map output.map to the linker.  When using the GNU linker, you can also get the same effect with
           -Wl,-Map=output.map.

   -rpath=dir [`man ld`]
           Add a directory to the runtime library search path.  This is used when linking an ELF executable with shared objects.  All -rpath arguments are concatenated and
           passed to the runtime linker, which uses them to locate shared objects at runtime.  The -rpath option is also used when locating shared objects which are needed
           by shared objects explicitly included in the link; see the description of the -rpath-link option.  If -rpath is not used when linking an ELF executable, the
           contents of the environment variable "LD_RUN_PATH" will be used if it is defined.

3. 编译警告: "make: warning:  Clock skew detected.  Your build may be incomplete.".

    Root-cause: 某些文件的上次修改时间不准确,可能比当前的时间更大.

    $ make clean

    $ find . -exec touch {} \;

    $ make


[src: http://www.linuxquestions.org/questions/slackware-14/explaining-build-host-target-509739/

         http://www.linuxsa.org.au/pipermail/linuxsa/1999-August/008869.html

]


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值