Patch to require Python 3.4 or later to build glibc.

This patch makes Python 3.4 or later a required tool for building
glibc, so allowing changes of awk, perl etc. code used in the build
and test to Python code without any such changes needing makefile
conditionals or to handle older Python versions.

This patch makes the configure test for Python check the version and
give an error if Python is missing or too old, and removes makefile
conditionals that are no longer needed.  It does not itself convert
any code from another language to Python, and does not remove any
compatibility with older Python versions from existing scripts.

Tested for x86_64.

	* configure.ac (PYTHON_PROG): Use AC_CHECK_PROG_VER.  Set
	critic_missing for versions before 3.4.
	* configure: Regenerated.
	* manual/install.texi (Tools for Compilation): Document
	requirement for Python to build glibc.
	* INSTALL: Regenerated.
	* Rules [PYTHON]: Make code unconditional.
	* benchtests/Makefile [PYTHON]: Likewise.
	* conform/Makefile [PYTHON]: Likewise.
	* manual/Makefile [PYTHON]: Likewise.
	* math/Makefile [PYTHON]: Likewise.
This commit is contained in:
Joseph Myers 2018-10-29 15:28:05 +00:00
parent 5c81be5340
commit c6982f7efc
11 changed files with 50 additions and 61 deletions

View File

@ -1,3 +1,17 @@
2018-10-29 Joseph Myers <joseph@codesourcery.com>
* configure.ac (PYTHON_PROG): Use AC_CHECK_PROG_VER. Set
critic_missing for versions before 3.4.
* configure: Regenerated.
* manual/install.texi (Tools for Compilation): Document
requirement for Python to build glibc.
* INSTALL: Regenerated.
* Rules [PYTHON]: Make code unconditional.
* benchtests/Makefile [PYTHON]: Likewise.
* conform/Makefile [PYTHON]: Likewise.
* manual/Makefile [PYTHON]: Likewise.
* math/Makefile [PYTHON]: Likewise.
2018-10-28 Samuel Thibault <samuel.thibault@ens-lyon.org> 2018-10-28 Samuel Thibault <samuel.thibault@ens-lyon.org>
* hurd/hurdsig.c (_hurd_interrupted_rpc_timeout): Set to 60000. * hurd/hurdsig.c (_hurd_interrupted_rpc_timeout): Set to 60000.

View File

@ -531,11 +531,11 @@ build the GNU C Library:
work with any version of 'sed'. As of release time, 'sed' version work with any version of 'sed'. As of release time, 'sed' version
4.5 is the newest verified to work to build the GNU C Library. 4.5 is the newest verified to work to build the GNU C Library.
* Python 2.7/3.4 or later * Python 3.4 or later
Python is required to build the GNU C Library manual and to run Python is required to build the GNU C Library. As of release time,
some tests. As of release time, Python 3.6 is the newest verified Python 3.6 is the newest verified to work for building and testing
to work for testing the GNU C Library. the GNU C Library.
* PExpect 4.0 * PExpect 4.0

2
NEWS
View File

@ -48,7 +48,7 @@ Deprecated and removed features, and other changes affecting compatibility:
Changes to build and runtime requirements: Changes to build and runtime requirements:
* Python is required to build the GNU C Library manual. * Python 3.4 or later is required to build the GNU C Library.
Security related changes: Security related changes:

7
Rules
View File

@ -114,11 +114,6 @@ tests-printers-programs := $(addprefix $(objpfx),$(tests-printers))
# .out files with the output of running the pretty printer tests. # .out files with the output of running the pretty printer tests.
tests-printers-out := $(patsubst %,$(objpfx)%.out,$(tests-printers)) tests-printers-out := $(patsubst %,$(objpfx)%.out,$(tests-printers))
ifndef PYTHON
# Mark tests-printers tests as unsupported if we don't have PYTHON.
tests-unsupported += $(tests-printers)
endif
ifeq ($(build-programs),yes) ifeq ($(build-programs),yes)
others: $(addprefix $(objpfx),$(others) $(sysdep-others) $(extra-objs)) others: $(addprefix $(objpfx),$(others) $(sysdep-others) $(extra-objs))
else else
@ -277,7 +272,6 @@ endif
endif # tests endif # tests
ifdef PYTHON
ifneq "$(strip $(tests-printers))" "" ifneq "$(strip $(tests-printers))" ""
# Static pattern rule for building the test programs for the pretty printers. # Static pattern rule for building the test programs for the pretty printers.
@ -300,7 +294,6 @@ $(tests-printers-out): $(objpfx)%.out: $(objpfx)% %.py %.c $(pretty-printers) \
$(PYTHON) $*.py $*.c $(objpfx)$* $(pretty-printers) > $@; \ $(PYTHON) $*.py $*.c $(objpfx)$* $(pretty-printers) > $@; \
$(evaluate-test) $(evaluate-test)
endif endif
endif
.PHONY: distclean realclean subdir_distclean subdir_realclean \ .PHONY: distclean realclean subdir_distclean subdir_realclean \

View File

@ -180,14 +180,7 @@ $(error Invalid BENCHSET value)
endif endif
endif endif
# Define the bench target only if the target has a usable python installation.
ifdef PYTHON
bench: bench-build bench-set bench-func bench-malloc bench: bench-build bench-set bench-func bench-malloc
else
bench:
@echo "The bench target needs python to run."
@exit 1
endif
# Target to only build the benchmark without running it. We generate locales # Target to only build the benchmark without running it. We generate locales
# only if we're building natively. # only if we're building natively.

29
configure vendored
View File

@ -5344,19 +5344,30 @@ fi
test -n "$PYTHON_PROG" && break test -n "$PYTHON_PROG" && break
done done
test -n "$PYTHON_PROG" || PYTHON_PROG="no"
case "x$PYTHON_PROG" in if test -z "$PYTHON_PROG"; then
xno|x|x:) PYTHON_PROG=no ;; ac_verc_fail=yes
*) ;;
esac
if test "x$PYTHON_PROG" = xno; then
aux_missing="$aux_missing python"
else else
PYTHON="$PYTHON_PROG -B" # Found it, now check the version.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking version of $PYTHON_PROG" >&5
$as_echo_n "checking version of $PYTHON_PROG... " >&6; }
ac_prog_version=`$PYTHON_PROG --version 2>&1 | sed -n 's/^.*Python \([0-9][0-9.]*\).*$/\1/p'`
case $ac_prog_version in
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
3.[4-9]*|3.[1-9][0-9]*|[4-9].*|[1-9][0-9]*)
ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_prog_version" >&5
$as_echo "$ac_prog_version" >&6; }
fi fi
if test $ac_verc_fail = yes; then
critic_missing="$critic_missing python"
fi
PYTHON="$PYTHON_PROG -B"
test -n "$critic_missing" && as_fn_error $? " test -n "$critic_missing" && as_fn_error $? "
*** These critical programs are missing or too old:$critic_missing *** These critical programs are missing or too old:$critic_missing

View File

@ -1050,18 +1050,12 @@ else
fi fi
# Check for python3 if available, or else python. # Check for python3 if available, or else python.
AC_CHECK_PROGS(PYTHON_PROG, python3 python,no) AC_CHECK_PROG_VER(PYTHON_PROG, python3 python, --version,
case "x$PYTHON_PROG" in [Python \([0-9][0-9.]*\)],
xno|x|x:) PYTHON_PROG=no ;; [3.[4-9]*|3.[1-9][0-9]*|[4-9].*|[1-9][0-9]*],
*) ;; critic_missing="$critic_missing python")
esac PYTHON="$PYTHON_PROG -B"
AC_SUBST(PYTHON)
if test "x$PYTHON_PROG" = xno; then
aux_missing="$aux_missing python"
else
PYTHON="$PYTHON_PROG -B"
AC_SUBST(PYTHON)
fi
test -n "$critic_missing" && AC_MSG_ERROR([ test -n "$critic_missing" && AC_MSG_ERROR([
*** These critical programs are missing or too old:$critic_missing *** These critical programs are missing or too old:$critic_missing

View File

@ -120,9 +120,7 @@ linknamespace-symlists-base := $(foreach std,$(conformtest-standards),\
symlist-$(std)) symlist-$(std))
linknamespace-symlists-tests := $(addprefix $(objpfx),\ linknamespace-symlists-tests := $(addprefix $(objpfx),\
$(linknamespace-symlists-base)) $(linknamespace-symlists-base))
ifdef PYTHON
tests-special += $(linknamespace-symlists-tests) tests-special += $(linknamespace-symlists-tests)
endif
linknamespace-symlist-stdlibs-base := $(foreach std,$(conformtest-standards),\ linknamespace-symlist-stdlibs-base := $(foreach std,$(conformtest-standards),\
symlist-stdlibs-$(std)) symlist-stdlibs-$(std))
@ -130,9 +128,7 @@ linknamespace-symlist-stdlibs-tests := \
$(addprefix $(objpfx),\ $(addprefix $(objpfx),\
$(linknamespace-symlist-stdlibs-base)) $(linknamespace-symlist-stdlibs-base))
ifdef PYTHON
tests-special += $(linknamespace-symlist-stdlibs-tests) tests-special += $(linknamespace-symlist-stdlibs-tests)
endif
linknamespace-header-base := $(foreach std,\ linknamespace-header-base := $(foreach std,\
$(conformtest-standards),\ $(conformtest-standards),\
@ -141,9 +137,7 @@ linknamespace-header-base := $(foreach std,\
$(std)/$(h)/linknamespace.out)) $(std)/$(h)/linknamespace.out))
linknamespace-header-tests := $(addprefix $(objpfx),\ linknamespace-header-tests := $(addprefix $(objpfx),\
$(linknamespace-header-base)) $(linknamespace-header-base))
ifdef PYTHON
tests-special += $(linknamespace-header-tests) tests-special += $(linknamespace-header-tests)
endif
include ../Rules include ../Rules

View File

@ -172,7 +172,7 @@ include ../Rules
install-data subdir_install: install install-data subdir_install: install
# Generated files requiring python: libm-err.texi # Generated files requiring python: libm-err.texi
# Generated files requiring perl: summary.texi # Generated files requiring perl: summary.texi
ifneq ($(if $(PYTHON),$(PERL),no),no) ifneq ($(PERL),no)
ifneq ($(strip $(MAKEINFO)),:) ifneq ($(strip $(MAKEINFO)),:)
install: $(inst_infodir)/libc.info install: $(inst_infodir)/libc.info
@if $(SHELL) -c '$(INSTALL_INFO) --version' >/dev/null 2>&1; then \ @if $(SHELL) -c '$(INSTALL_INFO) --version' >/dev/null 2>&1; then \

View File

@ -575,11 +575,11 @@ with any version of @code{sed}. As of release time, @code{sed} version
4.5 is the newest verified to work to build @theglibc{}. 4.5 is the newest verified to work to build @theglibc{}.
@item @item
Python 2.7/3.4 or later Python 3.4 or later
Python is required to build the @glibcadj{} manual and to run some Python is required to build @theglibc{}. As of release time, Python
tests. As of release time, Python 3.6 is the newest verified to work 3.6 is the newest verified to work for building and testing
for testing @theglibc{}. @theglibc{}.
@item PExpect 4.0 @item PExpect 4.0

View File

@ -255,7 +255,6 @@ tests += test-math-isinff test-math-iszero test-math-issignaling \
test-math-iscanonical test-math-cxx11 test-math-iseqsig test-math-iscanonical test-math-cxx11 test-math-iseqsig
endif endif
ifdef PYTHON
libm-vec-tests = $(addprefix test-,$(libmvec-tests)) libm-vec-tests = $(addprefix test-,$(libmvec-tests))
libm-test-support = $(foreach t,$(test-types),libm-test-support-$(t)) libm-test-support = $(foreach t,$(test-types),libm-test-support-$(t))
test-extras += $(libm-test-support) test-extras += $(libm-test-support)
@ -351,9 +350,7 @@ $(libm-test-c-narrow-obj): $(objpfx)libm-test%.c: libm-test%.inc \
auto-libm-test-out% auto-libm-test-out%
$(make-target-directory) $(make-target-directory)
$(PYTHON) gen-libm-test.py -c $< -a auto-libm-test-out$* -C $@ $(PYTHON) gen-libm-test.py -c $< -a auto-libm-test-out$* -C $@
endif
ifdef PYTHON
tgmath3-macros = atan2 cbrt ceil copysign erf erfc exp2 expm1 fdim floor \ tgmath3-macros = atan2 cbrt ceil copysign erf erfc exp2 expm1 fdim floor \
fma fmax fmin fmod frexp hypot ilogb ldexp lgamma llrint \ fma fmax fmin fmod frexp hypot ilogb ldexp lgamma llrint \
llround log10 log1p log2 logb lrint lround nearbyint \ llround log10 log1p log2 logb lrint lround nearbyint \
@ -380,7 +377,6 @@ tests-special += $(objpfx)test-tgmath3-macro-list.out
$(objpfx)test-tgmath3-macro-list.out: gen-tgmath-tests.py $(objpfx)test-tgmath3-macro-list.out: gen-tgmath-tests.py
$(PYTHON) $< check-list $(tgmath3-macros) > $@; \ $(PYTHON) $< check-list $(tgmath3-macros) > $@; \
$(evaluate-test) $(evaluate-test)
endif
libm-test-fast-math-cflags = -fno-builtin -D__FAST_MATH__ -DTEST_FAST_MATH libm-test-fast-math-cflags = -fno-builtin -D__FAST_MATH__ -DTEST_FAST_MATH
libm-test-vec-cflags = $(libm-test-fast-math-cflags) -fno-inline \ libm-test-vec-cflags = $(libm-test-fast-math-cflags) -fno-inline \
@ -476,7 +472,6 @@ $(objpfx)gen-libm-templates.stmp: Makefile
$(foreach t, $(call type-foreach, $(gen-all-calls)), \ $(foreach t, $(call type-foreach, $(gen-all-calls)), \
$(objpfx)$(t).c): $(objpfx)gen-libm-templates.stmp $(objpfx)$(t).c): $(objpfx)gen-libm-templates.stmp
ifdef PYTHON
# This must come after the inclusion of sysdeps Makefiles via Rules. # This must come after the inclusion of sysdeps Makefiles via Rules.
$(foreach t,$(libm-tests-normal),$(objpfx)$(t).c): $(objpfx)test-%.c: $(foreach t,$(libm-tests-normal),$(objpfx)$(t).c): $(objpfx)test-%.c:
@ -637,11 +632,6 @@ regen-ulps: $(addprefix $(objpfx),$(libm-tests))
echo "Difference between the current baseline and the new baseline is:";\ echo "Difference between the current baseline and the new baseline is:";\
diff -urN $(ulps-file) $(objpfx)NewUlps; \ diff -urN $(ulps-file) $(objpfx)NewUlps; \
echo "Copy $(objpfx)NewUlps to $(ulps-file) (relative to source)." echo "Copy $(objpfx)NewUlps to $(ulps-file) (relative to source)."
else
regen-ulps:
@echo "Automatic regeneration of ULPs requires python."; \
exit 1;
endif
# The generated sysd-rules file defines rules like this for sources # The generated sysd-rules file defines rules like this for sources
# coming from sysdeps/ directories. These rules find the generic sources. # coming from sysdeps/ directories. These rules find the generic sources.