Skip to contentSkip to conversation

correctly use gcc's -x option

PATCH In review Jan Beulich 2 participants 2 messages Feb 28, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 correctly use gcc's -x option

In Linux the improper use was found to cause problems with certain distributed build environments. Even if not directly affecting us, be on the safe side.

Config.mk +1 -1
@@ -101,7 +101,7 @@ PYTHON_PREFIX_ARG ?= --prefix="$(PREFIX)
 #
 # Usage: cflags-y += $(call cc-option,$(CC),-march=winchip-c6,-march=i586)
 cc-option = $(shell if test -z "`echo 'void*p=1;' | \
-              $(1) $(2) -S -o /dev/null -xc - 2>&1 | grep -- $(2) -`"; \
+              $(1) $(2) -S -o /dev/null -x c - 2>&1 | grep -- $(2) -`"; \
               then echo "$(2)"; else echo "$(3)"; fi ;)
 
 # cc-option-add: Add an option to compilation flags, but only if supported.
xen/include/Makefile +1 -1
@@ -81,7 +81,7 @@ ifeq ($(XEN_TARGET_ARCH),$(XEN_COMPILE_A
 all: headers.chk
 
 headers.chk: $(filter-out public/arch-% public/%ctl.h public/xsm/% public/%hvm/save.h, $(wildcard public/*.h public/*/*.h) $(public-y)) Makefile
-	for i in $(filter %.h,$^); do $(CC) -ansi -include stdint.h -Wall -W -Werror -S -o /dev/null -xc $$i || exit 1; echo $$i; done >[email protected]
+	for i in $(filter %.h,$^); do $(CC) -ansi -include stdint.h -Wall -W -Werror -S -o /dev/null -x c $$i || exit 1; echo $$i; done >[email protected]
 	mv [email protected] $@
 
 endif

correctly use gcc's -x option

In Linux the improper use was found to cause problems with certain distributed build environments. Even if not directly affecting us, be on the safe side.

Config.mk +1 -1
@@ -101,7 +101,7 @@ PYTHON_PREFIX_ARG ?= --prefix="$(PREFIX)
 #
 # Usage: cflags-y += $(call cc-option,$(CC),-march=winchip-c6,-march=i586)
 cc-option = $(shell if test -z "`echo 'void*p=1;' | \
-              $(1) $(2) -S -o /dev/null -xc - 2>&1 | grep -- $(2) -`"; \
+              $(1) $(2) -S -o /dev/null -x c - 2>&1 | grep -- $(2) -`"; \
               then echo "$(2)"; else echo "$(3)"; fi ;)
 
 # cc-option-add: Add an option to compilation flags, but only if supported.
xen/include/Makefile +1 -1
@@ -81,7 +81,7 @@ ifeq ($(XEN_TARGET_ARCH),$(XEN_COMPILE_A
 all: headers.chk
 
 headers.chk: $(filter-out public/arch-% public/%ctl.h public/xsm/% public/%hvm/save.h, $(wildcard public/*.h public/*/*.h) $(public-y)) Makefile
-	for i in $(filter %.h,$^); do $(CC) -ansi -include stdint.h -Wall -W -Werror -S -o /dev/null -xc $$i || exit 1; echo $$i; done >[email protected]
+	for i in $(filter %.h,$^); do $(CC) -ansi -include stdint.h -Wall -W -Werror -S -o /dev/null -x c $$i || exit 1; echo $$i; done >[email protected]
 	mv [email protected] $@
 
 endif

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Jan Beulich

In Linux the improper use was found to cause problems with certain distributed build environments. Even if not directly affecting us, be on the safe side.

Quoted 25 lines
Config.mk +1 -1
@@ -101,7 +101,7 @@ PYTHON_PREFIX_ARG ?= --prefix="$(PREFIX)
 #
 # Usage: cflags-y += $(call cc-option,$(CC),-march=winchip-c6,-march=i586)
 cc-option = $(shell if test -z "`echo 'void*p=1;' | \
- $(1) $(2) -S -o /dev/null -xc - 2>&1 | grep -- $(2) -`"; \
+ $(1) $(2) -S -o /dev/null -x c - 2>&1 | grep -- $(2) -`"; \
 then echo "$(2)"; else echo "$(3)"; fi ;)
 
 # cc-option-add: Add an option to compilation flags, but only if supported.
xen/include/Makefile +0 -0
@@ -81,7 +81,7 @@ ifeq ($(XEN_TARGET_ARCH),$(XEN_COMPILE_A

all: headers.chk

headers.chk: $(filter-out public/arch-% public/%ctl.h public/xsm/% public/%hvm/save.h, $(wildcard public/*.h public/*/*.h) $(public-y)) Makefile
- for i in $(filter %.h,$^); do $(CC) -ansi -include stdint.h -Wall -W

xen/include/Makefile +1 -2
-Werror -S -o /dev/null -xc $$i || exit 1; echo $$i; done>[email protected]
+ for i in $(filter %.h,$^); do $(CC) -ansi -include stdint.h -Wall -W 
-Werror -S -o /dev/null -x c $$i || exit 1; echo $$i; done>[email protected]

mv [email protected] $@

Quoted 3 lines

endif

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel