qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Alexander Bulekov <alxndr@bu.edu>
Cc: "Darren Kenny" <darren.kenny@oracle.com>,
	"Bandan Das" <bsd@redhat.com>, qemu-devel <qemu-devel@nongnu.org>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>
Subject: Re: [Fwd] Issue 25164 in oss-fuzz: qemu: Fuzzing build failure
Date: Fri, 28 Aug 2020 21:41:26 +0200	[thread overview]
Message-ID: <9dfe703d-5c78-36d0-bc15-17ff6f9179d7@redhat.com> (raw)
In-Reply-To: <20200828183305.6lbuwvmleqtn7fx3@mozz.bu.edu>

On 28/08/20 20:33, Alexander Bulekov wrote:
>> Create a fuzz.cmd that includes the correct path to fuzz.ld in the
>> source tree (using configure_file) and pass this file to the linker
>> using @tests/libqtest/fuzz/fuzz.cmd in link_args (and also
>> link_depends). See libblock and block for an example.
> I'm not sure whether this solves the problem that the linker-script is
> placed in between --start-group and --end-group arguments.  It seems
> that no matter what I do to specify the linker script with -Wl,-T, and
> link_args, the flag ends up placed between --start-group and --end-group
> due to some parsing that meson does in
> mesonbuild/compilers/mixins/clike.py.

Looks like you need to ensure that the link_args for -T and -wrap come
before everything else.

For example:

-Wl,--whole-archive qom/libqom.fa io/libio.fa crypto/libcrypto.fa
authz/libauthz.fa hw/core/libhwcore.fa libblock.fa libqmp.fa
chardev/libchardev.fa -Wl,--no-whole-archive -Wl,--warn-common
-Wl,-z,relro -Wl,-z,now -m64 -fstack-protector-strong
migration/libmigration.fa -Wl,--start-group libqemuutil.a qom/libqom.fa
io/libio.fa crypto/libcrypto.fa authz/libauthz.fa hw/core/libhwcore.fa
libblock.fa libqmp.fa chardev/libchardev.fa @block.syms @qemu.syms

libqemuutil.a is what triggers --start-group.  So if you can add them
using add_project_link_arguments it should work.

Paolo



  reply	other threads:[~2020-08-28 19:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-23 22:58 [Fwd] Issue 25164 in oss-fuzz: qemu: Fuzzing build failure Alexander Bulekov
2020-08-25  7:58 ` Paolo Bonzini
2020-08-26 13:55   ` Alexander Bulekov
2020-08-26 15:15     ` Paolo Bonzini
2020-08-28 18:33       ` Alexander Bulekov
2020-08-28 19:41         ` Paolo Bonzini [this message]
2020-09-01 18:18           ` [PATCH] fuzz: Add support for custom fuzzing library Alexander Bulekov
2020-09-01 18:39             ` Paolo Bonzini
2020-09-01 19:00             ` Paolo Bonzini
2020-09-02 12:27             ` no-reply
2020-09-02 12:31             ` no-reply
2020-09-02 12:33             ` no-reply

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=9dfe703d-5c78-36d0-bc15-17ff6f9179d7@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=alxndr@bu.edu \
    --cc=bsd@redhat.com \
    --cc=darren.kenny@oracle.com \
    --cc=f4bug@amsat.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).