Skip to content

[3.13] reinstate _OPTIMIZED & LTO_CFLAGS for correct flag handling in install_base.sh - #915

Merged
isuruf merged 1 commit into
conda-forge:3.13from
h-vetinari:3.13
Sep 2, 2026
Merged

[3.13] reinstate _OPTIMIZED & LTO_CFLAGS for correct flag handling in install_base.sh#915
isuruf merged 1 commit into
conda-forge:3.13from
h-vetinari:3.13

Conversation

@h-vetinari

Copy link
Copy Markdown
Member

Fix-up for #902 (same as #914), because the following code actually requires _OPTIMIZED to be set

declare -a _FLAGS_REPLACE=()
if [[ ${_OPTIMIZED} == yes ]]; then
_FLAGS_REPLACE+=(-O3)
_FLAGS_REPLACE+=(-O2)
_FLAGS_REPLACE+=("-fprofile-use")
_FLAGS_REPLACE+=("")
_FLAGS_REPLACE+=("-fprofile-correction")
_FLAGS_REPLACE+=("")
_FLAGS_REPLACE+=("-L.")
_FLAGS_REPLACE+=("")
for _LTO_CFLAG in "${LTO_CFLAGS[@]}"; do
_FLAGS_REPLACE+=(${_LTO_CFLAG})
_FLAGS_REPLACE+=("")
done
fi
SYSCONFIG=$(find ${_buildd_static}/$(cat ${_buildd_static}/pybuilddir.txt) -name "_sysconfigdata*.py" -print0)
cat ${SYSCONFIG} | ${SYS_PYTHON} "${RECIPE_DIR}"/replace-word-pairs.py \
"${_FLAGS_REPLACE[@]}" \
> ${PREFIX}/lib/python${VERABI_NO_DBG}/$(basename ${SYSCONFIG})

@conda-forge-admin

conda-forge-admin commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe/meta.yaml) and found it was in an excellent condition.

I do have some suggestions for making it better though...

For recipe/meta.yaml:

  • ℹ️ The recipe is not parsable by parser conda-souschef (grayskull). This parser is not currently used by conda-forge, but may be in the future. We are collecting information to see which recipes are compatible with grayskull.
  • ℹ️ The recipe is not parsable by parser conda-recipe-manager. The recipe can only be automatically migrated to the new v1 format if it is parseable by conda-recipe-manager.

This message was generated by GitHub Actions workflow run https://github.com/conda-forge/conda-forge-webservices/actions/runs/33570514128. Examine the logs at this URL for more detail.

@h-vetinari h-vetinari changed the title [3.13] reinstate _OPTIMIZED for correct flag handling in install_base.sh [3.13] reinstate _OPTIMIZED & LTO_CFLAGS for correct flag handling in install_base.sh Sep 1, 2026
…l_base.sh

deleted in 605b74c without noticing remaining use
@isuruf
isuruf merged commit 2dbc173 into conda-forge:3.13 Sep 2, 2026
25 checks passed
@yhlee-tw

yhlee-tw commented Sep 2, 2026

Copy link
Copy Markdown

@isuruf

I think this introduced a regression in the Linux 3.13 build.

With 3.13.15-hf47f18c_102_cp313, sysconfig contains the invalid -partition=none flag, while the other LTO-related flags are still present:

$ python -c 'import sysconfig; print(sysconfig.get_config_var("CFLAGS"))'
-fno-strict-overflow -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -fno-merge-constants -isystem /opt/conda/envs/test/include -fdebug-prefix-map=/home/conda/feedstock_root/build_artifacts/python-split_1788361500653/work=/usr/local/src/conda/python-split-3.13.15 -fuse-linker-plugin -ffat-lto-objects -partition=none -fPIC -O2 -fno-merge-constants -isystem /opt/conda/envs/test/include -fdebug-prefix-map=/home/conda/feedstock_root/build_artifacts/python-split_1788361500653/work=/usr/local/src/conda/python-split-3.13.15 -fuse-linker-plugin -ffat-lto-objects -partition=none

and pip builds of C extensions fail with:

gcc: error: unrecognized command-line option '-partition=none'

Downgrading to 3.13.15-hf47f18c_101_cp313 fixes the issue; that build still has -O3 and the valid -flto-partition=none.

It looks like the intent here is to rewrite -O3 to -O2 and remove the build-time LTO flags:

-fuse-linker-plugin
-ffat-lto-objects
-flto-partition=none
-flto

In _102, the -O3 -> -O2 rewrite happened, but the LTO cleanup seems to have only partially happened: -fuse-linker-plugin and -ffat-lto-objects are still there, and -flto-partition=none became the invalid -partition=none.

EDIT: now I see the same reported in #914 (comment) (on 3.14) as well as #919 and #920.

@h-vetinari
h-vetinari deleted the 3.13 branch September 2, 2026 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants