[v3] elf: Pre-generate Makefile fragment for DSO sorting tests [BZ #28550]
Checks
Context |
Check |
Description |
dj/TryBot-apply_patch |
success
|
Patch applied to master at the time it was sent
|
dj/TryBot-32bit |
success
|
Build for i686
|
Commit Message
Generate Makefile fragment for DSO sorting tests at configure time.
This partially fixes BZ #28550.
---
configure | 11 +++++++++++
configure.ac | 12 ++++++++++++
elf/Makefile | 22 ++--------------------
3 files changed, 25 insertions(+), 20 deletions(-)
@@ -8484,3 +8484,14 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
+
+if test "$have_tunables" = yes; then
+ test -d elf || mkdir elf
+ objdir=`pwd`
+ rm -f elf/dso-sort-tests.mk
+ (for d in dso-sort-tests-1.def dso-sort-tests-2.def
+ do
+ $PYTHON $srcdir/scripts/dso-ordering-test.py \
+ --description-file $srcdir/elf/$d --objpfx $objdir/elf/
+ done) > elf/dso-sort-tests.mk
+fi
@@ -1901,3 +1901,15 @@ echo "$config_vars" >> config.make;;
esac
test -d bits || mkdir bits]],[[config_vars='$config_vars']])
AC_OUTPUT
+
+dnl Generate Makefile fragments for DSO sorting tests.
+if test "$have_tunables" = yes; then
+ test -d elf || mkdir elf
+ objdir=`pwd`
+ rm -f elf/dso-sort-tests.mk
+ (for d in dso-sort-tests-1.def dso-sort-tests-2.def
+ do
+ $PYTHON $srcdir/scripts/dso-ordering-test.py \
+ --description-file $srcdir/elf/$d --objpfx $objdir/elf/
+ done) > elf/dso-sort-tests.mk
+fi
@@ -491,27 +491,9 @@ tests-special += $(objpfx)order-cmp.out $(objpfx)tst-array1-cmp.out \
$(objpfx)tst-unused-dep-cmp.out
endif
-ifndef avoid-generated
-# DSO sorting tests:
-# The dso-ordering-test.py script generates testcase source files in $(objpfx),
-# creating a $(objpfx)<testcase-name>-dir for each testcase, and creates a
-# Makefile fragment to be included.
-define include_dsosort_tests
-$(objpfx)$(1).generated-makefile: $(1)
- $(PYTHON) $(..)scripts/dso-ordering-test.py \
- --description-file $$< --objpfx $(objpfx) --output-makefile $$@T
- mv $$@T $$@
--include $(objpfx)$(1).generated-makefile
-endef
-endif
-
-postclean-generated += $(objpfx)/dso-sort-tests-2.generated-makefile \
- $(objpfx)/dso-sort-tests-2.generated-makefile
-
-# Generate from each testcase description file
ifeq (yes,$(have-tunables))
-$(eval $(call include_dsosort_tests,dso-sort-tests-1.def))
-$(eval $(call include_dsosort_tests,dso-sort-tests-2.def))
+# Include Makefile fragments for DSO sorting tests.
+include $(objpfx)dso-sort-tests.mk
endif
check-abi: $(objpfx)check-abi-ld.out