]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
* cppflags-iterator.mk (CPPFLAGS-$(cpp-src)): Variable removed.
authorRoland McGrath <roland@gnu.org>
Wed, 16 Oct 2002 22:09:55 +0000 (22:09 +0000)
committerRoland McGrath <roland@gnu.org>
Wed, 16 Oct 2002 22:09:55 +0000 (22:09 +0000)
instead of += to append, to be sure $(lib) gets expanded at defn time.
(libof-$(cpp-src)): New variable, define this instead.
* extra-lib.mk (cpp-srcs-left): Reduce duplication in include setup.
(lib): Don't use override.
(CPPFLAGS-$(lib)): New variable, put -D's here.
* Makeconfig (CPPFLAGS): Use basename fn for CPPFLAGS-basename.
Also add $(CPPFLAGS-LIB) before the file-specific flags, for each
LIB found by $(libof-*) for basename, target, or source.
* Makerules (CPPFLAGS-nonlib): New variable.
* nscd/Makefile (lib): Set to nonlib when using cppflags-iterator.mk.
* locale/Makefile (lib): Likewise.
* sunrpc/Makefile (lib): Likewise.

* sysdeps/unix/sysv/linux/fpathconf.c (LINUX_LINK_MAX): Move macro ...
* sysdeps/unix/sysv/linux/linux_fsinfo.h (LINUX_LINK_MAX): ... here.
* sysdeps/unix/sysv/linux/pathconf.h: New file.
(statfs_link_max): New function, guts from fpathconf.c.
* sysdeps/unix/sysv/linux/fpathconf.c: Rewritten using that.
* sysdeps/unix/sysv/linux/pathconf.c (__pathconf): Likewise.
* sysdeps/unix/sysv/linux/alpha/pathconf.c (__pathconf): Rewritten
to use the linux/pathconf.c code by #include rather than duplication.
* sysdeps/unix/sysv/linux/alpha/fpathconf.c (__pathconf): Likewise.

2002-10-16  Jakub Jelinek  <jakub@redhat.com>

* sysdeps/unix/sysv/linux/x86_64/sysdep.h (SYSCALL_ERROR_HANDLER):
Use __libc_errno only for libc itself.

ChangeLog
Makeconfig
Makerules
cppflags-iterator.mk
extra-lib.mk
locale/Makefile
nscd/Makefile
sunrpc/Makefile
sysdeps/unix/sysv/linux/x86_64/sysdep.h

index 124102b00e7bfc14153c4c2f764b96b8ae253fce..603482dca4d63d745ca22db696fe6339e84ba2df 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,34 @@
+2002-10-16  Roland McGrath  <roland@redhat.com>
+
+       * cppflags-iterator.mk (CPPFLAGS-$(cpp-src)): Variable removed.
+       instead of += to append, to be sure $(lib) gets expanded at defn time.
+       (libof-$(cpp-src)): New variable, define this instead.
+       * extra-lib.mk (cpp-srcs-left): Reduce duplication in include setup.
+       (lib): Don't use override.
+       (CPPFLAGS-$(lib)): New variable, put -D's here.
+       * Makeconfig (CPPFLAGS): Use basename fn for CPPFLAGS-basename.
+       Also add $(CPPFLAGS-LIB) before the file-specific flags, for each
+       LIB found by $(libof-*) for basename, target, or source.
+       * Makerules (CPPFLAGS-nonlib): New variable.
+       * nscd/Makefile (lib): Set to nonlib when using cppflags-iterator.mk.
+       * locale/Makefile (lib): Likewise.
+       * sunrpc/Makefile (lib): Likewise.
+
+       * sysdeps/unix/sysv/linux/fpathconf.c (LINUX_LINK_MAX): Move macro ...
+       * sysdeps/unix/sysv/linux/linux_fsinfo.h (LINUX_LINK_MAX): ... here.
+       * sysdeps/unix/sysv/linux/pathconf.h: New file.
+       (statfs_link_max): New function, guts from fpathconf.c.
+       * sysdeps/unix/sysv/linux/fpathconf.c: Rewritten using that.
+       * sysdeps/unix/sysv/linux/pathconf.c (__pathconf): Likewise.
+       * sysdeps/unix/sysv/linux/alpha/pathconf.c (__pathconf): Rewritten
+       to use the linux/pathconf.c code by #include rather than duplication.
+       * sysdeps/unix/sysv/linux/alpha/fpathconf.c (__pathconf): Likewise.
+
+2002-10-16  Jakub Jelinek  <jakub@redhat.com>
+
+       * sysdeps/unix/sysv/linux/x86_64/sysdep.h (SYSCALL_ERROR_HANDLER):
+       Use __libc_errno only for libc itself.
+
 2002-10-16  Andreas Jaeger  <aj@suse.de>
 
        * sysdeps/x86_64/_mcount.S: Fix off-by-1 error in argument access.
index dd03ae803e6c8f9a539060132439f6cc210f5150..b6a1b4aeb10530efeac945a04e34e87e9c9f9814 100644 (file)
@@ -632,8 +632,10 @@ libio-include = -I$(..)libio
 # it causes cpp to stop predefining __ASSEMBLER__.
 CPPFLAGS = $($(subdir)-CPPFLAGS) $(+includes) $(defines) \
           -include $(..)include/libc-symbols.h $(sysdep-CPPFLAGS) \
-          $(CPPFLAGS-$(suffix $@)) $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) \
-          $(CPPFLAGS-$(patsubst %$(suffix $@),%,$(@F)))
+          $(CPPFLAGS-$(suffix $@)) \
+          $(foreach L,$(libof-$(basename $(@F))) $(libof-$<) $(libof-$(@F)),\
+                    $(CPPFLAGS-$L)) \
+          $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
 override CFLAGS        = -std=gnu99 \
                  $(filter-out %frame-pointer,$(+cflags)) $(sysdep-CFLAGS) \
                  $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) $(CFLAGS-$(@F))
