-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
pkgsMusl.python*: disable LTO #131951
pkgsMusl.python*: disable LTO #131951
Conversation
@ofborg build pkgsMusl.python38 pkgsMusl.python3 |
For static variant this might not be needed ( |
, enableLTO ? stdenv.is64bit && stdenv.isLinux | ||
# enabling LTO with musl fails with a linker error although it should be possible | ||
# as alpine is doing it: https://github.com/alpinelinux/aports/blob/a8ccb04668c7729e0f0db6c6ff5f25d7519e779b/main/python3/APKBUILD#L82 | ||
, enableLTO ? stdenv.is64bit && stdenv.isLinux && stdenv.hostPlatform.libc == "glibc" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this exclude clang by accident?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, what would clang have to do with that?
33d0b21
to
befcc56
Compare
befcc56
to
1788306
Compare
@ofborg build pkgsMusl.python3 python3 pkgsStatic.python3 |
|
LTO fails to build with musl with the following linker error: ``` rm -f libpython3.9.a if test libpython3.9.so.1.0 != libpython3.9.so; then \ gcc -shared -L/nix/store/1dlhc7w4dlacgmkjbcx9454givv4kdqj-zlib-1.2.11/lib -L/nix/store/6fdwln0ac2p100dhifk2picm0c2d0bw3-bzip2-1.0.6.0.2/lib -L/nix/store/540aidi6ppgnjdd60ky4m6sm6ml824sp-expat-2.4.1/lib -L/nix/store/b493yxrr0glvv3988mkagqlq5k8rg5g1-xz-5.2.5/lib -L/nix/store/2145y7j63691khrjqhn66gc3srb52af8-libffi-3.3/lib -L/nix/store/4h0qimk9kkkrd1v9j6j0v3r3gqg6w22a-gdbm-1.20/lib -L/nix/store/b8n0k1vhjdg0r95x8d2ybgrmbdlhw738-sqlite-3.35.5/lib -L/nix/store/f4y7v8k7ar3n05h3446k6z4aa1c77n22-readline-6.3p08/lib -L/nix/store/j79lxjyfin611lz3rm0mzc26afxm3dgm-ncurses-6.2/lib -L/nix/store/mqs20xckz2gj0asgy2hv60h5dg1i3ci5-openssl-1.1.1k/lib -L/nix/store/hbfls4hgbjn8cb0d4m0kgz4a4cwlcbx5-tzdata-2021a/lib -L/nix/store/1dlhc7w4dlacgmkjbcx9454givv4kdqj-zlib-1.2.11/lib -L/nix/store/6fdwln0ac2p100dhifk2picm0c2d0bw3-bzip2-1.0.6.0.2/lib -L/nix/store/540aidi6ppgnjdd60ky4m6sm6ml824sp-expat-2.4.1/lib -L/nix/store/b493yxrr0glvv3988mkagqlq5k8rg5g1-xz-5.2.5/lib -L/nix/store/2145y7j63691khrjqhn66gc3srb52af8-libffi-3.3/lib -L/nix/store/4h0qimk9kkkrd1v9j6j0v3r3gqg6w22a-gdbm-1.20/lib -L/nix/store/b8n0k1vhjdg0r95x8d2ybgrmbdlhw738-sqlite-3.35.5/lib -L/nix/store/f4y7v8k7ar3n05h3446k6z4aa1c77n22-readline-6.3p08/lib -L/nix/store/j79lxjyfin611lz3rm0mzc26afxm3dgm-ncurses-6.2/lib -L/nix/store/mqs20xckz2gj0asgy2hv60h5dg1i3ci5-openssl-1.1.1k/lib -L/nix/store/hbfls4hgbjn8cb0d4m0kgz4a4cwlcbx5-tzdata-2021a/lib -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -Wl,-hlibpython3.9.so.1.0 -o libpython3.9.so.1.0 Modules/getbuildinfo.o Parser/acceler.o Parser/grammar1.o Parser/listnode.o Parser/node.o Parser/parser.o Parser/token.o Parser/pegen/pegen.o Parser/pegen/parse.o Parser/pegen/parse_string.o Parser/pegen/peg_api.o Parser/myreadline.o Parser/parsetok.o Parser/tokenizer.o Objects/abstract.o Objects/accu.o Objects/boolobject.o Objects/bytes_methods.o Objects/bytearrayobject.o Objects/bytesobject.o Objects/call.o Objects/capsule.o Objects/cellobject.o Objects/classobject.o Objects/codeobject.o Objects/complexobject.o Objects/descrobject.o Objects/enumobject.o Objects/exceptions.o Objects/genericaliasobject.o Objects/genobject.o Objects/fileobject.o Objects/floatobject.o Objects/frameobject.o Objects/funcobject.o Objects/interpreteridobject.o Objects/iterobject.o Objects/listobject.o Objects/longobject.o Objects/dictobject.o Objects/odictobject.o Objects/memoryobject.o Objects/methodobject.o Objects/moduleobject.o Objects/namespaceobject.o Objects/object.o Objects/obmalloc.o Objects/picklebufobject.o Objects/rangeobject.o Objects/setobject.o Objects/sliceobject.o Objects/structseq.o Objects/tupleobject.o Objects/typeobject.o Objects/unicodeobject.o Objects/unicodectype.o Objects/weakrefobject.o Python/_warnings.o Python/Python-ast.o Python/asdl.o Python/ast.o Python/ast_opt.o Python/ast_unparse.o Python/bltinmodule.o Python/ceval.o Python/codecs.o Python/compile.o Python/context.o Python/dynamic_annotations.o Python/errors.o Python/frozenmain.o Python/future.o Python/getargs.o Python/getcompiler.o Python/getcopyright.o Python/getplatform.o Python/getversion.o Python/graminit.o Python/hamt.o Python/hashtable.o Python/import.o Python/importdl.o Python/initconfig.o Python/marshal.o Python/modsupport.o Python/mysnprintf.o Python/mystrtoul.o Python/pathconfig.o Python/peephole.o Python/preconfig.o Python/pyarena.o Python/pyctype.o Python/pyfpe.o Python/pyhash.o Python/pylifecycle.o Python/pymath.o Python/pystate.o Python/pythonrun.o Python/pytime.o Python/bootstrap_hash.o Python/structmember.o Python/symtable.o Python/sysmodule.o Python/thread.o Python/traceback.o Python/getopt.o Python/pystrcmp.o Python/pystrtod.o Python/pystrhex.o Python/dtoa.o Python/formatter_unicode.o Python/fileutils.o Python/dynload_shlib.o Modules/config.o Modules/getpath.o Modules/main.o Modules/gcmodule.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/_abc.o Modules/itertoolsmodule.o Modules/atexitmodule.o Modules/signalmodule.o Modules/_stat.o Modules/timemodule.o Modules/_threadmodule.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/faulthandler.o Modules/_tracemalloc.o Modules/_peg_parser.o Modules/symtablemodule.o Modules/xxsubtype.o Python/frozen.o -ldl -lcrypt -lncurses -lm -lm; \ ln -f libpython3.9.so.1.0 libpython3.9.so; \ else \ gcc -shared -L/nix/store/1dlhc7w4dlacgmkjbcx9454givv4kdqj-zlib-1.2.11/lib -L/nix/store/6fdwln0ac2p100dhifk2picm0c2d0bw3-bzip2-1.0.6.0.2/lib -L/nix/store/540aidi6ppgnjdd60ky4m6sm6ml824sp-expat-2.4.1/lib -L/nix/store/b493yxrr0glvv3988mkagqlq5k8rg5g1-xz-5.2.5/lib -L/nix/store/2145y7j63691khrjqhn66gc3srb52af8-libffi-3.3/lib -L/nix/store/4h0qimk9kkkrd1v9j6j0v3r3gqg6w22a-gdbm-1.20/lib -L/nix/store/b8n0k1vhjdg0r95x8d2ybgrmbdlhw738-sqlite-3.35.5/lib -L/nix/store/f4y7v8k7ar3n05h3446k6z4aa1c77n22-readline-6.3p08/lib -L/nix/store/j79lxjyfin611lz3rm0mzc26afxm3dgm-ncurses-6.2/lib -L/nix/store/mqs20xckz2gj0asgy2hv60h5dg1i3ci5-openssl-1.1.1k/lib -L/nix/store/hbfls4hgbjn8cb0d4m0kgz4a4cwlcbx5-tzdata-2021a/lib -L/nix/store/1dlhc7w4dlacgmkjbcx9454givv4kdqj-zlib-1.2.11/lib -L/nix/store/6fdwln0ac2p100dhifk2picm0c2d0bw3-bzip2-1.0.6.0.2/lib -L/nix/store/540aidi6ppgnjdd60ky4m6sm6ml824sp-expat-2.4.1/lib -L/nix/store/b493yxrr0glvv3988mkagqlq5k8rg5g1-xz-5.2.5/lib -L/nix/store/2145y7j63691khrjqhn66gc3srb52af8-libffi-3.3/lib -L/nix/store/4h0qimk9kkkrd1v9j6j0v3r3gqg6w22a-gdbm-1.20/lib -L/nix/store/b8n0k1vhjdg0r95x8d2ybgrmbdlhw738-sqlite-3.35.5/lib -L/nix/store/f4y7v8k7ar3n05h3446k6z4aa1c77n22-readline-6.3p08/lib -L/nix/store/j79lxjyfin611lz3rm0mzc26afxm3dgm-ncurses-6.2/lib -L/nix/store/mqs20xckz2gj0asgy2hv60h5dg1i3ci5-openssl-1.1.1k/lib -L/nix/store/hbfls4hgbjn8cb0d4m0kgz4a4cwlcbx5-tzdata-2021a/lib -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -o libpython3.9.so Modules/getbuildinfo.o Parser/acceler.o Parser/grammar1.o Parser/listnode.o Parser/node.o Parser/parser.o Parser/token.o Parser/pegen/pegen.o Parser/pegen/parse.o Parser/pegen/parse_string.o Parser/pegen/peg_api.o Parser/myreadline.o Parser/parsetok.o Parser/tokenizer.o Objects/abstract.o Objects/accu.o Objects/boolobject.o Objects/bytes_methods.o Objects/bytearrayobject.o Objects/bytesobject.o Objects/call.o Objects/capsule.o Objects/cellobject.o Objects/classobject.o Objects/codeobject.o Objects/complexobject.o Objects/descrobject.o Objects/enumobject.o Objects/exceptions.o Objects/genericaliasobject.o Objects/genobject.o Objects/fileobject.o Objects/floatobject.o Objects/frameobject.o Objects/funcobject.o Objects/interpreteridobject.o Objects/iterobject.o Objects/listobject.o Objects/longobject.o Objects/dictobject.o Objects/odictobject.o Objects/memoryobject.o Objects/methodobject.o Objects/moduleobject.o Objects/namespaceobject.o Objects/object.o Objects/obmalloc.o Objects/picklebufobject.o Objects/rangeobject.o Objects/setobject.o Objects/sliceobject.o Objects/structseq.o Objects/tupleobject.o Objects/typeobject.o Objects/unicodeobject.o Objects/unicodectype.o Objects/weakrefobject.o Python/_warnings.o Python/Python-ast.o Python/asdl.o Python/ast.o Python/ast_opt.o Python/ast_unparse.o Python/bltinmodule.o Python/ceval.o Python/codecs.o Python/compile.o Python/context.o Python/dynamic_annotations.o Python/errors.o Python/frozenmain.o Python/future.o Python/getargs.o Python/getcompiler.o Python/getcopyright.o Python/getplatform.o Python/getversion.o Python/graminit.o Python/hamt.o Python/hashtable.o Python/import.o Python/importdl.o Python/initconfig.o Python/marshal.o Python/modsupport.o Python/mysnprintf.o Python/mystrtoul.o Python/pathconfig.o Python/peephole.o Python/preconfig.o Python/pyarena.o Python/pyctype.o Python/pyfpe.o Python/pyhash.o Python/pylifecycle.o Python/pymath.o Python/pystate.o Python/pythonrun.o Python/pytime.o Python/bootstrap_hash.o Python/structmember.o Python/symtable.o Python/sysmodule.o Python/thread.o Python/traceback.o Python/getopt.o Python/pystrcmp.o Python/pystrtod.o Python/pystrhex.o Python/dtoa.o Python/formatter_unicode.o Python/fileutils.o Python/dynload_shlib.o Modules/config.o Modules/getpath.o Modules/main.o Modules/gcmodule.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/_abc.o Modules/itertoolsmodule.o Modules/atexitmodule.o Modules/signalmodule.o Modules/_stat.o Modules/timemodule.o Modules/_threadmodule.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/faulthandler.o Modules/_tracemalloc.o Modules/_peg_parser.o Modules/symtablemodule.o Modules/xxsubtype.o Python/frozen.o -ldl -lcrypt -lncurses -lm -lm; \ fi ar rcs libpython3.9.a Modules/getbuildinfo.o Parser/acceler.o Parser/grammar1.o Parser/listnode.o Parser/node.o Parser/parser.o Parser/token.o Parser/pegen/pegen.o Parser/pegen/parse.o Parser/pegen/parse_string.o Parser/pegen/peg_api.o Parser/myreadline.o Parser/parsetok.o Parser/tokenizer.o Objects/abstract.o Objects/accu.o Objects/boolobject.o Objects/bytes_methods.o Objects/bytearrayobject.o Objects/bytesobject.o Objects/call.o Objects/capsule.o Objects/cellobject.o Objects/classobject.o Objects/codeobject.o Objects/complexobject.o Objects/descrobject.o Objects/enumobject.o Objects/exceptions.o Objects/genericaliasobject.o Objects/genobject.o Objects/fileobject.o Objects/floatobject.o Objects/frameobject.o Objects/funcobject.o Objects/interpreteridobject.o Objects/iterobject.o Objects/listobject.o Objects/longobject.o Objects/dictobject.o Objects/odictobject.o Objects/memoryobject.o Objects/methodobject.o Objects/moduleobject.o Objects/namespaceobject.o Objects/object.o Objects/obmalloc.o Objects/picklebufobject.o Objects/rangeobject.o Objects/setobject.o Objects/sliceobject.o Objects/structseq.o Objects/tupleobject.o Objects/typeobject.o Objects/unicodeobject.o Objects/unicodectype.o Objects/weakrefobject.o Python/_warnings.o Python/Python-ast.o Python/asdl.o Python/ast.o Python/ast_opt.o Python/ast_unparse.o Python/bltinmodule.o Python/ceval.o Python/codecs.o Python/compile.o Python/context.o Python/dynamic_annotations.o Python/errors.o Python/frozenmain.o Python/future.o Python/getargs.o Python/getcompiler.o Python/getcopyright.o Python/getplatform.o Python/getversion.o Python/graminit.o Python/hamt.o Python/hashtable.o Python/import.o Python/importdl.o Python/initconfig.o Python/marshal.o Python/modsupport.o Python/mysnprintf.o Python/mystrtoul.o Python/pathconfig.o Python/peephole.o Python/preconfig.o Python/pyarena.o Python/pyctype.o Python/pyfpe.o Python/pyhash.o Python/pylifecycle.o Python/pymath.o Python/pystate.o Python/pythonrun.o Python/pytime.o Python/bootstrap_hash.o Python/structmember.o Python/symtable.o Python/sysmodule.o Python/thread.o Python/traceback.o Python/getopt.o Python/pystrcmp.o Python/pystrtod.o Python/pystrhex.o Python/dtoa.o Python/formatter_unicode.o Python/fileutils.o Python/dynload_shlib.o Modules/config.o Modules/getpath.o Modules/main.o Modules/gcmodule.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/_abc.o Modules/itertoolsmodule.o Modules/atexitmodule.o Modules/signalmodule.o Modules/_stat.o Modules/timemodule.o Modules/_threadmodule.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/faulthandler.o Modules/_tracemalloc.o Modules/_peg_parser.o Modules/symtablemodule.o Modules/xxsubtype.o Python/frozen.o In function ‘assemble_lnotab’, inlined from ‘assemble_emit’ at Python/compile.c:5717:0, inlined from ‘assemble’ at Python/compile.c:6056:0: Python/compile.c:5671: warning: writing 1 byte into a region of size 0 [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wstringop-overflow=�-Wstringop-overflow=8;;�] 5671 | *lnotab++ = k; | /nix/store/vf20zcyqr3qzcjhdidzk377qankcqsqa-binutils-2.35.1/bin/ld: libpython3.9.so.1.0.lto.o: warning: relocation against `PyDictValues_Type' in read-only section `.text' /nix/store/vf20zcyqr3qzcjhdidzk377qankcqsqa-binutils-2.35.1/bin/ld: libpython3.9.so.1.0.lto.o: relocation R_X86_64_PC32 against symbol `PyBool_Type' can not be used when making a shared object; recompile with -fPIC /nix/store/vf20zcyqr3qzcjhdidzk377qankcqsqa-binutils-2.35.1/bin/ld: final link failed: bad value collect2: error: ld returned 1 exit status ln: failed to access 'libpython3.9.so.1.0': No such file or directory ``` This should be investigated (since it should be possible), but disabling it for now seems better than having a significant percentage of pkgsMusl broken. Ref NixOS#131557.
1788306
to
351f141
Compare
@ofborg build pkgsMusl.python3 |
@ofborg build python python3 |
I believe this was due to an issue with our cc/bintools wrappers' argument parsing for PIE hardening. It only shows up for musl, because that's currently the only package set where PIE hardening is enabled by default. I will attempt to revert this along with the fix in #135619. |
LTO fails to build with musl with the following linker error:
This should be investigated (since it should be possible), but disabling it for
now seems better than having a significant percentage of pkgsMusl broken.
Ref #131557.
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)