riscvarchive / riscv-qemu

QEMU with RISC-V (RV64G, RV32G) Emulation Support
387 stars 154 forks source link

Fix building on recent glibc #69

Closed shawnanastasio closed 6 years ago

shawnanastasio commented 6 years ago

Building against recent glibc versions results in the following error:

qga/commands-posix.c:656:13: error: In the GNU C Library, "major" is defined
 by <sys/sysmacros.h>. For historical compatibility, it is
 currently defined by <sys/types.h> as well, but we plan to
 remove this soon. To use "major", include <sys/sysmacros.h>
 directly. If you did not intend to use a system-defined macro
 "major", you should undefine it after including <sys/types.h>. [-Werror]

This patch resolves the error by conditionally including <sys/sysmacros.h> if a recent glibc version is present.

davidlt commented 6 years ago

Talking about recent glibc we also need: https://github.com/qemu/qemu/commit/04b33e21866412689f18b7ad6daf0a54d8f959a7 + changes in riscv specific files.

riscv-qemu doesn't build on Fedora 27.

michaeljclark commented 6 years ago

Closing. Addressed by https://github.com/riscv/riscv-qemu/pull/78 and https://github.com/riscv/riscv-qemu/pull/80