]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Reduce command length in regen-ulps.
authorJoseph Myers <joseph@codesourcery.com>
Tue, 2 Jan 2018 18:33:18 +0000 (18:33 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Tue, 2 Jan 2018 18:33:18 +0000 (18:33 +0000)
I found that "make regen-ulps" failed when building with unmodified
GNU make 4.1, and an objdir /some/where/math/ longer than about 37
characters, because the list of tests in the "for run in $^" loop
exceeded the Linux kernel's MAX_ARG_STRLEN limit (131072 bytes) on the
length of a single argument passed to a command.

Some GNU/Linux distributions have a patch to make to work around this
limit (see e.g. Debian bug 688601), but clearly this ought to work
without needing such a patch.  This patch arranges for the shell loop
to be over the test names without a $(objdir) prefix, which reduces
the space used to less than half MAX_ARG_STRLEN.

(I think we ought to aim to get rid of bits/mathinline.h completely -
filing GCC bugs for any optimizations GCC can't currently do with
-ffast-math - which would mean we could halve the number of libm tests
run because separate inline function tests would no longer be needed.
However, with a long directory name even half the number of tests
could make this command exceed MAX_ARG_STRLEN without my patch.)

Tested regen-ulps on a system where it failed before this patch.

* math/Makefile (run-regen-ulps): Add $(objpfx) to test name here.
(regen-ulps): Use $(libm-tests) not $^ in shell loop.

ChangeLog
math/Makefile

index d8afa344b69d5d6dab81656715671d0d1a6065d6..60c75f4178d60d1c83c0f67b3e9d40fb55298fd5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2018-01-02  Joseph Myers  <joseph@codesourcery.com>
+
+       * math/Makefile (run-regen-ulps): Add $(objpfx) to test name here.
+       (regen-ulps): Use $(libm-tests) not $^ in shell loop.
+
 2018-01-02  Rajalakshmi Srinivasaraghavan  <raji@linux.vnet.ibm.com>
 
        * NEWS: Add cosf and sincosf to list of optimized functions.
index e966c9889e277577472e4e4825869d9b582f4694..4c8703c71e07875db795c088ad165289dadbbe7d 100644 (file)
@@ -521,12 +521,12 @@ include $(o-iterator)
 
 run-regen-ulps = $(test-wrapper-env) \
            $(run-program-env) \
-           $($*-ENV) $(rtld-prefix) $${run}
+           $($*-ENV) $(rtld-prefix) $(objpfx)$${run}
 
 regen-ulps: $(addprefix $(objpfx),$(libm-tests))
        rm -f $(objpfx)ULPs; rm -f $(objpfx)NewUlps; \
        cp $(ulps-file) $(objpfx)libm-test-ulps; \
-       for run in $^; do \
+       for run in $(libm-tests); do \
          echo "Regenerating ULPs for $${run}"; \
          $(run-regen-ulps) -u -o $(objpfx); \
          cat $(objpfx)ULPs >> $(objpfx)libm-test-ulps; \