Skip to contentSkip to conversation

target/hexagon: don't look for static glib

PATCH Applied Alyssa Ross 5 participants 7 messages Aug 5, 2024 – Aug 6, 2024 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target/hexagon: don't look for static glib

When cross compiling QEMU configured with --static, I've been getting configure errors like the following:

Build-time dependency glib-2.0 found: NO

../target/hexagon/meson.build:303:15: ERROR: Dependency lookup for glib-2.0 with method 'pkgconfig' failed: Could not generate libs for glib-2.0:
Package libpcre2-8 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libpcre2-8.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libpcre2-8', required by 'glib-2.0', not found

This happens because --static sets the prefer_static Meson option, but my build machine doesn't have a static libpcre2. I don't think it makes sense to insist that native dependencies are static, just because I want the non-native QEMU binaries to be static.

---
 target/hexagon/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/hexagon/meson.build +1 -1
index b0b253aa6b..9ea1f4fc59 100644
@@ -300,7 +300,7 @@ if idef_parser_enabled and 'hexagon-linux-user' in target_dirs
         arguments: ['@INPUT@', '--defines=@OUTPUT1@', '--output=@OUTPUT0@']
     )
 
-    glib_dep = dependency('glib-2.0', native: true)
+    glib_dep = dependency('glib-2.0', native: true, static: false)
 
     idef_parser = executable(
         'idef-parser',

base-commit: f9851d2ffef59b3a7f39513469263ab3b019480f

Signature · 1 line
2.45.2
Reviewed-by on v1 1/1
#2 lore raw
In reply to Alyssa Ross
Quoted 11 lines · Alyssa Ross

When cross compiling QEMU configured with --static, I've been getting configure errors like the following:

Build-time dependency glib-2.0 found: NO

../target/hexagon/meson.build:303:15: ERROR: Dependency lookup for glib-2.0 with method 'pkgconfig' failed: Could not generate libs for glib-2.0:
Package libpcre2-8 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libpcre2-8.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libpcre2-8', required by 'glib-2.0', not found

Quoted 4 lines

This happens because --static sets the prefer_static Meson option, but my build machine doesn't have a static libpcre2. I don't think it makes sense to insist that native dependencies are static, just because I want the non-native QEMU binaries to be static.

Makes sense:

Signature · 2 lines
Alex Bennée
Virtualisation Tech Lead @ Linaro
#3 lore raw
In reply to Alyssa Ross
Quoted 11 lines · Alyssa Ross

When cross compiling QEMU configured with --static, I've been getting configure errors like the following:

Build-time dependency glib-2.0 found: NO

../target/hexagon/meson.build:303:15: ERROR: Dependency lookup for glib-2.0 with method 'pkgconfig' failed: Could not generate libs for glib-2.0:
Package libpcre2-8 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libpcre2-8.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libpcre2-8', required by 'glib-2.0', not found

Quoted 7 lines

This happens because --static sets the prefer_static Meson option, but my build machine doesn't have a static libpcre2. I don't think it makes sense to insist that native dependencies are static, just because I want the non-native QEMU binaries to be static.

---

Thanks for the patch, Alyssa - I'll give it a try.

Quoted 18 lines
  target/hexagon/meson.build | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
target/hexagon/meson.build +1 -1
index b0b253aa6b..9ea1f4fc59 100644
@@ -300,7 +300,7 @@ if idef_parser_enabled and 'hexagon-linux-user' in target_dirs
          arguments: ['@INPUT@', '--defines=@OUTPUT1@', '--output=@OUTPUT0@']
      )
 
-    glib_dep = dependency('glib-2.0', native: true)
+    glib_dep = dependency('glib-2.0', native: true, static: false)
 
      idef_parser = executable(
          'idef-parser',

base-commit: f9851d2ffef59b3a7f39513469263ab3b019480f

#4 lore raw
Quoted 18 lines · Brian Cain
Quoted 16 lines · Alyssa Ross

When cross compiling QEMU configured with --static, I've been getting configure errors like the following:

     Build-time dependency glib-2.0 found: NO

     ../target/hexagon/meson.build:303:15: ERROR: Dependency lookup for glib-2.0 with method 'pkgconfig' failed: Could not generate libs for glib-2.0:
     Package libpcre2-8 was not found in the pkg-config search path.
     Perhaps you should add the directory containing `libpcre2-8.pc'
     to the PKG_CONFIG_PATH environment variable
     Package 'libpcre2-8', required by 'glib-2.0', not found

This happens because --static sets the prefer_static Meson option, but my build machine doesn't have a static libpcre2.  I don't think it makes sense to insist that native dependencies are static, just because I want the non-native QEMU binaries to be static.

Quoted 5 lines
Quoted 2 lines

---

Thanks for the patch, Alyssa - I'll give it a try.

Hmm - ok, I misunderstood the intent of the change because I didn't read the commit message too carefully.  I understand the goal now.

This seems appropriate in most situations, and I guess configure doesn't have a way to distinguish between whether host tools should be static or not.  So it LGTM.

Anton, Alessandro -- thoughts?

Quoted 19 lines
Quoted 18 lines

  target/hexagon/meson.build | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
target/hexagon/meson.build +0 -0
index b0b253aa6b..9ea1f4fc59 100644
@@ -300,7 +300,7 @@ if idef_parser_enabled and 'hexagon-linux-user' 

in target_dirs
          arguments: ['@INPUT@', '--defines=@OUTPUT1@', '--output=@OUTPUT0@'] )
  -    glib_dep = dependency('glib-2.0', native: true)
+    glib_dep = dependency('glib-2.0', native: true, static: false) idef_parser = executable(
          'idef-parser',

base-commit: f9851d2ffef59b3a7f39513469263ab3b019480f

#5 lore raw
Quoted 27 lines · Brian Cain
Quoted 20 lines · Brian Cain
Quoted 18 lines · Alyssa Ross

When cross compiling QEMU configured with --static, I've been getting configure errors like the following:

     Build-time dependency glib-2.0 found: NO

     ../target/hexagon/meson.build:303:15: ERROR: Dependency lookup for glib-2.0 with method 'pkgconfig' failed: Could not generate libs for glib-2.0:
     Package libpcre2-8 was not found in the pkg-config search path. Perhaps you should add the directory containing `libpcre2-8.pc' to the PKG_CONFIG_PATH environment variable
     Package 'libpcre2-8', required by 'glib-2.0', not found

This happens because --static sets the prefer_static Meson option, but my build machine doesn't have a static libpcre2.  I don't think it makes sense to insist that native dependencies are static, just because I want the non-native QEMU binaries to be static.

Quoted 5 lines
Quoted 2 lines

---

Thanks for the patch, Alyssa - I'll give it a try.

Quoted 8 lines

Hmm - ok, I misunderstood the intent of the change because I didn't read the commit message too carefully.  I understand the goal now.

This seems appropriate in most situations, and I guess configure doesn't have a way to distinguish between whether host tools should be static or not.  So it LGTM.

Anton, Alessandro -- thoughts?

This makes sense, and assuming glib2 is shared seems more sensible. We might get the inverse problem where a static glib2 would not be found. I'm a bit surprised meson wouldn't fallback on trying to find a shared version of glib2 when prefer_static is set, hmm.

Signature · 2 lines
Anton Johansson
rev.ng Labs Srl.
Reviewed-by on v1 1/1
#6 lore raw
In reply to Alyssa Ross
Quoted 11 lines · Alyssa Ross

When cross compiling QEMU configured with --static, I've been getting configure errors like the following:

Build-time dependency glib-2.0 found: NO

../target/hexagon/meson.build:303:15: ERROR: Dependency lookup for glib-2.0 with method 'pkgconfig' failed: Could not generate libs for glib-2.0:
Package libpcre2-8 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libpcre2-8.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libpcre2-8', required by 'glib-2.0', not found

Quoted 7 lines

This happens because --static sets the prefer_static Meson option, but my build machine doesn't have a static libpcre2. I don't think it makes sense to insist that native dependencies are static, just because I want the non-native QEMU binaries to be static.

---

Quoted 18 lines
  target/hexagon/meson.build | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
target/hexagon/meson.build +1 -1
index b0b253aa6b..9ea1f4fc59 100644
@@ -300,7 +300,7 @@ if idef_parser_enabled and 'hexagon-linux-user' in target_dirs
          arguments: ['@INPUT@', '--defines=@OUTPUT1@', '--output=@OUTPUT0@']
      )
 
-    glib_dep = dependency('glib-2.0', native: true)
+    glib_dep = dependency('glib-2.0', native: true, static: false)
 
      idef_parser = executable(
          'idef-parser',

base-commit: f9851d2ffef59b3a7f39513469263ab3b019480f