Skip to contentSkip to conversation

prepend the include path of libvixl header files

PATCH In review Stefano Stabellini 2 participants 6 messages Jul 7, 2014 – Jul 9, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 prepend the include path of libvixl header files

Currently the Makefile of disas/libvixl appends -I$(SRC_PATH)/disas/libvixl to QEMU_CFLAGS. As a consequence C++ files that #include "utils.h", such as disas/libvixl/a64/instructions-a64.cc, are going to look for utils.h on all the other include paths first.

When building QEMU as part of the Xen make system, another unrelated utils.h file is going to be chosen for inclusion, causing a build failure:

In file included from disas/libvixl/a64/instructions-a64.cc:27:0:
/qemu/disas/libvixl/a64/instructions-a64.h:88:64: error:
‘rawbits_to_float’ was not declared in this scope
const float kFP32PositiveInfinity = rawbits_to_float(0x7f800000);

Fix the problem by prepending (rather than appending) the libvixl include path to QEMU_CFLAGS.

---

disas/libvixl/Makefile.objs +1 -1
index 0adb3ce..17e6565 100644
@@ -3,6 +3,6 @@ libvixl_OBJS = utils.o \
                a64/decoder-a64.o \
                a64/disasm-a64.o
 
-$(addprefix $(obj)/,$(libvixl_OBJS)): QEMU_CFLAGS += -I$(SRC_PATH)/disas/libvixl
+$(addprefix $(obj)/,$(libvixl_OBJS)): QEMU_CFLAGS := -I$(SRC_PATH)/disas/libvixl $(QEMU_CFLAGS)
 
 common-obj-$(CONFIG_ARM_A64_DIS) += $(libvixl_OBJS)
Reviewed-by on v1 1/1
#1 lore raw
Quoted 26 lines · Stefano Stabellini

Currently the Makefile of disas/libvixl appends -I$(SRC_PATH)/disas/libvixl to QEMU_CFLAGS. As a consequence C++ files that #include "utils.h", such as disas/libvixl/a64/instructions-a64.cc, are going to look for utils.h on all the other include paths first.

When building QEMU as part of the Xen make system, another unrelated utils.h file is going to be chosen for inclusion, causing a build failure:

In file included from disas/libvixl/a64/instructions-a64.cc:27:0:
/qemu/disas/libvixl/a64/instructions-a64.h:88:64: error:
‘rawbits_to_float’ was not declared in this scope
const float kFP32PositiveInfinity = rawbits_to_float(0x7f800000);

Fix the problem by prepending (rather than appending) the libvixl include path to QEMU_CFLAGS.

---

disas/libvixl/Makefile.objs +0 -0
index 0adb3ce..17e6565 100644

disas/libvixl/Makefile.objs libvixl_OBJS = utils.o \ · line 8

Quoted 7 lines
disas/libvixl/Makefile.objs +1 -1
@@ -3,6 +3,6 @@ libvixl_OBJS = utils.o \
                a64/decoder-a64.o \
                a64/disasm-a64.o
 
-$(addprefix $(obj)/,$(libvixl_OBJS)): QEMU_CFLAGS += -I$(SRC_PATH)/disas/libvixl
+$(addprefix $(obj)/,$(libvixl_OBJS)): QEMU_CFLAGS := -I$(SRC_PATH)/disas/libvixl $(QEMU_CFLAGS)
 
 common-obj-$(CONFIG_ARM_A64_DIS) += $(libvixl_OBJS)

I spent a few moments wondering if the conversion of QEMU_CFLAGS from recursively-expanded to simply-expanded would be a problem, but because this is a target-specific variable it's pretty much going to be expanded at the same point that it would be anyhow.

thanks
-- PMM

#2 lore raw
Quoted 38 lines · Peter Maydell
Quoted 26 lines · Stefano Stabellini

Currently the Makefile of disas/libvixl appends -I$(SRC_PATH)/disas/libvixl to QEMU_CFLAGS. As a consequence C++ files that #include "utils.h", such as disas/libvixl/a64/instructions-a64.cc, are going to look for utils.h on all the other include paths first.

When building QEMU as part of the Xen make system, another unrelated utils.h file is going to be chosen for inclusion, causing a build failure:

In file included from disas/libvixl/a64/instructions-a64.cc:27:0:
/qemu/disas/libvixl/a64/instructions-a64.h:88:64: error:
‘rawbits_to_float’ was not declared in this scope
const float kFP32PositiveInfinity = rawbits_to_float(0x7f800000);

Fix the problem by prepending (rather than appending) the libvixl include path to QEMU_CFLAGS.

---

disas/libvixl/Makefile.objs +0 -0
index 0adb3ce..17e6565 100644

disas/libvixl/Makefile.objs libvixl_OBJS = utils.o \ · line 8

Quoted 7 lines
disas/libvixl/Makefile.objs +1 -1
@@ -3,6 +3,6 @@ libvixl_OBJS = utils.o \
                a64/decoder-a64.o \
                a64/disasm-a64.o
 
-$(addprefix $(obj)/,$(libvixl_OBJS)): QEMU_CFLAGS += -I$(SRC_PATH)/disas/libvixl
+$(addprefix $(obj)/,$(libvixl_OBJS)): QEMU_CFLAGS := -I$(SRC_PATH)/disas/libvixl $(QEMU_CFLAGS)
 
 common-obj-$(CONFIG_ARM_A64_DIS) += $(libvixl_OBJS)
Quoted 5 lines

I spent a few moments wondering if the conversion of QEMU_CFLAGS from recursively-expanded to simply-expanded would be a problem, but because this is a target-specific variable it's pretty much going to be expanded at the same point that it would be anyhow.

Thanks Peter.
Are you going to pick it up or do you want me to send a pull request?

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

#3 lore raw
Quoted 1 line · Stefano Stabellini

Are you going to pick it up or do you want me to send a pull request?

I'm going to put it in the target-arm pullreq I'm currently testing.

thanks
-- PMM

#4 lore raw
Quoted 5 lines · Peter Maydell
Quoted 1 line · Stefano Stabellini

Are you going to pick it up or do you want me to send a pull request?

I'm going to put it in the target-arm pullreq I'm currently testing.

Great, thanks!

#5 lore raw
Quoted 9 lines · Stefano Stabellini
Quoted 5 lines · Peter Maydell
Quoted 1 line · Stefano Stabellini

Are you going to pick it up or do you want me to send a pull request?

I'm going to put it in the target-arm pullreq I'm currently testing.

Great, thanks!

Unfortunately I found another one of these issues: disas/arm-a64.o adds -Idisas/libvixl via arm-a64.o-cflags instead of QEMU_CFLAGS. I don't know how I missed it the first time. Probably I didn't properly clean the QEMU build directory.

I'll send a separate patch for that.