S/390: Add hwcap value for transactional execution.
[platform/upstream/glibc.git] / Makerules
index 18aeb9e..56dc60b 100644 (file)
--- a/Makerules
+++ b/Makerules
@@ -243,7 +243,7 @@ $(common-objpfx)sysd-rules: $(common-objpfx)config.make $(..)Makerules \
           /*) ;;                                                             \
           *) dir="\$$(..)$$dir" ;;                                           \
           esac;                                                              \
-          asm='.S .s';                                                       \
+          asm='.S';                                                          \
           $(check-inhibit-asm)                                               \
           for o in $(all-object-suffixes); do                                \
             set $(subst :, ,$(sysd-rules-patterns));                         \
@@ -275,12 +275,6 @@ object-suffixes-left := $(all-object-suffixes)
 include $(o-iterator)
 
 define o-iterator-doit
-$(objpfx)%$o: %.s $(before-compile); $$(compile-command.s)
-endef
-object-suffixes-left := $(all-object-suffixes)
-include $(o-iterator)
-
-define o-iterator-doit
 $(objpfx)%$o: %.c $(before-compile); $$(compile-command.c)
 endef
 object-suffixes-left := $(all-object-suffixes)
@@ -304,12 +298,6 @@ object-suffixes-left := $(all-object-suffixes)
 include $(o-iterator)
 
 define o-iterator-doit
-$(objpfx)%$o: $(objpfx)%.s $(before-compile); $$(compile-command.s)
-endef
-object-suffixes-left := $(all-object-suffixes)
-include $(o-iterator)
-
-define o-iterator-doit
 $(objpfx)%$o: $(objpfx)%.c $(before-compile); $$(compile-command.c)
 endef
 object-suffixes-left := $(all-object-suffixes)
@@ -365,24 +353,31 @@ endif # sysd-sorted-done
 # Generate .dT files as we compile.
 compile-mkdep-flags = -MD -MP -MF $@.dt -MT $@
 compile-command.S = $(compile.S) $(OUTPUT_OPTION) $(compile-mkdep-flags)
-compile-command.s = $(COMPILE.s) $< $(OUTPUT_OPTION) $(compile-mkdep-flags)
 compile-command.c = $(compile.c) $(OUTPUT_OPTION) $(compile-mkdep-flags)
 compile-command.cc = $(compile.cc) $(OUTPUT_OPTION) $(compile-mkdep-flags)
 
+# Like compile-mkdep-flags, but for use with $(BUILD_CC).  We don't want to
+# track system includes here, they may spuriously trigger an install rule,
+# and would cause the check-local-headers test to fail.
+native-compile-mkdep-flags = -MMD -MP -MF $@.dt -MT $@
+
 # GCC can grok options after the file name, and it looks nicer that way.
 compile.c = $(CC) $< -c $(CFLAGS) $(CPPFLAGS)
 compile.cc = $(CXX) $< -c $(CXXFLAGS) $(CPPFLAGS)
 compile.S = $(CC) $< -c $(CPPFLAGS) $(S-CPPFLAGS) \
                  $(ASFLAGS) $(ASFLAGS-$(suffix $@))
+COMPILE.c = $(CC) -c $(CFLAGS) $(CPPFLAGS)
 COMPILE.S = $(CC) -c $(CPPFLAGS) $(S-CPPFLAGS) \
                  $(ASFLAGS) $(ASFLAGS-$(suffix $@))
-COMPILE.s = $(filter-out -pipe,$(CC)) -c $(ASFLAGS)
 
 # We need this for the output to go in the right place.  It will default to
 # empty if make was configured to work with a cc that can't grok -c and -o
 # together.  You can't compile the C library with such a compiler.
 OUTPUT_OPTION = -o $@
 
+# This is the end of the pipeline for compiling generated C code.
+compile-stdin.c = $(COMPILE.c) -o $@ -x c - $(compile-mkdep-flags)
+
 # We need the $(CFLAGS) to be in there to have the right predefines during
 # the dependency run for C sources.  But having it for assembly sources can
 # get the wrong predefines.
@@ -642,6 +637,7 @@ endif
 \f
 +depfiles := $(sources:.c=.d) \
             $(patsubst %.o,%.d,$(filter %.o,$(extra-objs:.os=.o))) \
+            $(patsubst %.oS,%.d,$(filter %.oS,$(extra-objs))) \
             $(patsubst %.o,%.d,$(filter %.o,$(extra-test-objs:.os=.o))) \
             $(addsuffix .d,$(tests) $(xtests) $(test-srcs))
 ifeq ($(build-programs),yes)
@@ -845,11 +841,11 @@ install-lib.so-unversioned := $(filter-out $(versioned), $(install-lib.so))
 #      $(inst_libdir)/libfoo.so        -- for linking, symlink or ld script
 #      $(inst_slibdir)/libfoo.so.NN    -- for loading by SONAME, symlink
 #      $(inst_slibdir)/libfoo-X.Y.Z.so -- the real shared object file
-V := $(firstword $($(subdir)-version) $(version))
+lib-version := $(firstword $($(subdir)-version) $(version))
 install-lib-nosubdir: $(install-lib.so-unversioned:%=$(inst_slibdir)/%) \
                      $(foreach L,$(install-lib.so-versioned),\
                                $(inst_libdir)/$L \
-                               $(inst_slibdir)/$(L:.so=)-$V.so \
+                               $(inst_slibdir)/$(L:.so=)-$(lib-version).so \
                                $(inst_slibdir)/$L$($L-version))
 
 # Install all the unversioned shared libraries.
@@ -1153,54 +1149,38 @@ ifeq ($(versioning),yes)
        mv -f $@T $@
 
 %.dynsym: %.so
-       $(OBJDUMP) --dynamic-syms $< > $@T
+       LC_ALL=C $(OBJDUMP) --dynamic-syms $< > $@T
        mv -f $@T $@
 
-check-abi-%: $(..)scripts/extract-abilist.awk $(common-objpfx)config.make \
-            $(..)abilist/%.abilist $(objpfx)%.symlist
+vpath %.abilist $(+sysdep_dirs)
+
+# The .PRECIOUS rule prevents the files built by an implicit rule whose
+# target pattern is %.symlist from being considered "intermediate files"
+# and automatically removed.  We only want these files to be removed by
+# 'make clean', which is handled by the 'generated' variable.
+.PRECIOUS: %.symlist
+generated += $(extra-libs:=.symlist)
+
+check-abi-%: $(common-objpfx)config.make %.abilist $(objpfx)%.symlist
        $(check-abi)
-check-abi-%: $(..)scripts/extract-abilist.awk $(common-objpfx)config.make \
-            $(..)abilist/%.abilist $(common-objpfx)%.symlist
+check-abi-%: $(common-objpfx)config.make %.abilist $(common-objpfx)%.symlist
        $(check-abi)
 define check-abi
-       LC_ALL=C \
-       $(AWK) -f $< -v 'config=$(check-abi-config)' \
-              $(patsubst %,-v 'lastversion=%',$($*-abi-frozen)) \
-              $(filter %.abilist,$^) \
-       | { diff -p -U 0 - $(filter %.symlist,$^) $(check-abi-warn) ; }
+       diff -p -U 0 $(filter %.abilist,$^) $(filter %.symlist,$^)
 endef
-ifeq ($(enable-check-abi),warn)
-check-abi-warn = || echo '*** WARNING: $*.so failed ABI check'
-endif
-
-ifeq ($(firstword $(sysd-sorted-done) f)$(firstword $(generating) f),tf)
-config-tls := thread
-check-abi-config := \
-  $(config-machine)-$(config-vendor)-$(config-os)/$(config-tls)
-endif
 
-update-abi-%: $(..)scripts/merge-abilist.awk $(..)abilist/%.abilist \
-             $(objpfx)%.symlist
+update-abi-%: $(objpfx)%.symlist %.abilist
        $(update-abi)
-update-abi-%: $(..)scripts/merge-abilist.awk $(..)abilist/%.abilist \
-             $(common-objpfx)%.symlist
+update-abi-%: $(common-objpfx)%.symlist %.abilist
        $(update-abi)
-ifndef update-abi-config
 define update-abi
-       @echo 'Run $(MAKE) $@ update-abi-config=REGEXP'; exit 2
-endef
-else
-define update-abi
-LC_ALL=C $(AWK) -v config='$(update-abi-config)' -f $^ \
-        > $(..)abilist/$*.abilist.new
-@if cmp -s $(..)abilist/$*.abilist.new $(..)abilist/$*.abilist 2> /dev/null; \
- then rm -f $(..)abilist/$*.abilist.new; \
-      echo '+++ $(..)abilist/$*.abilist is unchanged'; \
- else mv -f $(..)abilist/$*.abilist.new $(..)abilist/$*.abilist; \
-      echo '*** Now check $*.abilist changes for correctness ***'; \
+@if cmp -s $^ 2> /dev/null; \
+ then \
+      echo '+++ $(filter %.abilist,$^) is unchanged'; \
+ else cp -f $^; \
+      echo '*** Now check $(filter %.abilist,$^) changes for correctness ***'; \
  fi
 endef
-endif
 
 .PHONY: update-abi check-abi
 update-abi: $(patsubst %.so,update-abi-%,$(install-lib.so-versioned))
@@ -1220,12 +1200,10 @@ common-generated += libc.symlist
 endif
 
 ifeq ($(build-shared),yes)
-ifneq ($(enable-check-abi),no)
 ifdef subdir
 tests: check-abi
 endif
 endif
-endif
 
 endif
 
@@ -1245,7 +1223,7 @@ $(stdio_lim:h=st): $(..)stdio-common/stdio_lim.h.in $(..)Rules \
          echo '#define _LIBC 1';                                       \
          echo '#include "$(..)misc/sys/uio.h"'; } |                    \
        $(CC) -E -dM -MD -MP -MF $(@:st=dT) -MT '$(@:st=h) $(@:st=d)'   \
-             $(+includes) -xc - -o $(@:st=hT)
+             $(CPPUNDEFS) $(+includes) -xc - -o $(@:st=hT)
        sed $(sed-remove-objpfx) $(sed-remove-dotdot)                   \
            $(@:st=dT) > $(@:st=dt)
        mv -f $(@:st=dt) $(@:st=d)
@@ -1332,9 +1310,7 @@ common-clean: common-mostlyclean
        -rm -f $(gen-as-const-headers:%.sym=$(common-objpfx)%.h)
 \f
 # Produce a file `stubs' which contains `#define __stub_FUNCTION'
-# for each function which is a stub.  We grovel over all the .d files
-# looking for references to <stub-tag.h>.  Then we grovel over each
-# referenced source file to see what stub function it defines.
+# for each function which is a stub.
 
 ifdef objpfx
 .PHONY: stubs # The parent Makefile calls this target.