@@ -818,15 +818,20 @@ in-module = $(strip $(foreach lib,$(libof-$(basename $(@F))) $(libof-$(<F)) \
module-def = $(if $(in-module),$(in-module),-DIN_MODULE=MODULE_libc)
+# We don't need libc-modules.h and the IN_MODULE definition for
+# shlib-version.v.i.
+module-cppflags = $(if $(filter shlib-versions.v.i,$(@F)),,-include \
+ $(common-objpfx)libc-modules.h $(module-def))
+
# These are the variables that the implicit compilation rules use.
# Note that we can't use -std=* in CPPFLAGS, because it overrides
# the implicit -lang-asm and breaks cpp behavior for .S files--notably
# it causes cpp to stop predefining __ASSEMBLER__.
CPPFLAGS = $(config-extra-cppflags) $(CPPUNDEFS) $(CPPFLAGS-config) \
$($(subdir)-CPPFLAGS) \
- $(+includes) $(defines) \
+ $(+includes) $(defines) $(module-cppflags) \
-include $(..)include/libc-symbols.h $(sysdep-CPPFLAGS) \
- $(CPPFLAGS-$(suffix $@)) $(module-def) \
+ $(CPPFLAGS-$(suffix $@)) \
$(foreach lib,$(libof-$(basename $(@F))) \
$(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
$(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
@@ -840,16 +845,6 @@ override CXXFLAGS = $(c++-sysincludes) \
$(filter-out %frame-pointer,$(+cflags)) $(sysdep-CFLAGS) \
$(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) $(CFLAGS-$(@F))
-# Minimal CPPFLAGS for the initial compilations, i.e. syscall stubs, %.v.i,
-# etc.
-MIN-CPPFLAGS = $(config-extra-cppflags) $(CPPUNDEFS) $(CPPFLAGS-config) \
- $($(subdir)-CPPFLAGS) \
- $(+includes) $(defines) $(sysdep-CPPFLAGS) \
- -D_LIBC -include $(common-objpfx)config.h \
- $(CPPFLAGS-$(suffix $@)) \
- $(foreach lib,$(libof-$(basename $(@F))) \
- $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
- $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
# If everything is compiled with -fPIC (implicitly) we must tell this by
# defining the PIC symbol.
ifeq (yes,$(build-pic-default))
@@ -938,7 +933,7 @@ subdir-srcdirs = $(foreach dir,$(subdirs),\
%.v.i: $(common-objpfx)config.h $(..)Makeconfig
sed '/^[ ]*%/!s/#.*$$//;/^[ ]*$$/d;s/^[ ]*%/#/' \
$(filter-out FORCE %.h $(..)Makeconfig,$^) \
- | $(CC) -E -undef $(MIN-CPPFLAGS) -x assembler-with-cpp - \
+ | $(CC) -E -undef $(CPPFLAGS) -x assembler-with-cpp - \
> $@T
mv -f $@T $@
%.v: %.v.i
@@ -20,8 +20,6 @@
#ifndef _LIBC_SYMBOLS_H
#define _LIBC_SYMBOLS_H 1
-#include "libc-modules.h"
-
#define IS_IN(lib) (IN_MODULE == MODULE_##lib)
#define NOT_IN(lib) !IS_IN (lib)