Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 Dec 2024 00:44:54 +0000
From:      bugzilla-noreply@freebsd.org
To:        toolchain@FreeBSD.org
Subject:   [Bug 276170] LLVM bug prevents from enabling PGO optimization for Python 3.11+
Message-ID:  <bug-276170-29464-UR4H7eBVzX@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-276170-29464@https.bugs.freebsd.org/bugzilla/>
References:  <bug-276170-29464@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D276170

--- Comment #31 from Mark Millard <marklmi26-fbsd@yahoo.com> ---
(In reply to Guillaume Outters from comment #30)

I tried the following with the final WANRINGs at the end shown
below:

# tar -xpf Python-3.13.1.tar.xz -C ./
# cd Python-3.13.1
# ./configure --enable-optimizations
. . .
configure: WARNING: pkg-config is missing. Some dependencies may not be
detected correctly.
configure: WARNING:

Platform "aarch64-unknown-freebsd15.0" with compiler "clang" is not support=
ed
by the
CPython core team, see https://peps.python.org/pep-0011/ for more informati=
on.

I then did the same in another directory tree, using
export CC=3Dclang before the "./configure --enable-optimizations".

I also captured and diff'd the outputs of the 2 runs,
other than "cc" vs. "clang" text, they matched.

# diff -rq Python-3.13.1-noCC/ Python-3.13.1-CC_clang/ | more
Files Python-3.13.1-noCC/Makefile and Python-3.13.1-CC_clang/Makefile differ
Files Python-3.13.1-noCC/Makefile.pre and Python-3.13.1-CC_clang/Makefile.p=
re
differ
Files Python-3.13.1-noCC/config.log and Python-3.13.1-CC_clang/config.log
differ
Files Python-3.13.1-noCC/config.status and Python-3.13.1-CC_clang/config.st=
atus
differ

There are interesting Makefile differences and
Makefile.pre differences, both, in part, tied
to PGO_* and LLVM_PROF_* definition differences:

# diff -r Python-3.13.1-noCC/ Python-3.13.1-CC_clang/ | less
diff -r Python-3.13.1-noCC/Makefile Python-3.13.1-CC_clang/Makefile
38,39c38,39
< CC=3D           cc -pthread
< CXX=3D          c++ -pthread
---
> CC=3D           clang -pthread
> CXX=3D          clang++ -pthread
51,54c51,54
< PGO_PROF_GEN_FLAG=3D
< PGO_PROF_USE_FLAG=3D
< LLVM_PROF_MERGER=3D
< LLVM_PROF_FILE=3D
---
> PGO_PROF_GEN_FLAG=3D-fprofile-instr-generate
> PGO_PROF_USE_FLAG=3D-fprofile-instr-use=3D"$(shell pwd)/code.profclangd"
> LLVM_PROF_MERGER=3D /usr/bin/llvm-profdata merge -output=3D"$(shell pwd)/=
code.profclangd" "$(shell pwd)"/*.profclangr=20
> LLVM_PROF_FILE=3DLLVM_PROFILE_FILE=3D"$(shell pwd)/code-%p.profclangr"
377c377
< CONFIG_ARGS=3D   '--enable-optimizations'
---
> CONFIG_ARGS=3D   '--enable-optimizations' 'CC=3Dclang'

diff -r Python-3.13.1-noCC/Makefile.pre Python-3.13.1-CC_clang/Makefile.pre
37,38c37,38
< CC=3D           cc -pthread
< CXX=3D          c++ -pthread
---
> CC=3D           clang -pthread
> CXX=3D          clang++ -pthread
50,53c50,53
< PGO_PROF_GEN_FLAG=3D
< PGO_PROF_USE_FLAG=3D
< LLVM_PROF_MERGER=3D
< LLVM_PROF_FILE=3D
---
> PGO_PROF_GEN_FLAG=3D-fprofile-instr-generate
> PGO_PROF_USE_FLAG=3D-fprofile-instr-use=3D"$(shell pwd)/code.profclangd"
> LLVM_PROF_MERGER=3D /usr/bin/llvm-profdata merge -output=3D"$(shell pwd)/=
code.profclangd" "$(shell pwd)"/*.profclangr=20
> LLVM_PROF_FILE=3DLLVM_PROFILE_FILE=3D"$(shell pwd)/code-%p.profclangr"
376c376
< CONFIG_ARGS=3D   '--enable-optimizations'
---
> CONFIG_ARGS=3D   '--enable-optimizations' 'CC=3Dclang'

This much does not seem to be a FreeBSD issue.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-276170-29464-UR4H7eBVzX>