Skip to content
This repository has been archived by the owner on Feb 21, 2024. It is now read-only.

Ubuntu 18.04 and Qemu 2.10.0 "memfd" build error #49

Closed
Bondey opened this issue May 22, 2018 · 4 comments
Closed

Ubuntu 18.04 and Qemu 2.10.0 "memfd" build error #49

Bondey opened this issue May 22, 2018 · 4 comments

Comments

@Bondey
Copy link

Bondey commented May 22, 2018

I've been trying to build pyrebox on Ubuntu 18.04 and i've been having this issue:

captura de pantalla de 2018-05-22 17-12-50

after a bit of reading, finally found the reason, that is related to a change in "mman.h" on the last version of Ubuntu.

Here are the changes to the "configure" and "util/memfd.c" files to get it working:
https://git.qemu.org/?p=qemu.git;a=commit;h=75e5b70e6b5dcc4f2219992d7cffa462aa406af0

I suppose that making this changes to the project may break qemu for the other distros, so it live this here, in case someone else has the same issue :)

@xabiugarte
Copy link
Contributor

Thanks for the contribution Bondey!

I am leaving this open for reference, and I will look into this once I update to the latest stable QEMU version (from 2.11.1 -> 2.12), released in late April.

Thanks!

@adde88
Copy link

adde88 commented Jun 9, 2018

Yeah, updating the version of qemu fixes this issue.
The next error i got after i manually patched the above error was about libusb. (which was also very simple to manually patch)

Here's a copy of that error, just so you're aware of it:
error: ‘libusb_set_debug’ is deprecated: Use libusb_set_option instead

Here's a diff to fix the "libusb" error:

diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c
index 1b0be071cc..dc0a8fe295 100644
--- a/hw/usb/host-libusb.c
+++ b/hw/usb/host-libusb.c
@@ -247,7 +247,11 @@  static int usb_host_init(void)
     if (rc != 0) {
         return -1;
     }
+#if LIBUSB_API_VERSION >= 0x01000106
+    libusb_set_option(ctx, LIBUSB_OPTION_LOG_LEVEL, loglevel);
+#else
     libusb_set_debug(ctx, loglevel);
+#endif
 #ifdef CONFIG_WIN32
     /* FIXME: add support for Windows. */
 #else

But then i was met with an error about pyrebox.c complaining about missing config.h
I haven't tried patching that, yet. I'll update this if i find anything of interest.

(Not using Ubuntu, but Kali Linux with a custom Linux 4.15.17 kernel)

@xabiugarte
Copy link
Contributor

PyREBox (master branch) is now on QEMU 2.12.

@xabiugarte
Copy link
Contributor

Closing this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants