博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
GCC compile debug: print include files and compile stage info.
阅读量:5328 次
发布时间:2019-06-14

本文共 1905 字,大约阅读时间需要 6 分钟。

Sample code:

#include 
#include
extern void foo() __attribute__((weak));int main() { if (foo) foo(); printf("this is a test\n");}

Compile command:

gcc -H -v sample.c

Compile options:

-H tells you that the right include files used.

Official document:

Print the name of each header file used, in addition to other normal

activities. Each name is indented to show how deep in the ‘#include’
stack it is. Precompiled header files are also printed, even if they
are found to be invalid; an invalid precompiled header file is printed
with ‘…x’ and a valid one with ‘…!’ .

-v (or even maybe -Wl,-v) tells you that the right libraries used.

Official document:

Print (on standard error output) the commands executed to run the

stages of compilation. Also print the version number of the compiler
driver program and of the preprocessor and the compiler proper.

Sample output:

…………………….

/usr/include/x86_64-linux-gnu/bits/waitflags.h
/usr/include/x86_64-linux-gnu/bits/waitstatus.h
/usr/include/x86_64-linux-gnu/gnu/stubs-64.h
/usr/include/x86_64-linux-gnu/gnu/stubs.h COLLECT_GCC_OPTIONS=’-o’
‘hello’ ‘-H’ ‘-v’ ‘-mtune=generic’ ‘-march=x86-64’ as -v –64 -o
/tmp/ccwD1DYA.o /tmp/cc8CU0IV.s GNU assembler version 2.24
(x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.24
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.8/:/usr/lib/gcc/x86_64-linux-gnu/4.8/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.8/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/4.8/:/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/lib/:./:/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../:/lib/:/usr/lib/
…………..

Ref:

转载于:https://www.cnblogs.com/jzdwajue/p/7161211.html

你可能感兴趣的文章
iOS8 自定义navigationbar 以及 UIBarButtonItem 边距问题
查看>>
iOS多线程编程--NSOperation(转)
查看>>
高可用Redis(四):列表,集合与有序集合
查看>>
进程线程之pid,tid
查看>>
立即执行函数
查看>>
rsync使用详解
查看>>
SVN常用命令
查看>>
bzoj3223Tyvj 1729 文艺平衡树 splay
查看>>
七夕心形demo
查看>>
Python垃圾回收机制:gc模块
查看>>
使用ifconfig命令来看网卡的IP,但是,输入命令之后,eht0里面只有 inet6 addr 而没有 inet addr...
查看>>
VsCode云端版本
查看>>
MyBatis学习--查询缓存
查看>>
Java实现快速排序
查看>>
python学习笔记--python数据类型
查看>>
Java学习总结
查看>>
一些忘记了的....
查看>>
Codeforces 448E Divisors
查看>>
linux高级技巧:rsync同步(二)
查看>>
ETL调度开发(5)——连接数据库运行数据库命令子程序
查看>>