From 16cd816fd04bd3982c5333c2df76c88e39031522 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Wed, 30 Jan 2008 00:24:16 +0000 Subject: [PATCH] * Makeconfig (sysd-rules-patterns): New variable. * Makerules ($(common-objpfx)sysd-rules): Drive the loop from that. (check-inhibit-asm): New canned sequence, replaces ... (open-check-inhibit-asm, close-check-inhibit-asm): ... these, removed. * elf/rtld-Rules ($(objpfx)rtld-%.os): Use $(rtld-CPPFLAGS) in commands. (rtld-CPPFLAGS): Renamed from CPPFLAGS-rtld. (CFLAGS-rtld): Variable removed. --- ChangeLog | 10 ++++++++++ Makeconfig | 9 ++++++++- Makerules | 53 +++++++++++++++++++---------------------------------- elf/rtld-Rules | 22 ++++++++-------------- nptl/ChangeLog | 6 +++++- nptl/Makeconfig | 6 +++++- 6 files changed, 55 insertions(+), 51 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1da64eea06..e412c558b4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-01-29 Roland McGrath + + * Makeconfig (sysd-rules-patterns): New variable. + * Makerules ($(common-objpfx)sysd-rules): Drive the loop from that. + (check-inhibit-asm): New canned sequence, replaces ... + (open-check-inhibit-asm, close-check-inhibit-asm): ... these, removed. + * elf/rtld-Rules ($(objpfx)rtld-%.os): Use $(rtld-CPPFLAGS) in commands. + (rtld-CPPFLAGS): Renamed from CPPFLAGS-rtld. + (CFLAGS-rtld): Variable removed. + 2008-01-24 Roland McGrath * configure.in: Let configure fragments set base_os. diff --git a/Makeconfig b/Makeconfig index e768cb1339..d7cf0aa031 100644 --- a/Makeconfig +++ b/Makeconfig @@ -1,4 +1,5 @@ -# Copyright (C) 1991-2003,2004,2005,2006,2007 Free Software Foundation, Inc. +# Copyright (C) 1991-2003,2004,2005,2006,2007,2008 +# Free Software Foundation, Inc. # This file is part of the GNU C Library. # The GNU C Library is free software; you can redistribute it and/or @@ -931,6 +932,12 @@ $(common-objpfx)sysd-sorted: $(..)scripts/gen-sorted.awk \ $(all-Depend-files): ; endif +# This gives partial TARGET:SOURCE pattern pairs to have rules +# emitted into sysd-rules. A sysdeps Makeconfig fragment can +# add its own special object file prefix to this list with e.g. foo-%:% +# to have foo-*.? compiled from *.? using $(foo-CPPFLAGS). +sysd-rules-patterns := %:% rtld-%:% m_%:s_% + # Let sysdeps/ subdirs contain a Makeconfig fragment for us to include here. sysdep-makeconfigs := $(wildcard $(+sysdep_dirs:=/Makeconfig)) ifneq (,$(sysdep-makeconfigs)) diff --git a/Makerules b/Makerules index db83b24ffe..3661ad4e9d 100644 --- a/Makerules +++ b/Makerules @@ -1,4 +1,4 @@ -# Copyright (C) 1991-2006, 2007 Free Software Foundation, Inc. +# Copyright (C) 1991-2006, 2007, 2008 Free Software Foundation, Inc. # This file is part of the GNU C Library. # The GNU C Library is free software; you can redistribute it and/or @@ -207,10 +207,9 @@ endif # patterns matching sysdep directories whose assembly source files should # be suppressed. ifdef inhibit-sysdep-asm -define open-check-inhibit-asm -case $$sysdir in $(subst $(empty) ,|,$(inhibit-sysdep-asm))) : ;; *) +define check-inhibit-asm +case $$sysdir in $(subst $(empty) ,|,$(inhibit-sysdep-asm))) asm= ;; esac; endef -close-check-inhibit-asm = ;; esac ; endif -include $(common-objpfx)sysd-rules @@ -229,36 +228,22 @@ $(common-objpfx)sysd-rules: $(common-objpfx)config.make $(..)Makerules \ /*) ;; \ *) dir="\$$(..)$$dir" ;; \ esac; \ - for o in $(all-object-suffixes); do \ - $(open-check-inhibit-asm) \ - echo "\$$(objpfx)%$$o: $$dir/%.S \$$(before-compile); \ - \$$(compile-command.S)"; \ - echo "\$$(objpfx)%$$o: $$dir/%.s \$$(before-compile); \ - \$$(compile-command.s)"; \ - echo "\$$(objpfx)rtld-%$$o: $$dir/%.S \$$(before-compile); \ - \$$(compile-command.S)"; \ - echo "\$$(objpfx)rtld-%$$o: $$dir/%.s \$$(before-compile); \ - \$$(compile-command.s)"; \ - echo "\$$(objpfx)ptw-%$$o: $$dir/%.S \$$(before-compile); \ - \$$(compile-command.S) -DPTW"; \ - echo "\$$(objpfx)ptw-%$$o: $$dir/%.s \$$(before-compile); \ - \$$(compile-command.s) -DPTW"; \ - echo "\$$(objpfx)m_%$$o: $$dir/s_%.S \$$(before-compile); \ - \$$(compile-command.S)"; \ - echo "\$$(objpfx)m_%$$o: $$dir/s_%.s \$$(before-compile); \ - \$$(compile-command.s)"; \ - $(close-check-inhibit-asm) \ - echo "\$$(objpfx)%$$o: $$dir/%.c \$$(before-compile); \ - \$$(compile-command.c)"; \ - echo "\$$(objpfx)rtld-%$$o: $$dir/%.c \$$(before-compile); \ - \$$(compile-command.c)"; \ - echo "\$$(objpfx)ptw-%$$o: $$dir/%.c \$$(before-compile); \ - \$$(compile-command.c) -DPTW"; \ - echo "\$$(objpfx)m_%$$o: $$dir/s_%.c \$$(before-compile); \ - \$$(compile-command.c)"; \ - done; \ - echo "\$$(inst_includedir)/%.h: $$dir/%.h \$$(+force); \ - \$$(do-install)"; \ + asm='.S .s'; \ + $(check-inhibit-asm) \ + for o in $(all-object-suffixes); do \ + set $(subst :, ,$(sysd-rules-patterns)); \ + while [ $$# -ge 2 ]; do \ + t=$$1; shift; \ + d=$$1; shift; \ + v=$${t%%%}; [ x"$$v" = x ] || v="\$$($${v}CPPFLAGS)"; \ + for s in $$asm .c; do \ + echo "\$$(objpfx)$$t$$o: $$dir/$$d$$s \$$(before-compile)"; \ + echo " \$$(compile-command$$s) $$v"; \ + done; \ + done; \ + done; \ + echo "\$$(inst_includedir)/%.h: $$dir/%.h \$$(+force)"; \ + echo " \$$(do-install)"; \ done; \ echo 'sysd-rules-done = t') > $@T mv -f $@T $@ diff --git a/elf/rtld-Rules b/elf/rtld-Rules index 01fbbdf0c5..9f31a560e5 100644 --- a/elf/rtld-Rules +++ b/elf/rtld-Rules @@ -1,6 +1,6 @@ # Subroutine makefile for compiling libc modules linked into dynamic linker. -# Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2005, 2006, 2008 Free Software Foundation, Inc. # This file is part of the GNU C Library. # The GNU C Library is free software; you can redistribute it and/or @@ -93,9 +93,12 @@ else # These are the basic compilation rules corresponding to the Makerules ones. # The sysd-rules generated makefile already defines pattern rules for rtld-% # targets built from sysdeps source files. -$(objpfx)rtld-%.os: %.S $(before-compile); $(compile-command.S) -$(objpfx)rtld-%.os: %.s $(before-compile); $(compile-command.s) -$(objpfx)rtld-%.os: %.c $(before-compile); $(compile-command.c) +$(objpfx)rtld-%.os: %.S $(before-compile) + $(compile-command.S) $(rtld-CPPFLAGS) +$(objpfx)rtld-%.os: %.s $(before-compile) + $(compile-command.s) $(rtld-CPPFLAGS) +$(objpfx)rtld-%.os: %.c $(before-compile) + $(compile-command.c) $(rtld-CPPFLAGS) # The rules for generated source files. $(objpfx)rtld-%.os: $(objpfx)%.S $(before-compile); $(compile-command.S) @@ -118,16 +121,7 @@ ifdef rtld-depfiles -include $(rtld-depfiles) endif -# Just in case we wind up e.g. regenerating dependencies for non-rtld objects, -# we don't unconditionally modify the flags. For rtld-% targets, use the -# special flags set below. -CFLAGS += $(if $(filter rtld-%,$(@F)),$(CFLAGS-rtld)) -CPPFLAGS += $(if $(filter rtld-%,$(@F)),$(CPPFLAGS-rtld)) - - # This here is the whole point of all the shenanigans. -CPPFLAGS-rtld := -DNOT_IN_libc=1 -DIS_IN_rtld=1 -CFLAGS-rtld := # blah - +rtld-CPPFLAGS := -DNOT_IN_libc=1 -DIS_IN_rtld=1 endif diff --git a/nptl/ChangeLog b/nptl/ChangeLog index b1f89484dd..09c7d07587 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,3 +1,7 @@ +2008-01-29 Roland McGrath + + * Makeconfig (ptw-CPPFLAGS, sysd-rules-patterns): New variables. + 2008-01-22 Kaz Kojima * sysdeps/unix/sysv/linux/sh/sem_post.S: Don't overflow value field. @@ -15,7 +19,7 @@ * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S (pthread_rwlock_timedrdlock): Return correct return value. * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S - (pthread_rwlock_timedwrlock): Likewise. + (pthread_rwlock_timedwrlock): Likewise. 2008-01-15 Ulrich Drepper diff --git a/nptl/Makeconfig b/nptl/Makeconfig index 54e2f65b01..c6a8e46132 100644 --- a/nptl/Makeconfig +++ b/nptl/Makeconfig @@ -1,4 +1,4 @@ -# Copyright (C) 2002,2003,2005,2006 Free Software Foundation, Inc. +# Copyright (C) 2002,2003,2005,2006,2008 Free Software Foundation, Inc. # This file is part of the GNU C Library. # Contributed by Ulrich Drepper , 2002. @@ -28,3 +28,7 @@ static-thread-library = $(common-objpfx)nptl/libpthread.a bounded-thread-library = $(common-objpfx)nptl/libpthread_b.a rpath-dirs += nptl + +# This makes for ptw-*.? object rules in sysd-rules. +ptw-CPPFLAGS := -DPTW +sysd-rules-patterns += ptw-%:% -- 2.11.4.GIT