Open Quuxplusone opened 13 years ago
Bugzilla Link | PR9674 |
Status | NEW |
Importance | P normal |
Reported by | Ryuta Suzuki (oroppas@gmail.com) |
Reported on | 2011-04-10 23:10:22 -0700 |
Last modified on | 2011-11-20 05:22:17 -0800 |
Version | trunk |
Hardware | PC Linux |
CC | dane@dbsgeo.com, geek4civic@gmail.com, llvm-bugs@lists.llvm.org, rafael@espindo.la |
Fixed by commit(s) | |
Attachments | |
Blocks | |
Blocked by | |
See also |
ld_plugin_get_view is more recent. Can you use a newer binutils?
The latest release of binutils is 2.21, which I have.
I'd imagined I have to use the latest snapshot of bintuils.
(In reply to comment #1)
> ld_plugin_get_view is more recent. Can you use a newer binutils?
I also just hit this on latest ubuntu 11.04 which provides binutils 2.21.0, the
latest release.
I hit this trying to build clang with LTO like:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install binutils-gold subversion build-essential gcc-multilib
mkdir -p $HOME/deb
cd $HOME/deb
apt-get source binutils
cd ~/src
svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
cd llvm/tools
svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
cd ..
./configure \
--prefix=/opt/llvm \
--enable-optimized \
--with-binutils-include=$HOME/deb/binutils-2.21.0.20110327/include
I get:
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/mapnik/src/llvm/tools/lto'
make[2]: Entering directory `/home/mapnik/src/llvm/tools/gold'
llvm[2]: Compiling gold-plugin.cpp for Release+Asserts build (PIC)
gold-plugin.cpp:56:3: error: ‘ld_plugin_get_view’ does not name a type
gold-plugin.cpp: In function ‘ld_plugin_status onload(ld_plugin_tv*)’:
gold-plugin.cpp:212:12: error: ‘LDPT_GET_VIEW’ was not declared in this scope
gold-plugin.cpp:213:9: error: ‘get_view’ was not declared in this scope
gold-plugin.cpp:213:29: error: ‘union ld_plugin_tv::<anonymous>’ has no member
named ‘tv_get_view’
gold-plugin.cpp: In function ‘ld_plugin_status claim_file_hook(const
ld_plugin_input_file*, int*)’:
gold-plugin.cpp:243:7: error: ‘get_view’ was not declared in this scope
/bin/rm: cannot remove `/home/mapnik/src/llvm/tools/gold/Release+Asserts/gold-
plugin.d.tmp': No such file or directory
make[2]: *** [/home/mapnik/src/llvm/tools/gold/Release+Asserts/gold-plugin.o]
Error 1
make[2]: Leaving directory `/home/mapnik/src/llvm/tools/gold'
make[1]: *** [all] Error 1
make[1]: Leaving directory `/home/mapnik/src/llvm/tools'
make: *** [all] Error 1
This is with clang/llvm trunk from today, r141176
It was added in
http://sourceware.org/git/?p=binutils.git;a=commitdiff;h=f085a571da99e2bae0fc477cf0077d17cdb8a1d8
You need a binutils that includes that.
so, it is not intended for latest llvm to support the latest release of binutils?
There is a runtime check for older versions of binutils, a compile time check is probably OK too if you want to add it.
I must have missed the runtime check somehow. Anyway, thanks, now that I
understand I'm good. I went an compiled binutils from cvs, which was tricky but
I think I've got things working now. For anyone else interested I did:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install subversion build-essential gcc-multilib
cd ~/src
# http://llvm.org/docs/GoldPlugin.html
sudo apt-get install cvs texinfo bison flex
cvs -z 9 -d :pserver:anoncvs@sourceware.org:/cvs/src login
{enter "anoncvs" as the password}
cvs -z 9 -d :pserver:anoncvs@sourceware.org:/cvs/src co binutils
mv src/ binutils
cd binutils
# edit this file:
vim binutils/ar.c
# by hardcoding
bfd_plugin_set_plugin ("/opt/llvm/lib/LLVMgold.so");
# so that ar always uses the llvmgold pluggin. I found this was needed because
supplying:
export AR="ar --plugin /opt/llvm/lib/LLVMgold.so"
# would also fail because the plugin option needs to come after the argument,
which is supplied by a given programs build scripts
# grep for bfd_plugin_set_plugin
# change:
bfd_plugin_set_plugin (optarg);
# to:
bfd_plugin_set_plugin ("/opt/llvm/lib/LLVMgold.so");
./configure --prefix=/opt/binutils --enable-gold --enable-plugins
make
make install
mv /opt/binutils/bin/ld /opt/binutils/bin/ld-old
cp /opt/binutils/bin/ld.gold /opt/binutils/bin/ld
export CFLAGS="-O4 -I$PREFIX/include -fPIC"
export CXXFLAGS="-O4 -I$PREFIX/include -fPIC"
export LDFLAGS="-O4 -L$PREFIX/lib"
export CC="clang -use-gold-plugin"
export CXX="clang++ -use-gold-plugin"
export
LD_LIBRARY_PATH=/opt/mapnik/lib:/opt/llvm/lib:/opt/binutils/lib:$PREFIX/lib:$LD_LIBRARY_PATH
# this does not work:
# we patch ar to send --plugins option in all cases
#export AR="ar -rc --plugin /opt/llvm/lib/LLVMgold.so"
export NM="nm --plugin /opt/llvm/lib/LLVMgold.so"
export RANLIB=/bin/true