Commit ccf6e048 authored by alex@thinkpad's avatar alex@thinkpad
Browse files

QEMU patches: fixes for recent compilers

- "bitwise" fix: https://patchwork.kernel.org/project/qemu-devel/patch/20170308124955.35623-1-aik@ozlabs.ru/
- moved memfd from qemu-2.5.0-eos.patch to qemu-2.5.0-recent-gcc.patch

QEMU now compiles cleanly with recent-gcc patches, with and without EOS patches.

--HG--
branch : qemu
parent 087cf951d689
diff --git a/configure b/configure
index b9552fd..9aeaae3 100755
--- a/configure
+++ b/configure
@@ -3612,7 +3612,7 @@ fi
# check if memfd is supported
memfd=no
cat > $TMPC << EOF
-#include <sys/memfd.h>
+#include <sys/mman.h>
int main(void)
{
diff --git a/cpu-exec.c b/cpu-exec.c
index c88d0ff..4395bb3 100644
index c88d0ffd..4395bb34 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -31,6 +31,7 @@
......@@ -70,7 +57,7 @@ index c88d0ff..4395bb3 100644
/* see if we can patch the calling TB. When the TB
spans two pages, we cannot safely do a direct
diff --git a/disas/arm.c b/disas/arm.c
index 7a7354b..95f82cc 100644
index 7a7354b7..95f82ccc 100644
--- a/disas/arm.c
+++ b/disas/arm.c
@@ -2826,9 +2826,9 @@ print_insn_arm_internal (bfd_vma pc, struct disassemble_info *info, long given)
......@@ -96,7 +83,7 @@ index 7a7354b..95f82cc 100644
int is_thumb = false;
int is_data = false;
diff --git a/exec.c b/exec.c
index 0bf0a6e..5eb69de 100644
index 0bf0a6e7..5eb69de9 100644
--- a/exec.c
+++ b/exec.c
@@ -2564,7 +2564,7 @@ MemTxResult address_space_rw(AddressSpace *as, hwaddr addr, MemTxAttrs attrs,
......@@ -118,7 +105,7 @@ index 0bf0a6e..5eb69de 100644
}
}
diff --git a/gdbstub.c b/gdbstub.c
index 9c29aa0..a95ec8d 100644
index 9c29aa0e..a95ec8d3 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -431,6 +431,7 @@ static inline int tohex(int v)
......@@ -140,7 +127,7 @@ index 9c29aa0..a95ec8d 100644
target_ulong addr, len;
diff --git a/hw/arm/Makefile.objs b/hw/arm/Makefile.objs
index 2195b60..e3e2c14 100644
index 2195b60f..e3e2c14f 100644
--- a/hw/arm/Makefile.objs
+++ b/hw/arm/Makefile.objs
@@ -6,6 +6,7 @@ obj-y += tosa.o versatilepb.o vexpress.o virt.o xilinx_zynq.o z2.o
......@@ -152,7 +139,7 @@ index 2195b60..e3e2c14 100644
obj-y += armv7m.o exynos4210.o pxa2xx.o pxa2xx_gpio.o pxa2xx_pic.o
obj-$(CONFIG_DIGIC) += digic.o
diff --git a/hw/arm/digic.c b/hw/arm/digic.c
index 90f8190..8e934be 100644
index 90f8190c..8e934bea 100644
--- a/hw/arm/digic.c
+++ b/hw/arm/digic.c
@@ -36,7 +36,7 @@ static void digic_init(Object *obj)
......@@ -165,7 +152,7 @@ index 90f8190..8e934be 100644
object_initialize(&s->timer[i], sizeof(s->timer[i]), TYPE_DIGIC_TIMER);
diff --git a/hw/display/exynos4210_fimd.c b/hw/display/exynos4210_fimd.c
index 45239e8..825d6e6 100644
index 45239e83..825d6e66 100644
--- a/hw/display/exynos4210_fimd.c
+++ b/hw/display/exynos4210_fimd.c
@@ -97,7 +97,7 @@
......@@ -178,7 +165,7 @@ index 45239e8..825d6e6 100644
#define FIMD_WINCON_BUF0_SEL ((0 << 20) | (0 << 30))
#define FIMD_WINCON_BUF1_SEL ((1 << 20) | (0 << 30))
diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c
index 788b361..6aaeced 100644
index 788b3613..6aaeceda 100644
--- a/hw/ide/qdev.c
+++ b/hw/ide/qdev.c
@@ -245,7 +245,8 @@ static void ide_dev_instance_init(Object *obj)
......@@ -192,7 +179,7 @@ index 788b361..6aaeced 100644
static int ide_cd_initfn(IDEDevice *dev)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 1a9935c..2561560 100644
index 1a9935cf..25615603 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1479,6 +1479,9 @@ static void sd_blk_write(SDState *sd, uint64_t addr, uint32_t len)
......@@ -206,7 +193,7 @@ index 1a9935c..2561560 100644
if (!sd->blk || blk_read(sd->blk, addr >> 9, sd->buf, 1) < 0) {
fprintf(stderr, "sd_blk_write: read error on host side\n");
diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h
index d900b0d..1ad5332 100644
index d900b0d0..1ad53324 100644
--- a/include/exec/exec-all.h
+++ b/include/exec/exec-all.h
@@ -405,4 +405,7 @@ extern int singlestep;
......@@ -218,7 +205,7 @@ index d900b0d..1ad5332 100644
+
#endif
diff --git a/include/exec/memory.h b/include/exec/memory.h
index 0f07159..40c3940 100644
index 0f07159b..40c39402 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -1356,6 +1356,19 @@ void address_space_unmap(AddressSpace *as, void *buffer, hwaddr len,
......@@ -242,7 +229,7 @@ index 0f07159..40c3940 100644
#endif
diff --git a/include/hw/elf_ops.h b/include/hw/elf_ops.h
index 0010c44..d85cc6b 100644
index 0010c441..d85cc6bc 100644
--- a/include/hw/elf_ops.h
+++ b/include/hw/elf_ops.h
@@ -140,8 +140,11 @@ static int glue(load_symbols, SZ)(struct elfhdr *ehdr, int fd, int must_swab,
......@@ -276,7 +263,7 @@ index 0010c44..d85cc6b 100644
}
diff --git a/include/qemu/log.h b/include/qemu/log.h
index 362cbc4..7859c5f 100644
index 362cbc4e..7859c5fa 100644
--- a/include/qemu/log.h
+++ b/include/qemu/log.h
@@ -12,7 +12,7 @@
......@@ -389,7 +376,7 @@ index 362cbc4..7859c5f 100644
/* Print a usage message listing all the valid logging categories
* to the specified FILE*.
diff --git a/memory.c b/memory.c
index e193658..9de7251 100644
index e193658f..9de72512 100644
--- a/memory.c
+++ b/memory.c
@@ -1761,7 +1761,7 @@ static void memory_region_update_container_subregions(MemoryRegion *subregion)
......@@ -412,7 +399,7 @@ index e193658..9de7251 100644
subregion->priority = 0;
memory_region_add_subregion_common(mr, offset, subregion);
diff --git a/qemu-log.c b/qemu-log.c
index 7cb01a8..7b57b2e 100644
index 7cb01a80..7b57b2ef 100644
--- a/qemu-log.c
+++ b/qemu-log.c
@@ -22,7 +22,7 @@
......@@ -535,7 +522,7 @@ index 7cb01a8..7b57b2e 100644
p = str;
diff --git a/target-arm/cpu-qom.h b/target-arm/cpu-qom.h
index 25fb1ce..c180f78 100644
index 25fb1ce0..c180f781 100644
--- a/target-arm/cpu-qom.h
+++ b/target-arm/cpu-qom.h
@@ -141,6 +141,7 @@ typedef struct ARMCPU {
......@@ -547,7 +534,7 @@ index 25fb1ce..c180f78 100644
uint32_t id_pfr0;
uint32_t id_pfr1;
diff --git a/target-arm/cpu.c b/target-arm/cpu.c
index 30739fc..e332483 100644
index 30739fc0..e3324833 100644
--- a/target-arm/cpu.c
+++ b/target-arm/cpu.c
@@ -501,6 +501,7 @@ static void arm_cpu_initfn(Object *obj)
......@@ -718,7 +705,7 @@ index 30739fc..e332483 100644
{ .name = "ti925t", .initfn = ti925t_initfn },
{ .name = "sa1100", .initfn = sa1100_initfn },
diff --git a/target-arm/cpu.h b/target-arm/cpu.h
index 815fef8..74ce4a9 100644
index 815fef8a..74ce4a91 100644
--- a/target-arm/cpu.h
+++ b/target-arm/cpu.h
@@ -389,6 +389,9 @@ typedef struct CPUARMState {
......@@ -740,7 +727,7 @@ index 815fef8..74ce4a9 100644
static inline int arm_feature(CPUARMState *env, int feature)
diff --git a/target-arm/helper.c b/target-arm/helper.c
index afc4163..632ea26 100644
index afc41633..632ea26e 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -549,6 +549,13 @@ static const ARMCPRegInfo not_v6_cp_reginfo[] = {
......@@ -963,7 +950,7 @@ index afc4163..632ea26 100644
env->regs[15] = addr;
cs->interrupt_request |= CPU_INTERRUPT_EXITTB;
diff --git a/target-arm/helper.h b/target-arm/helper.h
index c2a85c7..98aa94b 100644
index c2a85c72..98aa94ba 100644
--- a/target-arm/helper.h
+++ b/target-arm/helper.h
@@ -64,10 +64,15 @@ DEF_HELPER_2(v7m_mrs, i32, env, i32)
......@@ -983,7 +970,7 @@ index c2a85c7..98aa94b 100644
DEF_HELPER_1(clear_pstate_ss, void, env)
DEF_HELPER_1(exception_return, void, env)
diff --git a/target-arm/internals.h b/target-arm/internals.h
index 347998c..6265345 100644
index 347998c8..62653453 100644
--- a/target-arm/internals.h
+++ b/target-arm/internals.h
@@ -72,7 +72,7 @@ static const char * const excnames[] = {
......@@ -1005,7 +992,7 @@ index 347998c..6265345 100644
}
diff --git a/target-arm/op_helper.c b/target-arm/op_helper.c
index 6cd54c8..055aaf7 100644
index 6cd54c8f..055aaf73 100644
--- a/target-arm/op_helper.c
+++ b/target-arm/op_helper.c
@@ -474,6 +474,199 @@ void HELPER(set_cp_reg)(CPUARMState *env, void *rip, uint32_t value)
......@@ -1209,7 +1196,7 @@ index 6cd54c8..055aaf7 100644
{
const ARMCPRegInfo *ri = rip;
diff --git a/target-arm/translate.c b/target-arm/translate.c
index 5d22879..a413e2c 100644
index 5d228797..a413e2c7 100644
--- a/target-arm/translate.c
+++ b/target-arm/translate.c
@@ -37,6 +37,8 @@
......@@ -1388,7 +1375,7 @@ index 5d22879..a413e2c 100644
if (ri->type & ARM_CP_CONST) {
/* If not forbidden by access permissions, treat as WI */
diff --git a/target-arm/translate.h b/target-arm/translate.h
index 53ef971..260331a 100644
index 53ef9710..260331ab 100644
--- a/target-arm/translate.h
+++ b/target-arm/translate.h
@@ -151,4 +151,8 @@ void arm_free_cc(DisasCompare *cmp);
......@@ -1400,23 +1387,8 @@ index 53ef971..260331a 100644
+void log_str_cb(uint32_t addr, uint32_t value, uint32_t opc);
+
#endif /* TARGET_ARM_TRANSLATE_H */
diff --git a/util/memfd.c b/util/memfd.c
index 7c40691..3636f0d 100644
--- a/util/memfd.c
+++ b/util/memfd.c
@@ -34,9 +34,7 @@
#include "qemu/memfd.h"
-#ifdef CONFIG_MEMFD
-#include <sys/memfd.h>
-#elif defined CONFIG_LINUX
+#if defined CONFIG_LINUX && !defined CONFIG_MEMFD
#include <sys/syscall.h>
#include <asm/unistd.h>
diff --git a/vl.c b/vl.c
index 4211ff1..93d4df4 100644
index 4211ff1f..93d4df49 100644
--- a/vl.c
+++ b/vl.c
@@ -4102,7 +4102,7 @@ int main(int argc, char **argv, char **envp)
......
diff --git a/block/blkdebug.c b/block/blkdebug.c
index dee3a0e..b00d0f0 100644
index dee3a0ed..b00d0f0e 100644
--- a/block/blkdebug.c
+++ b/block/blkdebug.c
@@ -756,7 +756,7 @@ static void blkdebug_refresh_filename(BlockDriverState *bs)
......@@ -12,7 +12,7 @@ index dee3a0e..b00d0f0 100644
bs->file->bs->exact_filename);
}
diff --git a/block/blkverify.c b/block/blkverify.c
index c5f8e8d..b242680 100644
index c5f8e8dc..b2426804 100644
--- a/block/blkverify.c
+++ b/block/blkverify.c
@@ -333,7 +333,7 @@ static void blkverify_refresh_filename(BlockDriverState *bs)
......@@ -24,8 +24,30 @@ index c5f8e8d..b242680 100644
bs->file->bs->exact_filename,
s->test_file->bs->exact_filename);
}
diff --git a/configure b/configure
index b9552fda..bb1e6dd3 100755
--- a/configure
+++ b/configure
@@ -3325,7 +3325,7 @@ EOF
symlink "$source_path/dtc/Makefile" "dtc/Makefile"
symlink "$source_path/dtc/scripts" "dtc/scripts"
fi
- fdt_cflags="-I\$(SRC_PATH)/dtc/libfdt"
+ fdt_cflags="-isystem\$(SRC_PATH)/dtc/libfdt"
fdt_libs="-L\$(BUILD_DIR)/dtc/libfdt $fdt_libs"
elif test "$fdt" = "yes" ; then
# have neither and want - prompt for system/submodule install
@@ -3612,7 +3612,7 @@ fi
# check if memfd is supported
memfd=no
cat > $TMPC << EOF
-#include <sys/memfd.h>
+#include <sys/mman.h>
int main(void)
{
diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c
index f972731..7eb54a8 100644
index f972731f..7eb54a84 100644
--- a/hw/9pfs/virtio-9p.c
+++ b/hw/9pfs/virtio-9p.c
@@ -22,6 +22,7 @@
......@@ -37,7 +59,7 @@ index f972731..7eb54a8 100644
int open_fd_hw;
int total_open_fd;
diff --git a/hw/char/exynos4210_uart.c b/hw/char/exynos4210_uart.c
index 215f962..53190a1 100644
index 215f9622..53190a10 100644
--- a/hw/char/exynos4210_uart.c
+++ b/hw/char/exynos4210_uart.c
@@ -589,7 +589,7 @@ DeviceState *exynos4210_uart_create(hwaddr addr,
......@@ -50,7 +72,7 @@ index 215f962..53190a1 100644
dev = qdev_create(NULL, TYPE_EXYNOS4210_UART);
diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index ee6b43a..c8a5f83 100644
index ee6b43ab..c8a5f83c 100644
--- a/hw/usb/bus.c
+++ b/hw/usb/bus.c
@@ -396,7 +396,7 @@ void usb_register_companion(const char *masterbus, USBPort *ports[],
......@@ -63,7 +85,7 @@ index ee6b43a..c8a5f83 100644
downstream->hubcount = upstream->hubcount + 1;
} else {
diff --git a/net/slirp.c b/net/slirp.c
index f505570..1c5c606 100644
index f505570a..1c5c6066 100644
--- a/net/slirp.c
+++ b/net/slirp.c
@@ -463,7 +463,7 @@ int net_slirp_redir(const char *redir_str)
......@@ -87,7 +109,7 @@ index f505570..1c5c606 100644
FILE *f;
diff --git a/qemu-char.c b/qemu-char.c
index 2969c44..84e13e4 100644
index 2969c44e..84e13e49 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -87,7 +87,7 @@
......@@ -100,7 +122,7 @@ index 2969c44..84e13e4 100644
/***********************************************************/
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index c2ff970..ae64df0 100644
index c2ff9702..ae64df0c 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -13,6 +13,7 @@
......@@ -111,3 +133,18 @@ index c2ff970..ae64df0 100644
#include <sys/ioctl.h>
#include <sys/wait.h>
#include <unistd.h>
diff --git a/util/memfd.c b/util/memfd.c
index 7c406914..3636f0d9 100644
--- a/util/memfd.c
+++ b/util/memfd.c
@@ -34,9 +34,7 @@
#include "qemu/memfd.h"
-#ifdef CONFIG_MEMFD
-#include <sys/memfd.h>
-#elif defined CONFIG_LINUX
+#if defined CONFIG_LINUX && !defined CONFIG_MEMFD
#include <sys/syscall.h>
#include <asm/unistd.h>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment