|
|
第 16 帖 | |
|
|
我用LDFLAGS="-Wl,-O1"编译了mozilla-firefox-1.0-r2,没问题。
__________________
You naughty little...little...creep, I'm gonna kick your ass! 2.6.14-nitro2 |
|
|
|
|
|
|
|
第 17 帖 | |
|
|
LDFLAGS="-Wl,-O1"
这里 -Wl 是一个 gcc 的参数,表示“后面的参数传递给 linker”,所以应该是在 CFLAGS 而不是 LDFLAGS 里面。我觉得值得注意的几个东西是 CFLAGS 的 -DNDEBUG (会减少一些编译的代码,譬如 assert) LDFLAGS 的 -S(--strip-debug,不知道和 portage 的 strip 是不是重复了) 至于 -O 标志,不论 GCC 还是 LD 都表示会极大增加编译时间和消耗内存,所以根据 80/20 原则,我用的是 CFLAGS 的 -O ,LDFLAGS 里面没有:) 所有这些编译符号,都可以在 gcc(1) 和 ld(1) 里面找到;-DNDEBUG 宏是个 ANSI 标准,学过 C 编程的应该知道。
__________________
十里秦淮灯似火,一街评事人如潮 Do RH/FC, No Gain: JUST ENJOY IT |
|
|
|
|
|
|
|
第 18 帖 | ||
|
|
引用:
__________________
Simple life, Simple linux, Archlinux. |
||
|
|
|
||
|
|
第 19 帖 | |
|
|
Oh, really? I got this from gcc(1) manual page. So if you say it's wrong, prove it.
|
|
|
|
|
|
|
|
第 20 帖 | |
|
|
LDFLAGS is the role for sending linker flags to gcc.
And, if you add "Wl,anything_fills_here" to gcc, gcc will compille anything with that flag and hence MIGHT produce incorrect code if the source file is C program instead of C++ or without any library it links to. 此帖于 04-11-16 03:07 被 MACHINE 编辑. |
|
|
|
|
|
|
|
第 21 帖 | |
|
|
>> -Wl,option
Pass option as an option to the linker. If option contains commas, it is split into multiple options at the commas. This is what I've got. I understand this as, when calling 代码:
LDFLAGS and CFLAGS only take there effection when they've been written in Makefiles. Bare gcc itself understands neither of them. Simply try this: 代码:
1: gcc CFLAGS="-DABC" 1.c 2: gcc LDFLAGS="-DABC" 1.c 3: gcc -Wl,-DABC 1.c And run what ever you got for each time. |
|
|
|
|
|
|
|
第 22 帖 | |
|
|
我在/etc/make.conf加了LDFLAGS,为什么emerge --info看不到?
__________________
中国3G开发论坛[url]http://www.xgdev.net/bbs[/url] |
|
|
|
|
|
|
|
第 23 帖 | |
|
|
I said "... MIGHT produce ...".
|
|
|
|
|
|
|
|
第 24 帖 | |
|
|
PHP 代码:
值得注意的是 checking for gcc... gcc checking whether the C compiler (gcc -march=athlon-tbird -O3 -mmmx -m3dnow -pipe -fforce-addr -fomit-frame-pointer -funroll-loops -falign-functions=4 -maccumulate-outgoing-args -ftracer -Wl,-O1 -Wl,-z -Wl,--enable-new-dtags -Wl,--sort-common -s) works... yes checking whether the C compiler (gcc -march=athlon-tbird -O3 -mmmx -m3dnow -pipe -fforce-addr -fomit-frame-pointer -funroll-loops -falign-functions=4 -maccumulate-outgoing-args -ftracer -Wl,-O1 -Wl,-z -Wl,--enable-new-dtags -Wl,--sort-common -s) is a cross-compiler... no checking whether we are using GNU C... yes gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/include -march=athlon-tbird -O3 -mmmx -m3dnow -pipe -fforce-addr -fomit-frame-pointer -funroll-loops -falign-functions=4 -maccumulate-outgoing-args -ftracer -D_REENTRANT -Wall -DGLOBAL_CONF_FILE="\"/etc/prozilla.conf\"" -c connection.c gcc -march=athlon-tbird -O3 -mmmx -m3dnow -pipe -fforce-addr -fomit-frame-pointer -funroll-loops -falign-functions=4 -maccumulate-outgoing-args -ftracer -D_REENTRANT -Wall -DGLOBAL_CONF_FILE="\"/etc/prozilla.conf\"" -Wl,-O1 -Wl,-z -Wl,--enable-new-dtags -Wl,--sort-common -s -o proz connect.o connection.o curses.o ftp.o ftp-retr.o ftpparse.o ftpsearch.o getopt.o http-retr.o http.o init.o logfile.o main.o misc.o netrc.o ping.o resume.o debug.o url.o -L/usr/lib -lncurses -lpthread
__________________
AMD Athlon64 3200+ (Venice) ASUS nForce4 Ultra VDATA DDR400 512MB X4 ST SATA2 160GB + ST SATA 160GB (RAID0) Nvidia Geforce 6600 GT ADSL 2Mbps 此帖于 04-11-17 18:36 被 orphen 编辑. |
|
|
|
|
|
|
|
第 25 帖 | |
|
|
连接时才使用那个参数。。
__________________
sunmoon1997@localhost ~ $ emerge --info Portage 2.1_rc1-r2 (default-linux/amd64/2006.0, gcc-4.0.3, glibc-2.4-r2, 2.6.16-gentoo-r6 x86_64) ================================================================= System uname: 2.6.16-gentoo-r6 x86_64 AMD Athlon(tm) 64 Processor 3000+ Gentoo Base System version 1.12.0_pre19 Can you understand linux? Can you foresee the future of linux? |
|
|
|
|
|
|
|
第 26 帖 | |
|
|
不知有什么好处?
PHP 代码:
PHP 代码:
PS 如果添加这些“优化参数”有利无弊的话,为什么各种官方发型版没有使用,没有出现在Gentoo默认的make.conf中呢? |
|
|
|
|
|
|
|
第 27 帖 | ||
|
|
引用:
|
||
|
|
|
||
|
|
第 28 帖 | |
|
|
MACHINE:
I'm talking about where this option is taking effection, not talking about what effection it's taking on the final result, so your "might be" is being used somewhere off topic. Sunmoon: 多谢老大支持:) |
|
|
|
|
|
|
|
第 29 帖 | |
|
|
Fleta:
不会有利无弊——man page 里说了,会“显著增加链接时间“,呵呵。而且可能不是所有版本的 GCC 都支持——譬如某些平台某些版本等等。作为一个发行版,使用不保险的默认是会收获西红柿的。根据 80/20 原则,gentoo 官方自然不会把它加入默认 make.global。。。 |
|
|
|
|
|
|
|
第 30 帖 | |
|
|
哦
那我这样的CPU,如下的make.conf是不是达到了最大优化呢? 哪位达人能指点一二 PHP 代码:
PHP 代码:
![]() 此帖于 04-11-17 22:44 被 orphen 编辑. |
|
|
|
|
|