Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Use PGO during musl builds#570

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
zanieb wants to merge2 commits intomain
base:main
Choose a base branch
Loading
fromzb/musl-pgo
Draft

Use PGO during musl builds#570

zanieb wants to merge2 commits intomainfromzb/musl-pgo

Conversation

@zanieb
Copy link
Member

@zaniebzanieb commentedMar 19, 2025
edited
Loading

It's not clear why we're not using this. Let's see what happens.

@zaniebzanieb added python:3.13 libc:musl platform:linuxSpecific to the Linux platform labelsMar 19, 2025
@zanieb
Copy link
MemberAuthor

zanieb commentedMar 19, 2025
edited
Loading

Well, that's a first problem

2025-03-19T22:14:54.8625163Z cpython-3.13> usage: build.py [-h] [-d] [-f] [-v] target2025-03-19T22:14:54.8626404Z cpython-3.13> build.py: error: argument target: invalid get_target value: 'x86_64-unknown-linux-musl'2025-03-19T22:14:54.8729341Z cpython-3.13> make[2]: *** [jit_stencils.h] Error 22025-03-19T22:14:54.8730619Z cpython-3.13> Makefile:2965: recipe for target 'jit_stencils.h' failed

resolved indb52d2b

@zanieb
Copy link
MemberAuthor

