public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Tom Tromey <tom@tromey.com>
Cc: Steve Ellcey <sellcey@cavium.com>,
	       gdb-patches <gdb-patches@sourceware.org>,
	simon.marchi@ericsson.com
Subject: Re: gdb build problem (gdb/unittests/scoped_mmap-selftests.c)
Date: Wed, 08 Aug 2018 22:17:00 -0000	[thread overview]
Message-ID: <46300fe0449e77cf8470a4cc391a9e8b@polymtl.ca> (raw)
In-Reply-To: <87sh3o91y2.fsf@tromey.com>

On 2018-08-08 13:56, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simon.marchi@polymtl.ca> writes:
> 
> Simon> I think that enabling _FORTIFY_SOURCE can only do some good.
> 
> What do you think of the appended?
> The check for __OPTIMIZE__ has to be done since otherwise a glibc 
> header
> will complain.
> 
> Building with this patch applied (after autoheader etc) let me 
> reproduce
> Steve's original problem.
> 
> Tom
> 
> diff --git a/gdb/configure.ac b/gdb/configure.ac
> index 13bc5f9a8f2..76a1ba0364f 100644
> --- a/gdb/configure.ac
> +++ b/gdb/configure.ac
> @@ -2279,6 +2279,10 @@ dnl  At the moment, we just assume it's UTF-8.
>  AC_DEFINE(GDB_DEFAULT_HOST_CHARSET, "UTF-8",
>            [Define to be a string naming the default host character 
> set.])
> 
> +AH_BOTTOM([#if defined __OPTIMIZE__ && __OPTIMIZE__ > 0
> +#define _FORTIFY_SOURCE 2
> +#endif])
> +
>  if $development; then
>    AC_DEFINE(GDB_SELF_TEST, 1,
>              [Define if self-testing features should be enabled])

Oh right, _FORTIFY_SOURCE requires building with optimization.  That 
code will end up at the bottom of config.h, is that it?  If so, it LGTM.

Simon

  reply	other threads:[~2018-08-08 22:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-08 15:42 Steve Ellcey
2018-08-08 17:35 ` Tom Tromey
2018-08-08 17:39   ` Simon Marchi
2018-08-08 17:57     ` Tom Tromey
2018-08-08 22:17       ` Simon Marchi [this message]
2018-08-09 13:28       ` Pedro Alves
2018-08-09 14:34         ` Tom Tromey
2018-08-08 18:00     ` Tom Tromey
2018-08-08 17:49   ` Steve Ellcey

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=46300fe0449e77cf8470a4cc391a9e8b@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=sellcey@cavium.com \
    --cc=simon.marchi@ericsson.com \
    --cc=tom@tromey.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).