public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: Evgeny Vereshchagin <evvers@ya.ru>
Cc: elfutils-devel@sourceware.org
Subject: Re: [PATCH v2] build: allow turning off --no-undefined and -z,defs
Date: Sat, 4 Dec 2021 21:26:39 +0100	[thread overview]
Message-ID: <YavO/93sH6hvEg9U@wildebeest.org> (raw)
In-Reply-To: <20211203141721.987169-1-evvers@ya.ru>

Hi Evgeny,

On Fri, Dec 03, 2021 at 02:17:21PM +0000, Evgeny Vereshchagin wrote:
> ASan, UBSan and MSan provided by clang aren't compatible with --no-undefined and -z,defs:
> https://clang.llvm.org/docs/AddressSanitizer.html#usage
> https://github.com/google/sanitizers/issues/380
> so to build elfutils with clang with the sanitizers it should be possible
> to turn them off.

I have to agree with Florian, this really is a bug in the compiler you
are using.  Adding -fsanitize=address to CFLAGS/CXXFLAGS works just
fine with gcc.  I have been using it in the past in combination with
the afl fuzzer (32bit only).  It doesn't work together with
--enable-valgrind though.

That said, I really would like to add address sanitizer support. It
would be great to add this to our buildbot CI to catch more issues
early. We already support --enable-sanitize-undefined and
--enable-valgrind. But sadly we have to disable valgrind in a couple
of testcases, specifically when testing the debuginfod server.

I just testing with gcc (Debian 10.2.1-6) 10.2.1 20210110 on arm64 and
it actually found some issues. I'll post patches for those.

There is one issue with the test-nlist test because we use special
CFLAGS for that. But if we introduce an --enable-sanitize-address we
could work around that.

If clang really cannot be fixed then your patch in combination with an
--enable-sanitize-address might be a good idea. But I don't think it
makes sense as a standalone option. In the past we made the mistake of
adding configure options to disable some necessary flags, like
--disable-symbol-versioning, which was a mistake. There are now
distros shipping elfutils libraries with broken abis while using the
same SONAMEs.

Cheers,

Mark


  reply	other threads:[~2021-12-04 20:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-03  5:37 [PATCH] " Evgeny Vereshchagin
2021-12-04 13:03 ` Florian Weimer
2021-12-03 14:17   ` [PATCH v2] " Evgeny Vereshchagin
2021-12-04 20:26     ` Mark Wielaard [this message]
2021-12-03 18:02       ` [PATCH v3] " Evgeny Vereshchagin
2021-12-05 15:50         ` Mark Wielaard
2021-12-05 16:52           ` Evgeny Vereshchagin
2021-12-08 15:29             ` Mark Wielaard
2021-12-08 19:15               ` Evgeny Vereshchagin

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=YavO/93sH6hvEg9U@wildebeest.org \
    --to=mark@klomp.org \
    --cc=elfutils-devel@sourceware.org \
    --cc=evvers@ya.ru \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).