redhat-rpm-config/tests/extension-builder-flags/runtest.sh
Charalampos Stratakis 7331757cf1 Strip all extension builder flags except -fexceptions and -fcf-protection
This preserves binary compatibility with the main interpreters
the extensions are built against while removing Fedora's flags
that are not required to be inherited on user built extensions.

This implements https://fedoraproject.org/wiki/Changes/Python_Extension_Flags_Reduction
2023-08-04 12:58:12 +02:00

12 lines
481 B
Bash
Executable File

#!/bin/bash
set -ex
# Verify that the extension builder flags are stripped of non-required flags.
# The flags may appear in random order due to being accessed through a lua
# associative array.
for f in %{extension_cflags} %{extension_cxxflags} %{extension_fflags}; do
[[ $(rpm --eval "$f") =~ ^[[:space:]]*(-fexceptions -fcf-protection|-fcf-protection -fexceptions)[[:space:]]*$ ]]
done
# The extension ldflag should always be empty
[[ -z $(rpm --eval "%extension_ldflags") ]]