Skip to content

Python 2.7.2 doesn't build cleanly with GCC ≥ 4.8 #407

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

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions recipes/hostpython/patches/fix-bug-17547.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
--- a/configure
+++ b/configure
@@ -5731,7 +5731,7 @@ then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc supports ParseTuple __format__" >&5
$as_echo_n "checking whether gcc supports ParseTuple __format__... " >&6; }
save_CFLAGS=$CFLAGS
- CFLAGS="$CFLAGS -Werror"
+ CFLAGS="$CFLAGS -Werror -Wformat"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

--- a/configure.in
+++ b/configure.in
@@ -1185,7 +1185,7 @@ if test "$GCC" = "yes"
then
AC_MSG_CHECKING(whether gcc supports ParseTuple __format__)
save_CFLAGS=$CFLAGS
- CFLAGS="$CFLAGS -Werror"
+ CFLAGS="$CFLAGS -Werror -Wformat"
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[void f(char*,...)__attribute((format(PyArg_ParseTuple, 1, 2)));]], [[]])
],[
15 changes: 14 additions & 1 deletion recipes/hostpython/recipe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ RECIPE_hostpython=$RECIPES_PATH/hostpython

function prebuild_hostpython() {
cd $BUILD_hostpython

# check marker in our source build
if [ -f .patched ]; then
# no patch needed
return
fi

try patch -p1 < $RECIPE_hostpython/patches/fix-bug-17547.patch

# everything done, touch the marker !
touch .patched

try cp $RECIPE_hostpython/Setup Modules/Setup
}

Expand All @@ -25,7 +37,8 @@ function build_hostpython() {
cd $BUILD_hostpython

try ./configure
try make -j5
try make -j5 -k
try make
try mv Parser/pgen hostpgen

if [ -f python.exe ]; then
Expand Down
22 changes: 22 additions & 0 deletions recipes/python/patches/fix-bug-17547.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
--- a/configure
+++ b/configure
@@ -5731,7 +5731,7 @@ then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc supports ParseTuple __format__" >&5
$as_echo_n "checking whether gcc supports ParseTuple __format__... " >&6; }
save_CFLAGS=$CFLAGS
- CFLAGS="$CFLAGS -Werror"
+ CFLAGS="$CFLAGS -Werror -Wformat"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

--- a/configure.in
+++ b/configure.in
@@ -1185,7 +1185,7 @@ if test "$GCC" = "yes"
then
AC_MSG_CHECKING(whether gcc supports ParseTuple __format__)
save_CFLAGS=$CFLAGS
- CFLAGS="$CFLAGS -Werror"
+ CFLAGS="$CFLAGS -Werror -Wformat"
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[void f(char*,...)__attribute((format(PyArg_ParseTuple, 1, 2)));]], [[]])
],[
1 change: 1 addition & 0 deletions recipes/python/recipe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ function prebuild_python() {
try patch -p1 < $RECIPE_python/patches/fix-dynamic-lookup.patch
try patch -p1 < $RECIPE_python/patches/fix-dlfcn.patch
try patch -p1 < $RECIPE_python/patches/ctypes-find-library.patch
try patch -p1 < $RECIPE_python/patches/fix-bug-17547.patch

system=$(uname -s)
if [ "X$system" == "XDarwin" ]; then
Expand Down