]> git.ipfire.org Git - thirdparty/glibc.git/commit
Add new macro IN_MODULE to identify module in which source is built
authorSiddhesh Poyarekar <siddhesh@redhat.com>
Thu, 21 Aug 2014 04:49:31 +0000 (10:19 +0530)
committerSiddhesh Poyarekar <siddhesh@redhat.com>
Wed, 5 Nov 2014 10:39:39 +0000 (16:09 +0530)
commit7f51e884dd4b86c95198a2f0492df33501c44916
tree8a565c6e51b8df654f37e0c4656655a040f4b690
parent29955b5d9658b02d3a678d1f785db3d1e63184ca
Add new macro IN_MODULE to identify module in which source is built

The current scheme to identify which module a translation unit is
built in depends on defining multiple macros IS_IN_* and also defining
NOT_IN_libc if we're building a non-libc module.  In addition, there
is an IN_LIB macro that does effectively the same thing, but for
different modules (notably the systemtap probes).  This macro scheme
unifies both ideas to use just one macro IN_MODULE and assign it a
value depending on the module it is being built into.  If the module
is not defined, it defaults to MODULE_libc.

Patches that follow will remove uses of IS_IN_* variables with the
IS_IN() macro.  libc-symbols.h has been converted already to give an
example of how such a transition will look.

Verified that there are no relevant source changes.  One source change
that will crop up repeatedly is that of nscd_stat, since it uses the
build timestamp as a constant in its logic.

* Makeconfig (in-module): Get value of libof set for the
translation unit.
(module-def): Set IN_MODULE based on value of libof-*.
(CPPFLAGS): Add $(module-def) to CPPFLAGS.
* Makerules: Don't suffix routine names for nonlib.
* include/libc-modules.h: New file.
* include/libc-symbols.h: Include libc-modules.h
(IS_IN): New macro to replace IS_IN_* macros.
* elf/Makefile: Set libof-* for each routine.
* elf/rtld-Rules: Likewise.
* extra-modules.mk: Likewise.
* iconv/Makefile: Likewise.
* iconvdata/Makefile: Likewise.
* locale/Makefile: Likewise.
* malloc/Makefile: Likewise.
* nss/Makefile: Likewise.
* sysdeps/gnu/Makefile: Likewise.
* sysdeps/ieee754/ldbl-opt/Makefile: Likewise.
* sysdeps/unix/sysv/linux/Makefile: Likewise.
* sysdeps/s390/s390-64/Makefile: Likewise.
* nscd/Makefile: Set libof-* for each routine.  Set CFLAGS and
CPPFLAGS for nscd instead of nonlib.
17 files changed:
Makeconfig
Makerules
elf/Makefile
elf/rtld-Rules
extra-modules.mk
iconv/Makefile
iconvdata/Makefile
include/libc-modules.h [new file with mode: 0644]
include/libc-symbols.h
locale/Makefile
malloc/Makefile
nscd/Makefile
nss/Makefile
stdlib/Makefile
sysdeps/gnu/Makefile
sysdeps/s390/s390-64/Makefile
sysdeps/unix/sysv/linux/Makefile