index 3fa3f63a7f4e0b34493577b3e08dea94b44947db..d66feb5b75bb076d223840c3b99425e41e6fc22c 100644 (file)
--- a/Makerules
+++ b/Makerules
@@ -1057,9 +1057,12 @@ xcheck: xtests
 all-nonlib = $(strip $(tests) $(xtests) $(test-srcs) $(test-extras) $(others))
 ifneq (,$(all-nonlib))
 cpp-srcs-left = $(all-nonlib:=.c)
-lib := tests
+lib := nonlib
 include $(patsubst %,$(..)cppflags-iterator.mk,$(all-nonlib))
 endif
+
+# The include magic above causes those files to use this variable for flags.
+CPPFLAGS-nonlib = -DNOT_IN_libc=1
 \f
 .PHONY: TAGS
 TAGS: $(objpfx)distinfo $(..)MakeTAGS
index 26db7b042eee7e2205c641cd480eaaa15a633c42..d4e6375416a1b712ed85b5c8cff990f39d67ad7c 100644 (file)
@@ -4,4 +4,4 @@
 cpp-src := $(firstword $(cpp-srcs-left))
 cpp-srcs-left := $(filter-out $(cpp-src),$(cpp-srcs-left))
 
-CPPFLAGS-$(cpp-src) += -DNOT_IN_libc=1 -DIS_IN_$(lib)=1
+libof-$(cpp-src) := $(lib)
index d48f0faaa188eed2ef8d603c4e16f61b377944bc..5428523e06d13d8025fb827061129068ad35d3fd 100644 (file)
@@ -6,7 +6,7 @@
 # to be included in that library.  A sysdep Makefile can add to
 # $(lib)-sysdep_routines to include additional modules.
 
-override lib := $(firstword $(extra-libs-left))
+lib := $(firstword $(extra-libs-left))
 extra-libs-left := $(filter-out $(lib),$(extra-libs-left))
 
 object-suffixes-$(lib) := $(filter-out $($(lib)-inhibit-o),$(object-suffixes))
@@ -79,12 +79,10 @@ endif
 
 endif
 
-cpp-srcs-left = $(lib)-routines
-ifneq (,$($(lib)-routines))
-cpp-srcs-left = $($(lib)-routines)
-include $(patsubst %,$(..)cppflags-iterator.mk,$($(lib)-routines))
-endif
-ifneq (,$($(lib)-sysdep_routines))
-cpp-srcs-left = $($(lib)-sysdep_routines)
-include $(patsubst %,$(..)cppflags-iterator.mk,$($(lib)-sysdep_routines))
+# This will define `libof-ROUTINE := LIB' for each of the routines.
+cpp-srcs-left := $($(lib)-routines) $($(lib)-sysdep_routines)
+ifneq (,$(cpp-srcs-left))
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
 endif
+
+CPPFLAGS-$(lib) := -DNOT_IN_libc=1 -DIS_IN_$(lib)=1
index ec47bde054959fe154a54054a62035a8934a3141..976926bb8e742011d78092629a86195d280cc92a 100644 (file)
@@ -104,7 +104,7 @@ CFLAGS-charmap-dir.c = -Wno-write-strings
 # This makes sure -DNOT_IN_libc is passed for all these modules.
 cpp-srcs-left := $(addsuffix .c,$(localedef-modules) $(localedef-aux) \
                                $(locale-modules) $(lib-modules))
-lib := locale_programs
+lib := nonlib
 include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
 
 # Depend on libc.so so a DT_NEEDED is generated in the shared objects.
index 0bd320e40221b0f0ed7fff480c1b87d5e76d8822..e3c7af9c0a72044f5c8bec2c30175c734836e7cd 100644 (file)
@@ -55,7 +55,7 @@ include ../Rules
 
 # This makes sure -DNOT_IN_libc is passed for all these modules.
 cpp-srcs-left := $(nscd-modules:=.c)
-lib := nscd
+lib := nonlib
 include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
 
 $(objpfx)nscd: $(nscd-modules:%=$(objpfx)%.o)
index f80b190d14e2d9c7bec7e9bf0c93c78a35476327..9ee809ff215dad773ff35d2058cdf213ad7a558c 100644 (file)
@@ -132,7 +132,7 @@ $(objpfx)rpcgen: $(addprefix $(objpfx),$(rpcgen-objs)) \
 
 # This makes sure -DNOT_IN_libc is passed for all these modules.
 cpp-srcs-left := $(rpcgen-objs:.o=.c)
-lib := rpcgen
+lib := nonlib
 include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
 
 # Tell rpcgen where to find the C preprocessor.
index adccc50bbaa21ff50c2473b77098647bd7439b0c..2da4d41fac8a24c5ce05396c33723018e6b2da76 100644 (file)
   orq $-1, %rax;                               \
   jmp L(pseudo_end);
 #elif USE___THREAD
+# ifndef NOT_IN_libc
+#  define SYSCALL_ERROR_ERRNO __libc_errno
+# else
+#  define SYSCALL_ERROR_ERRNO errno
+# endif
 # define SYSCALL_ERROR_HANDLER                 \
 0:                                             \
-  movq __libc_errno@GOTTPOFF(%rip), %rcx;      \
+  movq SYSCALL_ERROR_ERRNO@GOTTPOFF(%rip), %rcx;\
   xorq %rdx, %rdx;                             \
   subq %rax, %rdx;                             \
   movl %edx, %fs:(%rcx);                       \