From: David Edelsohn <dje.gcc@gmail.com>
To: Peter Bergner <bergner@vnet.ibm.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>, Jakub Jelinek <jakub@redhat.com>
Subject: Re: [PATCH, rs6000, 4.9] Fix many powerpc*-linux ASAN test suite failures
Date: Fri, 18 Jul 2014 15:39:00 -0000 [thread overview]
Message-ID: <CAGWvny=osWHfG4Ey8jqsLkEF0i1gDE4d6A48BwiWwHORVzo_Gg@mail.gmail.com> (raw)
In-Reply-To: <1405608991.4285.53.camel@otta>
This is okay with me if it is okay with the Release Managers.
Thanks, David
On Thu, Jul 17, 2014 at 10:56 AM, Peter Bergner <bergner@vnet.ibm.com> wrote:
> With a recent mainline libsanitizer merge from upstream, we're now seeing a
> lot of mainline ASAN test suite failures with the following error:
>
> ==26426==ASan runtime does not come first in initial library list; you should
> either link runtime to your application or manually preload it with LD_PRELOAD.
> FAIL: c-c++-common/asan/asan-interface-1.c -O0 execution test
>
> This is caused by mainline libasan detecting that libasan is not linked
> first and erroring out. With the 4.8 and 4.9, we may just silently run
> into problems. The root cause is that powerpc*-linux does not define
> LIBASAN_EARLY_SPEC which is defined in gnu-user.h. It looks like all
> *-linux architectures include gnu-user.h except for powerpc*-linux.
> As discussed, for the 4.8 and 4.9 backports of the original patch, we
> will just copy those defines to the rs6000 header files and not try and
> include gnu-user.h itself.
>
> This is slightly different than the 4.8 patch, since the STATIC_LIB[AT]SAN_LIBS
> macro was deleted in 4.9.
>
> This passed bootstrap and regtesting on powerpc64-linux with no regressions.
> Ok for 4.9?
>
> Peter
>
> * config/rs6000/sysv4.h:
>
> Index: gcc/config/rs6000/sysv4.h
> ===================================================================
> --- gcc/config/rs6000/sysv4.h (revision 212695)
> +++ gcc/config/rs6000/sysv4.h (working copy)
> @@ -949,3 +949,19 @@ ncrtn.o%s"
> #define TARGET_USES_SYSV4_OPT 1
>
> #undef DBX_REGISTER_NUMBER
> +
> +/* Link -lasan early on the command line. For -static-libasan, don't link
> + it for -shared link, the executable should be compiled with -static-libasan
> + in that case, and for executable link link with --{,no-}whole-archive around
> + it to force everything into the executable. And similarly for -ltsan. */
> +#if defined(HAVE_LD_STATIC_DYNAMIC)
> +#undef LIBASAN_EARLY_SPEC
> +#define LIBASAN_EARLY_SPEC "%{!shared:libasan_preinit%O%s} " \
> + "%{static-libasan:%{!shared:" \
> + LD_STATIC_OPTION " --whole-archive -lasan --no-whole-archive " \
> + LD_DYNAMIC_OPTION "}}%{!static-libasan:-lasan}"
> +#undef LIBTSAN_EARLY_SPEC
> +#define LIBTSAN_EARLY_SPEC "%{static-libtsan:%{!shared:" \
> + LD_STATIC_OPTION " --whole-archive -ltsan --no-whole-archive " \
> + LD_DYNAMIC_OPTION "}}%{!static-libtsan:-ltsan}"
> +#endif
>
>
next prev parent reply other threads:[~2014-07-18 15:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-17 15:05 Peter Bergner
2014-07-18 15:39 ` David Edelsohn [this message]
2014-07-18 15:57 ` Jakub Jelinek
2014-07-21 22:25 ` Peter Bergner
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='CAGWvny=osWHfG4Ey8jqsLkEF0i1gDE4d6A48BwiWwHORVzo_Gg@mail.gmail.com' \
--to=dje.gcc@gmail.com \
--cc=bergner@vnet.ibm.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jakub@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 read-only IMAP folder(s) and NNTP newsgroup(s).