about summary refs log tree commit diff
diff options
context:
space:
mode:
authorStan Shebs <stanshebs@google.com>2018-02-07 13:00:02 -0800
committerStan Shebs <stanshebs@google.com>2018-02-07 13:00:02 -0800
commit357524c07e92370a0fc755d4592e0082e52edff3 (patch)
tree33316e2da3b150be7ea117ab75f2e06cdc4df699
parentb20dc55e0adfddf1f6b2e024fbfa0d3a1c4b1dfe (diff)
downloadglibc-shebs/clangify.tar.gz
glibc-shebs/clangify.tar.xz
glibc-shebs/clangify.zip
Use clang integrated assembler except when asm is output and not required to be valid shebs/clangify
-rw-r--r--Makeconfig5
-rw-r--r--Makerules10
2 files changed, 8 insertions, 7 deletions
diff --git a/Makeconfig b/Makeconfig
index 24b8d44959..695c3f81f1 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -907,7 +907,6 @@ ifeq ($(with-clang),yes)
 # Non-string format arguments come from debugging prints in ld.so.
 +cflags += -Wno-format-security
 
-+cflags += -no-integrated-as
 endif	# with-clang == yes
 
 +cflags += $(cflags-cpu) $(+gccwarn) $(+merge-constants) $(+math-flags) \
@@ -1060,10 +1059,6 @@ ASFLAGS := $(filter -g% -fdebug-prefix-map=%,$(CFLAGS))
 endif
 ASFLAGS += -Werror=undef $(ASFLAGS-config) $(asflags-cpu)
 
-ifeq ($(with-clang),yes)
-ASFLAGS += -no-integrated-as
-endif	# with-clang == yes
-
 ifndef BUILD_CC
 BUILD_CC = $(CC)
 endif
diff --git a/Makerules b/Makerules
index 35147191e7..9db5fb55c0 100644
--- a/Makerules
+++ b/Makerules
@@ -225,6 +225,11 @@ sed-remove-dotdot := -e 's@  *\([^ 	\/$$][^ 	\]*\)@ $$(..)\1@g' \
 		     -e 's@^\([^ 	\/$$][^ 	\]*\)@$$(..)\1@g'
 endif
 
+MOARFLAGS =
+ifeq ($(with-clang),yes)
+MOARFLAGS = -no-integrated-as
+endif
+
 ifdef gen-py-const-headers
 # We'll use a static pattern rule to match .pysym files with their
 # corresponding generated .py files.
@@ -260,7 +265,7 @@ $(py-const): $(py-const-dir)%.py: %.pysym $(py-const-script) \
 	     $(common-before-compile)
 	$(make-target-directory)
 	$(AWK) -f $(py-const-script) $< \
-	       | $(CC) -S -o $@.tmp $(CFLAGS) $(CPPFLAGS) -x c -
+	       | $(CC) -S $(MOARFLAGS) -o $@.tmp $(CFLAGS) $(CPPFLAGS) -x c -
 	echo '# GENERATED FILE\n' > $@.tmp2
 	echo '# Constant definitions for pretty printers.' >> $@.tmp2
 	echo '# See gen-py-const.awk for details.\n' >> $@.tmp2
@@ -276,10 +281,11 @@ ifdef gen-as-const-headers
 # Generating headers for assembly constants.
 # We need this defined early to get into before-compile before
 # it's used in sysd-rules, below.
+# clang's integrated assembler doesn't like the freaky tokens.
 $(common-objpfx)%.h $(common-objpfx)%.h.d: $(..)scripts/gen-as-const.awk \
 					   %.sym $(common-before-compile)
 	$(AWK) -f $< $(filter %.sym,$^) \
-	| $(CC) -S -o $(@:.h.d=.h)T3 $(CFLAGS) $(CPPFLAGS) -x c - \
+	| $(CC) -S $(MOARFLAGS) -o $(@:.h.d=.h)T3 $(CFLAGS) $(CPPFLAGS) -x c - \
 		-MD -MP -MF $(@:.h=.h.d)T -MT '$(@:.h=.h.d) $(@:.h.d=.h)'
 	sed -n 's/^.*@@@name@@@\([^@]*\)@@@value@@@[^0-9Xxa-fA-F-]*\([0-9Xxa-fA-F-][0-9Xxa-fA-F-]*\).*@@@end@@@.*$$/#define \1 \2/p' \
 		$(@:.h.d=.h)T3 > $(@:.h.d=.h)T