Skip to contentSkip to conversation

assembly test fixes

PATCH In review Roger Pau Monne 2 participants 7 messages May 30, 2016 – May 31, 2016

lore
Share & tools
lore
#0 lore raw

cover assembly test fixes

Hello,

The following series attempts to fix the build issue introduced by 7fb252bd41, and to make sure the same assembler is used thorough all the build process. It also supersedes the fix by Jan Beulich for this same issue [0].

Roger.

[0] http://lists.xenproject.org/archives/html/xen-devel/2016-05/msg02822.html

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

#1 lore raw

PATCH 1/2 build/clang: disable the usage of the integrated clang assembler

For all the build process, not only the assembly-only files.

This prevents assembling certain code with the integrated assembler, while other code would be assembled by the external assembler.

---
Cc: Andrew Cooper <[email protected]>
Cc: George Dunlap <[email protected]>
Cc: Ian Jackson <[email protected]>
Cc: Jan Beulich <[email protected]>
Cc: Konrad Rzeszutek Wilk <[email protected]>
Cc: Stefano Stabellini <[email protected]>
Cc: Tim Deegan <[email protected]>
Cc: Wei Liu <[email protected]>

---
 xen/Rules.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/Rules.mk +1 -1
index 961d533..12efd6a 100644
@@ -71,7 +71,7 @@ endif
 AFLAGS-y                += -D__ASSEMBLY__ -include $(BASEDIR)/include/xen/config.h
 
 # Clang's built-in assembler can't handle .code16/.code32/.code64 yet
-AFLAGS-$(clang)         += -no-integrated-as
+CFLAGS-$(clang)         += -no-integrated-as
 
 ALL_OBJS := $(ALL_OBJS-y)
 
Signature · 7 lines
2.7.4 (Apple Git-66)


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

Re: [PATCH for-4.7 1/2] build/clang: disable the usage of the integrated clang assembler

Quoted 5 lines
Quoted 1 line
Quoted 1 line · On 30.05.16 at 18:27, <[email protected]> wrote:

For all the build process, not only the assembly-only files.

This prevents assembling certain code with the integrated assembler, while other code would be assembled by the external assembler.

Without you giving a reason why this needs to be that way, I don't think this is an acceptable change. I, for one, don't see why in a clang build we shouldn't use as much of clang as possible (and hence limit exceptions to a minimum).

Jan

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

#3 lore raw

Re: [PATCH for-4.7 1/2] build/clang: disable the usage of the integrated clang assembler

Quoted 10 lines · Jan Beulich
Quoted 5 lines
Quoted 1 line
Quoted 1 line · On 30.05.16 at 18:27, <[email protected]> wrote:

For all the build process, not only the assembly-only files.

This prevents assembling certain code with the integrated assembler, while other code would be assembled by the external assembler.

Without you giving a reason why this needs to be that way, I don't think this is an acceptable change. I, for one, don't see why in a clang build we shouldn't use as much of clang as possible (and hence limit exceptions to a minimum).

For once, the external and the integrated assembler might have a different set of features, so we would have to execute some of the checks twice against each of them and then choose the minimum set of features that are supported by both, IMHO we don't want to get down that road.

Roger.

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

#4 lore raw

Re: [PATCH for-4.7 1/2] build/clang: disable the usage of the integrated clang assembler

Quoted 13 lines
Quoted 1 line
Quoted 1 line · On 31.05.16 at 12:31, <[email protected]> wrote:
Quoted 10 lines · Jan Beulich
Quoted 5 lines
Quoted 1 line
Quoted 1 line · On 30.05.16 at 18:27, <[email protected]> wrote:

For all the build process, not only the assembly-only files.

This prevents assembling certain code with the integrated assembler, while other code would be assembled by the external assembler.

Without you giving a reason why this needs to be that way, I don't think this is an acceptable change. I, for one, don't see why in a clang build we shouldn't use as much of clang as possible (and hence limit exceptions to a minimum).

Quoted 4 lines

For once, the external and the integrated assembler might have a different set of features, so we would have to execute some of the checks twice against each of them and then choose the minimum set of features that are supported by both, IMHO we don't want to get down that road.

Why not? These checks already say which flags they want to update. And I don't think many CONFIG_AS_* uses exist in .S files, so the amount of redundancy (to also update AFLAGS) would be small (or even zero).

Jan

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

#5 lore raw

PATCH 2/2 build: use CFLAGS instead of AFLAGS for as-insn checks

In reply to Roger Pau Monne

The test code is a C file with inline assembly, not plain assembly.

This fixes the fallout introduced by commit 7fb252bd41 ("build/xen: fix assembler instruction tests")

---
Cc: Andrew Cooper <[email protected]>
Cc: George Dunlap <[email protected]>
Cc: Ian Jackson <[email protected]>
Cc: Jan Beulich <[email protected]>
Cc: Konrad Rzeszutek Wilk <[email protected]>
Cc: Stefano Stabellini <[email protected]>
Cc: Tim Deegan <[email protected]>
Cc: Wei Liu <[email protected]>

---
 Config.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Config.mk +1 -1
index 5ddfbf8..13475e0 100644
@@ -150,7 +150,7 @@ endif
 # as-insn: Check whether assembler supports an instruction.
 # Usage: cflags-y += $(call as-insn "insn",option-yes,option-no)
 as-insn = $(if $(shell echo 'void _(void) { asm volatile ( $(2) ); }' \
-                       | $(1) $(AFLAGS) -c -x c -o /dev/null - 2>&1),$(4),$(3))
+                       | $(1) $(CFLAGS) -c -x c -o /dev/null - 2>&1),$(4),$(3))
 
 # as-insn-check: Add an option to compilation flags, but only if insn is
 #                supported by assembler.
Signature · 7 lines
2.7.4 (Apple Git-66)


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

Re: [PATCH for-4.7 2/2] build: use CFLAGS instead of AFLAGS for as-insn checks

Quoted 5 lines
Quoted 1 line
Quoted 1 line · On 30.05.16 at 18:27, <[email protected]> wrote:

The test code is a C file with inline assembly, not plain assembly.

This fixes the fallout introduced by commit 7fb252bd41 ("build/xen: fix assembler instruction tests")

I don't follow (did you check this time that previous behavior gets restored; you clearly can't have checked that old behavior was retained for gcc builds with that earlier change of yours):

Config.mk endif · line 153

Quoted 8 lines
Config.mk +1 -1
@@ -150,7 +150,7 @@ endif
 # as-insn: Check whether assembler supports an instruction.
 # Usage: cflags-y += $(call as-insn "insn",option-yes,option-no)
 as-insn = $(if $(shell echo 'void _(void) { asm volatile ( $(2) ); }' \
-                       | $(1) $(AFLAGS) -c -x c -o /dev/null - 2>&1),$(4),$(3))
+                       | $(1) $(CFLAGS) -c -x c -o /dev/null - 2>&1),$(4),$(3))

Afaict this leaves in place the problematic -M options. Changing from AFLAGS to CFLAGS is probably fine here (if only patch 1, which is a prereq to the change here, was okay), but leaving out the other change my patch did I can't see how you fix aforementioned fallout. Please explain.

Jan

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