public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* Include most of elf/ modules-names in modules-names-tests
@ 2018-09-11 20:20 Joseph Myers
  2018-09-12 12:15 ` Joseph Myers
  0 siblings, 1 reply; 3+ messages in thread
From: Joseph Myers @ 2018-09-11 20:20 UTC (permalink / raw)
  To: libc-alpha; +Cc: zackw

I'm testing a patch to let the compiler expand calls to floor in libm
as built-in function calls as much as possible, instead of calling
__floor, so that no architecture-specific __floor inlines are needed,
and then to arrange for non-inlined calls to end up calling __floor,
as done with sqrt and __ieee754_sqrt.

This shows up elf/tst-relsort1mod2.c calling floor, which must not be
converted to a call to __floor.  Now, while an IS_IN (libm)
conditional could be added to the existing conditionals on such
redirections in include/math.h, the _ISOMAC conditional ought to
suffice (code in other glibc libraries shouldn't be calling floor or
sqrt anyway, as they aren't provided in libc and the other libraries
don't link with libm).  But while tests are mostly now built with
_ISOMAC defined, test modules in modules-names aren't unless also
listed in modules-names-tests.

As far as I can see, all the modules in modules-names in elf/ are in
fact parts of tests and so listing them in modules-names-tests is
appropriate, so they get built with something closer to the headers
used for user code, except in a few cases that actually rely on
something from internal headers.  This patch duly sets
modules-names-tests there accordingly (filtering out those tests that
fail to build without internal headers).

Tested for x86_64.

2018-09-11  Joseph Myers  <joseph@codesourcery.com>

	* elf/Makefile (modules-names-tests): New variable.

diff --git a/elf/Makefile b/elf/Makefile
index cd0771307f..05430b30d3 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -274,6 +274,8 @@ modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \
 		tst-nodelete-dlclose-dso tst-nodelete-dlclose-plugin \
 		tst-main1mod tst-libc_dlvsym-dso tst-absolute-sym-lib \
 		tst-absolute-zero-lib tst-big-note-lib
+modules-names-tests = $(filter-out ifuncmod% tst-libc_dlvsym-dso,\
+				   $(modules-names))
 
 ifeq (yes,$(have-mtls-dialect-gnu2))
 tests += tst-gnu2-tls1

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Include most of elf/ modules-names in modules-names-tests
  2018-09-11 20:20 Include most of elf/ modules-names in modules-names-tests Joseph Myers
@ 2018-09-12 12:15 ` Joseph Myers
  2018-09-12 12:39   ` Florian Weimer
  0 siblings, 1 reply; 3+ messages in thread
From: Joseph Myers @ 2018-09-12 12:15 UTC (permalink / raw)
  To: libc-alpha; +Cc: zackw

Here is a revised version, also excluding tst-tlsmod% from 
modules-names-tests because build-many-glibcs.py showed that those need 
internal headers on some architectures.


Include most of elf/ modules-names in modules-names-tests.

I'm testing a patch to let the compiler expand calls to floor in libm
as built-in function calls as much as possible, instead of calling
__floor, so that no architecture-specific __floor inlines are needed,
and then to arrange for non-inlined calls to end up calling __floor,
as done with sqrt and __ieee754_sqrt.

This shows up elf/tst-relsort1mod2.c calling floor, which must not be
converted to a call to __floor.  Now, while an IS_IN (libm)
conditional could be added to the existing conditionals on such
redirections in include/math.h, the _ISOMAC conditional ought to
suffice (code in other glibc libraries shouldn't be calling floor or
sqrt anyway, as they aren't provided in libc and the other libraries
don't link with libm).  But while tests are mostly now built with
_ISOMAC defined, test modules in modules-names aren't unless also
listed in modules-names-tests.

As far as I can see, all the modules in modules-names in elf/ are in
fact parts of tests and so listing them in modules-names-tests is
appropriate, so they get built with something closer to the headers
used for user code, except in a few cases that actually rely on
something from internal headers.  This patch duly sets
modules-names-tests there accordingly (filtering out those tests that
fail to build without internal headers).

Tested for x86_64, and with build-many-glibcs.py.

2018-09-12  Joseph Myers  <joseph@codesourcery.com>

	* elf/Makefile (modules-names-tests): New variable.

diff --git a/elf/Makefile b/elf/Makefile
index cd0771307f..dd0fd83b57 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -274,6 +274,8 @@ modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \
 		tst-nodelete-dlclose-dso tst-nodelete-dlclose-plugin \
 		tst-main1mod tst-libc_dlvsym-dso tst-absolute-sym-lib \
 		tst-absolute-zero-lib tst-big-note-lib
+modules-names-tests = $(filter-out ifuncmod% tst-libc_dlvsym-dso tst-tlsmod%,\
+				   $(modules-names))
 
 ifeq (yes,$(have-mtls-dialect-gnu2))
 tests += tst-gnu2-tls1

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Include most of elf/ modules-names in modules-names-tests
  2018-09-12 12:15 ` Joseph Myers
@ 2018-09-12 12:39   ` Florian Weimer
  0 siblings, 0 replies; 3+ messages in thread
From: Florian Weimer @ 2018-09-12 12:39 UTC (permalink / raw)
  To: Joseph Myers, libc-alpha; +Cc: zackw

On 09/12/2018 02:15 PM, Joseph Myers wrote:
> +modules-names-tests = $(filter-out ifuncmod% tst-libc_dlvsym-dso tst-tlsmod%,\
> +				   $(modules-names))

Perhaps add a comment that the reliance on internal headers is the 
reason for filtering out these module names?

Patch looks fine to me otherwise.

Thanks,
Florian

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-09-12 12:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-11 20:20 Include most of elf/ modules-names in modules-names-tests Joseph Myers
2018-09-12 12:15 ` Joseph Myers
2018-09-12 12:39   ` Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).