All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabiano Rosas <farosas@suse.de>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
	Juan Quintela <quintela@redhat.com>, Peter Xu <peterx@redhat.com>,
	Leonardo Bras <leobras@redhat.com>
Subject: Re: [PATCH 2/2] meson: Add static glib dependency for initrd-stress.img
Date: Fri, 26 May 2023 10:09:24 -0300	[thread overview]
Message-ID: <87edn39r3v.fsf@suse.de> (raw)
In-Reply-To: <ZHCLfsReGU8nOkUE@redhat.com>

Daniel P. Berrangé <berrange@redhat.com> writes:

> On Thu, May 25, 2023 at 06:20:44PM -0300, Fabiano Rosas wrote:
>> We recently moved glib detection code to meson but the static libs
>> were left out. Add a specific dependency for stress.c which is linked
>> statically.
>> 
>> $ make V=1 tests/migration/initrd-stress.img
>> 
>> before:
>>  cc -m64 -mcx16 -o tests/migration/stress ... -static -Wl,--start-group
>>  /usr/lib64/libglib-2.0.so -Wl,--end-group
>>  ...
>>  bin/ld: attempted static link of dynamic object `/usr/lib64/libglib-2.0.so'
>> 
>> after:
>>  cc -m64 -mcx16 -o tests/migration/stress ... -static -pthread
>>  -Wl,--start-group -lm /usr/lib64/libpcre.a -lglib-2.0 -Wl,--end-group
>> 
>> Fixes: fc9a809e0d ("build: move glib detection and workarounds to meson")
>> Signed-off-by: Fabiano Rosas <farosas@suse.de>
>> ---
>>  tests/migration/meson.build | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>> 
>> diff --git a/tests/migration/meson.build b/tests/migration/meson.build
>> index dd562355a1..ac71f13290 100644
>> --- a/tests/migration/meson.build
>> +++ b/tests/migration/meson.build
>> @@ -1,9 +1,11 @@
>>  sysprof = dependency('sysprof-capture-4', required: false)
>> +glib_static = dependency('glib-2.0', version: glib_req_ver, required: false,
>> +                         method: 'pkg-config', static: true)
>
> Since required: false, the result might be "not found", which means
> we'll still hit the linker error. I think we need to surround the
> 'executable()' bit in
>
>   if glib_static.found()
>      ...
>   endif
>   

Right, but this time it would be a helpful linker error that would tell
you what you are actually missing. Since this is "build_by_default:
false" I think we're better off letting the error through.


  reply	other threads:[~2023-05-26 13:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-25 21:20 [PATCH 0/2] meson: Fix initrd-stress.img build Fabiano Rosas
2023-05-25 21:20 ` [PATCH 1/2] meson: Remove leftover comment Fabiano Rosas
2023-05-25 21:20 ` [PATCH 2/2] meson: Add static glib dependency for initrd-stress.img Fabiano Rosas
2023-05-26 10:32   ` Juan Quintela
2023-05-26 10:35   ` Daniel P. Berrangé
2023-05-26 13:09     ` Fabiano Rosas [this message]
2023-05-26  8:19 ` [PATCH 0/2] meson: Fix initrd-stress.img build Paolo Bonzini
2023-05-26 11:36   ` Daniel P. Berrangé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87edn39r3v.fsf@suse.de \
    --to=farosas@suse.de \
    --cc=berrange@redhat.com \
    --cc=leobras@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.