public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Steve Kargl <sgk@troutmask.apl.washington.edu>
To: Neil Carlson <neil.n.carlson@gmail.com>
Cc: fortran@gcc.gnu.org
Subject: Re: Recommended developer options when building GCC from source
Date: Wed, 10 Apr 2024 11:19:29 -0700	[thread overview]
Message-ID: <ZhbYMU6IMhYEcMdr@troutmask.apl.washington.edu> (raw)
In-Reply-To: <CABkMBNKmDFGziGNu-HC+JW1DBwA6kCGYYNc7YbfJ7iqH4kT+rA@mail.gmail.com>

On Sat, Apr 06, 2024 at 05:54:43PM -0600, Neil Carlson wrote:
> What are the recommended options to use (e.g., --enable-libsanitize) when
> building GCC from source for the purpose of locating gfortran bugs? I'm
> trying to pin down a runtime memory corruption error, and I recall seeing
> at various times in the past recommendations for creating a suitable
> gfortran build and the associated gfortran command line options for dumping
> internal info, but I can't seem to find that info now.

Neil,

Are you debugging on linux- or BSD-based OS?

By default, gcc will build itself with "-g -O2" in the
compiler options.  -O2 can make it more challenging to
debug issues in gfortran.  Once can force gcc to use
either "-g -O" or "-Og" by setting a few environmental
variable.  Looking at my build script, I use 

CFLAGS="-O -g"
BOOT_CFLAGS="-O -g"
CFLAGS_FOR_TARGET="-O -g"
CXXFLAGS="-O -g"
BOOT_CXXFLAGS="-O -g"
CXXFLAGS_FOR_TARGET="-O -g"
LDFLAGS="-O -g"

-- 
steve

      parent reply	other threads:[~2024-04-10 18:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-06 23:54 Neil Carlson
2024-04-07  3:31 ` Jerry D
2024-04-10 18:19 ` Steve Kargl [this message]

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=ZhbYMU6IMhYEcMdr@troutmask.apl.washington.edu \
    --to=sgk@troutmask.apl.washington.edu \
    --cc=fortran@gcc.gnu.org \
    --cc=neil.n.carlson@gmail.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).