6

binutils(含as、ld等)静态编译

 3 years ago
source link: http://abcdxyzk.github.io/blog/2013/10/31/compiler-binutil-static/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

binutils(含as、ld等)静态编译

2013-10-31 14:47:00

binutils下载 http://ftp.gnu.org/gnu/binutils/

binutils静态编译:

./configure
make LDFLAGS=-all-static

他们链接的时候是通过 ./libtool 完成的,在libtool里有一行提示(./libtool –help没有显示这个提示):

-all-static       do not do any dynamic linking at all

所以就是要libtool增加-all-static参数

比较通用的静态编译方法

./configure 后加   CFLAGS=-static --enable-static LDFLAGS=-static --disable-shared
或
./configure 后加   CFLAGS=-static LDFLAGS=-static
或
make CFLAGS=-static LDFLAGS=-static

Posted by kk

2013-10-31 14:47:00compiler, make

« systemtap article 编译期间求值 »


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK