Fix the build on CentOS 7
cover Fix the build on CentOS 7
Hi,
I know that CentOS 7 is not tested anymore, but unfortunately it's the only ppc64le system that I have, so I had to fix a few build issues that crept in since the testing stopped. The fixes are simple and may be helpful to people in the same situation.
Best regards,
Ilya
Ilya Leoshkevich (3):
linux-user: Fix the build on systems without SOL_ALG
linux-user: Fix the build on systems without MAP_SHARED_VALIDATE
linux-user: Fix the build on systems without MADV_{KEEP,WIPE}ONFORK
linux-user/mmap.c | 1 + linux-user/syscall.c | 3 +++ 2 files changed, 4 insertions(+)
Signature · 1 line
2.41.0
PATCH 1/3 linux-user: Fix the build on systems without SOL_ALG
Building QEMU on CentOS 7 fails, because there SOL_ALG is not defined. There already exists #if defined(SOL_ALG) in do_setsockopt(); add it to target_to_host_cmsg() as well.
--- linux-user/syscall.c | 2 ++ 1 file changed, 2 insertions(+)
linux-user/syscall.c +2 -0
@@ -1806,6 +1806,7 @@ static inline abi_long target_to_host_cmsg(struct msghdr *msgh,__get_user (cred->pid, &target_cred->pid);__get_user (cred->uid, &target_cred->uid);__get_user (cred->gid, &target_cred->gid); +#ifdef SOL_ALG }else if (cmsg->cmsg_level ==SOL_ALG ) {uint32_t *dst = (uint32_t *)data;
@@ -1814,6 +1815,7 @@ static inline abi_long target_to_host_cmsg(struct msghdr *msgh,if (len >=sizeof (uint32_t )) { *dst =tswap32 (*dst); } +#endif }else {qemu_log_mask (LOG_UNIMP ,"Unsupported ancillary data: %d/%d\n" , cmsg->cmsg_level, cmsg->cmsg_type);
Signature · 1 line
2.41.0
Re: [PATCH 1/3] linux-user: Fix the build on systems without SOL_ALG
Quoted 3 lines · Ilya Leoshkevich
Building QEMU on CentOS 7 fails, because there
SOL_ALGis not defined. There already exists #ifdefined(SOL_ALG)indo_setsockopt(); add it totarget_to_host_cmsg()as well.
Does including "crypto/afalgpriv.h" help?
Quoted 5 lines
Fixes 27404b6c15c1 ("linux-user: Implement SOL_ALG encryption support")Signed-off-by Ilya Leoshkevich <[email protected]>--- linux-user/syscall.c | 2 ++ 1 file changed, 2 insertions(+)
PATCH 2/3 linux-user: Fix the build on systems without MAP_SHARED_VALIDATE
In reply to Ilya LeoshkevichCentOS 7 does not define MAP_SHARED_VALIDATE. Use a definition provided by the QEMU's copy of linux/mman.h.
--- linux-user/syscall.c | 1 + 1 file changed, 1 insertion(+)
linux-user/syscall.c +1 -0
@@ -121,6 +121,7 @@#ifdef HAVE_BTRFS_H #include <linux/btrfs.h> #endif +#include <linux/mman.h> #ifdef HAVE_DRM_H #include <libdrm/drm.h> #include <libdrm/i915_drm.h>
Signature · 1 line
2.41.0
Re: [PATCH 2/3] linux-user: Fix the build on systems without MAP_SHARED_VALIDATE
Quoted 5 lines · Ilya Leoshkevich
CentOS 7 does not define
MAP_SHARED_VALIDATE. Use a definition provided by the QEMU's copy oflinux/mman.h.Fixes 4b840f96096d ("linux-user: Populate more bits in mmap_flags_tbl")Signed-off-by Ilya Leoshkevich <[email protected]>
Does it fix the missing MADV_WIPEONFORK as well?
https://gitlab.com/qemu-project/qemu/-/issues/1824#note_1507837354
Helge
Quoted 16 lines
--- linux-user/syscall.c | 1 + 1 file changed, 1 insertion(+)linux-user/syscall.c +1
-0@@ -121,6 +121,7 @@#ifdef HAVE_BTRFS_H #include <linux/btrfs.h> #endif +#include <linux/mman.h> #ifdef HAVE_DRM_H #include <libdrm/drm.h> #include <libdrm/i915_drm.h>
Re: [PATCH 2/3] linux-user: Fix the build on systems without MAP_SHARED_VALIDATE
Quoted 5 lines · Helge Deller
Quoted 4 lines · Ilya Leoshkevich
CentOS 7 does not define
MAP_SHARED_VALIDATE. Use a definition provided
by the QEMU's copy oflinux/mman.h.
Quoted 8 lines
Quoted 3 lines
Fixes 4b840f96096d ("linux-user: Populate more bits in
mmap_flags_tbl")Signed-off-by Ilya Leoshkevich <[email protected]>Does it fix the missing
MADV_WIPEONFORKas well?
https://gitlab.com/qemu-project/qemu/-/issues/1824#note_1507837354Helge
What a coincidence, that multiple people ran into this on the same day.
This should be fixed by [3/3] of this series.
Best regards,
Ilya
PATCH 3/3 linux-user: Fix the build on systems without MADV_{KEEP, WIPE}ONFORK
In reply to Ilya LeoshkevichCentOS 7 does not define MADV_KEEPONFORK and MADV_WIPEONFORK. Use definitions provided by the QEMU's copy of linux/mman.h.
--- linux-user/mmap.c | 1 + 1 file changed, 1 insertion(+)
linux-user/mmap.c +1 -0
@@ -17,6 +17,7 @@* along with this program; if not, see <http://www.gnu.org/licenses/>. */ #include "qemu/osdep.h" +#include <linux/mman.h> #include "trace.h" #include "exec/log.h" #include "qemu.h"
Signature · 1 line
2.41.0
Quoted 6 lines · Ilya Leoshkevich
Hi,
I know that CentOS 7 is not tested anymore, but unfortunately it's the only ppc64le system that I have, so I had to fix a few build issues that crept in since the testing stopped. The fixes are simple and may be helpful to people in the same situation.
Actually it is more than not tested. CentOS 7 is explicitly unsupported per our platform support matrix:
https://www.qemu.org/docs/master/about/build-platforms.html
and thus we will *intentionally* delete backwards compatibility code that it needs, in order to simplify QEMU's codebase.
Quoted 4 lines
Ilya Leoshkevich (3):
linux-user: Fix the build on systems withoutSOL_ALG
linux-user: Fix the build on systems withoutMAP_SHARED_VALIDATE
linux-user: Fix the build on systems without MADV_{KEEP,WIPE}ONFORK
We explicitly do NOT want to add this kind of back compat code for unsupported platforms.
With regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|