2025-03-19T23:16:36.4962413Z cpython-3.13> musl-clang -L/tools/deps/lib -Wl,--exclude-libs,ALL -LModules/_hacl  -flto=thin -g -fprofile-instr-generate -Xlinker -export-dynamic -o python Programs/python.o -L. -lpython3.13 -ldl  -lpthread     -lbz2          -lffi -ldl  -lm  -lncursesw  -lpanelw -lncursesw   -ldb  -lmpdec  -lexpat  -lcrypto        -llzma       -lrt         -lsqlite3  -lssl -lcrypto            -ltcl8.6 -ltk8.6 -lX11 -lxcb -lXau   -luuid      -lm    -lm   -lexpat  -ledit -lncursesw        -lz                       -lm2025-03-19T23:16:36.4971610Z cpython-3.13> musl-clang -L/tools/deps/lib -Wl,--exclude-libs,ALL -LModules/_hacl  -flto=thin -g -fprofile-instr-generate -Xlinker -export-dynamic -o Programs/_testembed Programs/_testembed.o -L. -lpython3.13 -ldl  -lpthread -lbz2          -lffi -ldl  -lm  -lncursesw  -lpanelw -lncursesw   -ldb  -lmpdec  -lexpat  -lcrypto        -llzma       -lrt         -lsqlite3  -lssl -lcrypto            -ltcl8.6 -ltk8.6 -lX11 -lxcb -lXau   -luuid      -lm    -lm   -lexpat  -ledit -lncursesw        -lz                       -lm2025-03-19T23:16:36.5088042Z cpython-3.13> clang-14clang-14: warning: argument unused during compilation: '-nostdinc' [-Wunused-command-line-argument]2025-03-19T23:16:36.5088753Z cpython-3.13> :2025-03-19T23:16:36.5089031Z cpython-3.13> warning:2025-03-19T23:16:36.5089458Z cpython-3.13> argument unused during compilation: '-nostdinc' [-Wunused-command-line-argument]2025-03-19T23:16:36.5763818Z cpython-3.13> /tools/host/bin/ld: /tools/llvm/lib/clang/14.0.3/lib/linux/libclang_rt.profile-x86_64.a(InstrProfilingFile.c.o): in function `parseAndSetFilename':2025-03-19T23:16:36.5764605Z cpython-3.13> InstrProfilingFile.c:(.text.parseAndSetFilename+0xf9): undefined reference to `__strdup'2025-03-19T23:16:36.5777376Z cpython-3.13> clang-142025-03-19T23:16:36.5778447Z cpython-3.13> :2025-03-19T23:16:36.5779459Z cpython-3.13> error:2025-03-19T23:16:36.5780850Z cpython-3.13> linker command failed with exit code 1 (use -v to see invocation)2025-03-19T23:16:36.5797322Z cpython-3.13> Makefile:977: recipe for target 'python' failed2025-03-19T23:16:36.5798690Z cpython-3.13> make[2]: *** [python] Error 12025-03-19T23:16:36.5800281Z cpython-3.13> make[2]: *** Waiting for unfinished jobs....2025-03-19T23:16:36.7876207Z cpython-3.13> /tools/host/bin/ld: /tools/llvm/lib/clang/14.0.3/lib/linux/libclang_rt.profile-x86_64.a(InstrProfilingFile.c.o): in function `2025-03-19T23:16:36.7877248Z cpython-3.13> parseAndSetFilename':2025-03-19T23:16:36.7877702Z cpython-3.13> InstrProfilingFile.c:(.text.parseAndSetFilename+0xf9): undefined reference to `__strd

@zanieb
Copy link
MemberAuthor

zanieb commentedMar 19, 2025
edited
Loading

This looks like an actual blocker,InstrProfilingFile.c:(.text.parseAndSetFilename+0xf9): undefined reference to '__strdup' — I don't know if we should pursue this further here. We might want to revisit once we're on a newer LLVM toolchain?

@indygreg
Copy link
Collaborator

The way PGO works is an extra library providing PGO instrumentation is linked automagically.

It looks like that library is referencing a symbol that isn't being linked in. It is likely that LLVM is making assumptions about which symbols are present and/or which extra libraries need to be linked to resolve all symbols. Those assumptions are likely tailored for glibc and don't hold on musl.

It is also possible that glibc only symbols are leaking into the LLVM PGO instrumentation library (because LLVM was compiled against glibc). In that case, we can't do much.

It is possible a newer version of LLVM has worked around this issue somehow. I'd focus on upgrading the toolchain. Then we can hash out PGO.

zanieb reacted with thumbs up emoji

@zanieb
Copy link
MemberAuthor

After upgrading llvm, I encounter a similar looking issue

2025-12-10T15:03:03.6830183Z cpython-3.13> /tools/host/bin/ld:2025-12-10T15:03:03.6853001Z cpython-3.13> warning: libcrypto-lib-x86_64-gf2m.o: missing .note.GNU-stack section implies executable stack2025-12-10T15:03:03.6854038Z cpython-3.13> /tools/host/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker2025-12-10T15:03:03.7362865Z cpython-3.13> /tools/host/bin/ld:2025-12-10T15:03:03.7364469Z cpython-3.13> warning:2025-12-10T15:03:03.7364841Z cpython-3.13> libcrypto-lib-x86_64-gf2m.o2025-12-10T15:03:03.7365270Z cpython-3.13> : missing .note.GNU-stack section implies executable stack2025-12-10T15:03:03.7365660Z cpython-3.13> /tools/host/bin/ld:2025-12-10T15:03:03.7366142Z cpython-3.13> NOTE: This behaviour is deprecated and will be removed in a future version of the linker2025-12-10T15:03:04.0107224Z cpython-3.13> /tools/host/bin/ld: /tools/llvm/lib/clang/21/lib/x86_64-unknown-linux-gnu/libclang_rt.profile.a(InstrProfilingFile.c.o): in function `parseAndSetFilename':2025-12-10T15:03:04.0109305Z cpython-3.13> InstrProfilingFile.c:(.text.parseAndSetFilename+0xfd): undefined reference to `__strdup'2025-12-10T15:03:04.0626616Z cpython-3.13> /tools/host/bin/ld2025-12-10T15:03:04.0628258Z cpython-3.13> :2025-12-10T15:03:04.0629037Z cpython-3.13> /tools/llvm/lib/clang/21/lib/x86_64-unknown-linux-gnu/libclang_rt.profile.a(InstrProfilingFile.c.o)2025-12-10T15:03:04.0629582Z cpython-3.13> : in function `2025-12-10T15:03:04.0629890Z cpython-3.13> parseAndSetFilename2025-12-10T15:03:04.0630210Z cpython-3.13> ':2025-12-10T15:03:04.0630494Z cpython-3.13> InstrProfilingFile.c:2025-12-10T15:03:04.0630992Z cpython-3.13> (2025-12-10T15:03:04.0631273Z cpython-3.13> .text.parseAndSetFilename2025-12-10T15:03:04.0631593Z cpython-3.13> +0x2025-12-10T15:03:04.0632011Z cpython-3.13> fd2025-12-10T15:03:04.0632275Z cpython-3.13> )2025-12-10T15:03:04.0632556Z cpython-3.13> : undefined reference to `2025-12-10T15:03:04.0632858Z cpython-3.13> __strdup2025-12-10T15:03:04.0633120Z cpython-3.13> '2025-12-10T15:03:04.0800874Z cpython-3.13> clang: error: linker command failed with exit code 1 (use -v to see invocation)2025-12-10T15:03:04.0817760Z cpython-3.13> Makefile:978: recipe for target 'python' failed2025-12-10T15:03:04.0820209Z cpython-3.13> make[2]: *** [python] Error 12025-12-10T15:03:04.0820685Z cpython-3.13> make[2]: *** Waiting for unfinished jobs....2025-12-10T15:03:04.1371226Z cpython-3.13> clang: error: linker command failed with exit code 1 (use -v to see invocation)2025-12-10T15:03:04.1392553Z cpython-3.13> Makefile:1537: recipe for target 'Programs/_testembed' failed2025-12-10T15:03:04.1393517Z cpython-3.13> make[2]: Leaving directory '/build/Python-3.13.11'2025-12-10T15:03:04.1394252Z cpython-3.13> make[2]: *** [Programs/_testembed] Error 12025-12-10T15:03:04.1395585Z cpython-3.13> Makefile:835: recipe for target 'profile-gen-stamp' failed2025-12-10T15:03:04.1396051Z cpython-3.13> make[1]: *** [profile-gen-stamp] Error 22025-12-10T15:03:04.1397604Z cpython-3.13> make[1]: Leaving directory '/build/Python-3.13.11'2025-12-10T15:03:04.1401530Z cpython-3.13> Makefile:846: recipe for target 'profile-run-stamp' failed

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

libc:muslplatform:linuxSpecific to the Linux platformpython:3.13

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@zanieb@indygreg

[8]ページ先頭

©2009-2025 Movatter.jp