This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ivank
Recipients ivank
Date 2014-08-03.07:12:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1407049962.24.0.593960566551.issue22126@psf.upfronthosting.co.za>
In-reply-to
Content
Build cpython master with clang -flto results in:

[...]
ar rc libpython3.5m.a Modules/_threadmodule.o  Modules/signalmodule.o  Modules/posixmodule.o  Modules/errnomodule.o  Modules/pwdmodule.o  Modules/_sre.o  Modules/_codecsmodule.o  Modules/_weakref.o  Modules/_functoolsmodule.o  Modules/_operator.o  Modules/_collectionsmodule.o  Modules/itertoolsmodule.o  Modules/atexitmodule.o  Modules/_stat.o  Modules/_localemodule.o  Modules/_iomodule.o Modules/iobase.o Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o Modules/textio.o Modules/stringio.o  Modules/zipimport.o  Modules/faulthandler.o  Modules/_tracemalloc.o Modules/hashtable.o  Modules/symtablemodule.o  Modules/xxsubtype.o
ranlib libpython3.5m.a
clang -pthread -flto -B/usr/lib/gold-ld -flto -B/usr/lib/gold-ld -Xlinker -export-dynamic -o python Programs/python.o libpython3.5m.a -lpthread -ldl  -lutil   -lm  
clang -pthread -flto -B/usr/lib/gold-ld -flto -B/usr/lib/gold-ld -Xlinker -export-dynamic -o Programs/_testembed Programs/_testembed.o libpython3.5m.a -lpthread -ldl  -lutil   -lm  
<inline asm>:1:10: error: invalid register name
        fmove.l %fpcr,36(%rsp)
                ^~~~~
LLVM ERROR: Error parsing inline asm

clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [python] Error 1
make: *** Waiting for unfinished jobs....
<inline asm>:1:10: error: invalid register name
        fmove.l %fpcr,36(%rsp)
                ^~~~~
LLVM ERROR: Error parsing inline asm

clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Programs/_testembed] Error 1



My build script was:

#!/bin/bash

# Get clang 3.5 from
# deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty main
# deb-src http://llvm.org/apt/trusty/ llvm-toolchain-trusty main

set -e

sudo ln -sf /usr/lib/llvm-3.5/lib/LLVMgold.so /usr/lib/LLVMgold.so
sudo mkdir -p /usr/lib/bfd-plugins
sudo ln -sf /usr/lib/llvm-3.5/lib/LLVMgold.so /usr/lib/bfd-plugins/LLVMgold.so
grep -Fxq /usr/lib/llvm-3.5/lib /etc/ld.so.conf || (echo "/usr/lib/llvm-3.5/lib should be in /etc/ld.so.conf" && false)
sudo ldconfig

export CC=clang
export CXX=clang++
export CFLAGS="-O3 -flto -B/usr/lib/gold-ld -fomit-frame-pointer"
export CXXFLAGS="-O3 -flto -B/usr/lib/gold-ld -fomit-frame-pointer"
export LDFLAGS="-flto -B/usr/lib/gold-ld" 
make clean || echo "Can't make clean"
./configure --prefix=/opt/leakless
make -j17


It works fine without the -flto/gold-ld options.
History
Date User Action Args
2014-08-03 07:12:42ivanksetrecipients: + ivank
2014-08-03 07:12:42ivanksetmessageid: <1407049962.24.0.593960566551.issue22126@psf.upfronthosting.co.za>
2014-08-03 07:12:42ivanklinkissue22126 messages
2014-08-03 07:12:41ivankcreate