Skip to contentSkip to conversation

refine C++ header checking compiler invocation

PATCH In review Jan Beulich 2 participants 2 messages Apr 23, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 refine C++ header checking compiler invocation

g++ 4.1.x dies with "cc1plus: error: output filename specified twice" on the currently used construct. That's apparently due to it converting the manually specified "c++" into "c++-header", and mis-handling that (which, when using "c++-header" explicitly btw gets mis-handled even with 4.9.x and also, using "c-header", by the plain C compiler).

xen/include/Makefile +4 -3
@@ -104,9 +104,10 @@ headers.chk: $(PUBLIC_ANSI_HEADERS) Make
 headers++.chk: $(PUBLIC_HEADERS) Makefile
 	if $(CXX) -v >/dev/null 2>&1; then \
 	    for i in $(filter %.h,$^); do \
-	        $(CXX) -x c++ -std=gnu++98 -Wall -Werror -D__XEN_TOOLS__ \
-	               -include stdint.h -include public/xen.h \
-	               -S -o /dev/null $$i || exit 1; \
+	        echo '#include "$$i"' \
+	        | $(CXX) -x c++ -std=gnu++98 -Wall -Werror -D__XEN_TOOLS__ \
+	          -include stdint.h -include public/xen.h -S -o /dev/null - \
+	        || exit 1; \
 	        echo $$i; \
 	    done ; \
 	fi >[email protected]

refine C++ header checking compiler invocation

g++ 4.1.x dies with "cc1plus: error: output filename specified twice" on the currently used construct. That's apparently due to it converting the manually specified "c++" into "c++-header", and mis-handling that (which, when using "c++-header" explicitly btw gets mis-handled even with 4.9.x and also, using "c-header", by the plain C compiler).

xen/include/Makefile +4 -3
@@ -104,9 +104,10 @@ headers.chk: $(PUBLIC_ANSI_HEADERS) Make
 headers++.chk: $(PUBLIC_HEADERS) Makefile
 	if $(CXX) -v >/dev/null 2>&1; then \
 	    for i in $(filter %.h,$^); do \
-	        $(CXX) -x c++ -std=gnu++98 -Wall -Werror -D__XEN_TOOLS__ \
-	               -include stdint.h -include public/xen.h \
-	               -S -o /dev/null $$i || exit 1; \
+	        echo '#include "$$i"' \
+	        | $(CXX) -x c++ -std=gnu++98 -Wall -Werror -D__XEN_TOOLS__ \
+	          -include stdint.h -include public/xen.h -S -o /dev/null - \
+	        || exit 1; \
 	        echo $$i; \
 	    done ; \
 	fi >[email protected]

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

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

g++ 4.1.x dies with "cc1plus: error: output filename specified twice" on the currently used construct. That's apparently due to it converting the manually specified "c++" into "c++-header", and mis-handling that (which, when using "c++-header" explicitly btw gets mis-handled even with 4.9.x and also, using "c-header", by the plain C compiler).