Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: glib-2.48 gthread-2.0 is required to compile QEMU #44

Open
ghost opened this issue Jul 9, 2020 · 4 comments
Open

ERROR: glib-2.48 gthread-2.0 is required to compile QEMU #44

ghost opened this issue Jul 9, 2020 · 4 comments

Comments

@ghost
Copy link

ghost commented Jul 9, 2020

As reported in #40,
I have installed most of the dependencies below. I am still getting this error.

sudo apt install libglib2.0-dev libgcrypt20-dev zlib1g-dev autoconf automake libtool bison flex libpixman-1-dev libnfs-dev libiscsi-dev libaio-dev libbluetooth-dev libbrlapi-dev libbz2-dev libcap-dev libcap-ng-dev libcurl4-gnutls-dev libgtk-3-dev

../configure --target-list="aarch64-softmmu,microblazeel-softmmu" --enable-debug --enable-fdt --disable-kvm --disable-xen
@ghost ghost changed the title ERROR: glib-2.48 gthread-2.0 is required to compile QEMU #40 ERROR: glib-2.48 gthread-2.0 is required to compile QEMU Jul 9, 2020
@edgarigl
Copy link
Contributor

edgarigl commented Aug 2, 2020

Hi,

Can you show us the exact error you're getting?

@wide0s
Copy link

wide0s commented Oct 29, 2020

I'm getting the same issue when compiling QEMU on Ubuntu 20.04 (Focal Fossa). The exact error message is the following:

cd /home/wide0s/qemu && ./configure --target-list=arm-softmmu,x86_64-softmmu && make -j2

ERROR: glib-2.48 gthread-2.0 is required to compile QEMU

make: *** [Makefile:36: qemu] Error 1

I realized that the problem is missing glib-2.48 and gthread-2.0, so that I installed glib with this command

$ apt install libglib2.0-dev

It installed version of libglib v2.64:

$ dpkg -l | grep libglib
ii  libglib2.0-0:amd64               2.64.2-1~fakesync1                amd64        GLib library of C routines
ii  libglib2.0-bin                   2.64.2-1~fakesync1                amd64        Programs for the GLib library
ii  libglib2.0-data                  2.64.2-1~fakesync1                all          Common files for GLib library
ii  libglib2.0-dev:amd64             2.64.2-1~fakesync1                amd64        Development files for the GLib library
ii  libglib2.0-dev-bin               2.64.2-1~fakesync1                amd64        Development utilities for the GLib library

However there is no libgthread2.0-dev or similar which I can install on Ubuntu 20.04 to meet this ./configure script check:

glib_req_ver=2.48
glib_modules=gthread-2.0
if test "$modules" = yes; then
    glib_modules="$glib_modules gmodule-export-2.0"
fi
if test "$plugins" = yes; then
    glib_modules="$glib_modules gmodule-2.0"
fi

# This workaround is required due to a bug in pkg-config file for glib as it
# doesn't define GLIB_STATIC_COMPILATION for pkg-config --static

if test "$static" = yes && test "$mingw32" = yes; then
    QEMU_CFLAGS="-DGLIB_STATIC_COMPILATION $QEMU_CFLAGS"
fi

for i in $glib_modules; do
    if $pkg_config --atleast-version=$glib_req_ver $i; then
        glib_cflags=$($pkg_config --cflags $i)
        glib_libs=$($pkg_config --libs $i)
        QEMU_CFLAGS="$glib_cflags $QEMU_CFLAGS"
        LIBS="$glib_libs $LIBS"
        libs_qga="$glib_libs $libs_qga"
    else
        error_exit "glib-$glib_req_ver $i is required to compile QEMU"
    fi
done

It'd be great, if someone can have a quick look on this and suggest a patch:)

@diohabara
Copy link

I'm having the same issue.
Did you make any progress?

edgarigl pushed a commit that referenced this issue Oct 11, 2021
Switch from stable-4.2 branch to upstream v4.6.1 release + fixes.

## [Unreleased]

### Fixed

 - Haiku fixes. !98 !99
 - Fix a minor DHCP regression introduced in 4.6.0. !97

## [4.6.1] - 2021-06-18

### Fixed

 - Fix DHCP regression introduced in 4.6.0. !95

## [4.6.0] - 2021-06-14

### Added

 - mbuf: Add debugging helpers for allocation. !90

### Changed

 -  Revert "Set macOS deployment target to macOS 10.4". !93

### Fixed

 - mtod()-related buffer overflows (CVE-2021-3592 #44, CVE-2021-3593 #45,
   CVE-2021-3594 #47, CVE-2021-3595 #46).
 - poll_fd: add missing fd registration for UDP and ICMP
 - ncsi: make ncsi_calculate_checksum work with unaligned data. !89
 - Various typos and doc fixes. !88

## [4.5.0] - 2021-05-18

### Added

 - IPv6 forwarding. !62 !75 !77
 - slirp_neighbor_info() to dump the ARP/NDP tables. !71

### Changed

 - Lazy guest address resolution for IPv6. !81
 - Improve signal handling when spawning a child. !61
 - Set macOS deployment target to macOS 10.4. !72
 - slirp_add_hostfwd: Ensure all error paths set errno. !80
 - More API documentation.

### Fixed

 - Assertion failure on unspecified IPv6 address. !86
 - Disable polling for PRI on MacOS, fixing some closing streams issues. !73
 - Various memory leak fixes on fastq/batchq. !68
 - Memory leak on IPv6 fast-send. !67
 - Slow socket response on Windows. !64
 - Misc build and code cleanups. !60 !63 !76 !79 !84

## [4.4.0] - 2020-12-02

### Added

 - udp, udp6, icmp: handle TTL value. !48
 - Enable forwarding ICMP errors. !49
 - Add DNS resolving for iOS. !54

### Changed

 - Improve meson subproject() support. !53
 - Removed Makefile-based build system. !56

### Fixed

 - socket: consume empty packets. !55
 - check pkt_len before reading protocol header (CVE-2020-29129). !57
 - ip_stripoptions use memmove (fixes undefined behaviour). !47
 - various Coverity-related changes/fixes.

## [4.3.1] - 2020-07-08

### Changed

 - A silent truncation could occur in `slirp_fmt()`, which will now print a
   critical message. See also #22.

### Fixed

 - CVE-2020-10756 - Drop bogus IPv6 messages that could lead to data leakage.
   See !44 and !42.
 - Fix win32 builds by using the SLIRP_PACKED definition.
 - Various coverity scan errors fixed. !41
 - Fix new GCC warnings. !43

## [4.3.0] - 2020-04-22

### Added

 - `SLIRP_VERSION_STRING` macro, with the git sha suffix when building from git
 - `SlirpConfig.disable_dns`, to disable DNS redirection #16

### Changed

 - `slirp_version_string()` now has the git sha suffix when building form git
 - Limit DNS redirection to port 53 #16

### Fixed

 - Fix build regression with mingw & NetBSD
 - Fix use-afte-free in `ip_reass()` (CVE-2020-1983)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Doug Evans <dje@google.com>
@perror
Copy link

perror commented Feb 19, 2023

I stumbled too on this problem (Debian unstable) but I found a workaround (that explain the problem, by the way).

So, lets start from the beginning. Trying to build QEMU end up with:

ERROR: glib-2.48 gthread-2.0 is required to compile QEMU

I checked that gthread-2.0 was present on my distribution which was the case (install libglib2.0-dev if it is not installed).

Looking at the code of the configure leads to the following test which is failing:

#> pkg-config --atleast-version=2.48 gthread-2.0; echo $?
1

But, it seems that the pkg-config file of gthread-2.0 is installed:

#> locate  gthread-2.0.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/gthread-2.0.pc

So, what is missing? Well, the environment variable PKG_CONFIG_PATH can be use to force the distribution to point to the path and find the files:

#> export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig/
#> pkg-config --atleast-version=2.48 gthread-2.0; echo $?
0

After that, this should work.

To summarize, this is definitely not a bug in the build system of QEMU. I really think that this should be reported to the maintainer of the pkg-config package in order to add /usr/lib/x86_64-linux-gnu/pkgconfig/ among the list of the default paths for pkn-config.

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

No branches or pull requests

4 participants