Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Without this change build will fail when using gold linker #38

Merged
merged 1 commit into from
Mar 8, 2012

Conversation

sochotnicky
Copy link

This is needed for certain optimization levels with llvm

This is needed for certain optimization levels with llvm
@rakshasa
Copy link
Owner

rakshasa commented Mar 8, 2012

Could you be more specific, what optimization levels and why does it require it? (I can guess why, but rather have it explicitly stated)

@sochotnicky
Copy link
Author

This optimization is called LTO, implemented currently in GCC[1] as well as LLVM[2]. LLVM starts to use LTO when -O4 is used (equivalent to "-O3 -oflto").

Some more information can be found on LLVM web[3]

[1] http://gcc.gnu.org/wiki/LinkTimeOptimization
[2] http://llvm.org/docs/LinkTimeOptimization.html
[3] http://llvm.org/docs/GoldPlugin.html

@rakshasa
Copy link
Owner

rakshasa commented Mar 8, 2012

Ok, I'll test it out once in a couple of days.

@jlec
Copy link
Contributor

jlec commented Mar 8, 2012

The original patch was initiated by me.
I am using the ld.gold linker instead of the ld.bfd. As gold as a stronger detection of underlinking problems, it needs this patch. Otherwise you get this error:

libtool: link: x86_64-pc-linux-gnu-g++ -O2 -pipe -ftracer -march=corei7-avx -mtune=corei7-avx -mcx16 -msahf -mno-movbe -maes -mpclmul -mpopcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-tbm -mavx -msse4.2 -msse4.1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192 -frecord-gcc-switches -g -Wenum-compare -DNDEBUG -I/usr/include/sigc++-2.0 -I/usr/lib64/sigc++-2.0/include -Wl,-O1 -Wl,--as-needed -Wl,-O1 -Wl,--hash-style=gnu -Wl,--sort-common -o rtorrent main.o libsub_root.a ui/libsub_ui.a core/libsub_core.a display/libsub_display.a input/libsub_input.a rpc/libsub_rpc.a utils/libsub_utils.a -lncursesw -lcurl /usr/lib64/libtorrent.so -lcrypto -lsigc-2.0
thread_base.cc:131: error: undefined reference to 'pthread_create'
thread_base.cc:208: error: undefined reference to 'pthread_kill'
thread_base.cc:200: error: undefined reference to 'pthread_kill'
collect2: ld returned 1 exit status

rakshasa added a commit that referenced this pull request Mar 8, 2012
Without this change build will fail when using gold linker
@rakshasa rakshasa merged commit 79e9990 into rakshasa:master Mar 8, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants