public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
* Recommended developer options when building GCC from source
@ 2024-04-06 23:54 Neil Carlson
  2024-04-07  3:31 ` Jerry D
  2024-04-10 18:19 ` Steve Kargl
  0 siblings, 2 replies; 3+ messages in thread
From: Neil Carlson @ 2024-04-06 23:54 UTC (permalink / raw)
  To: fortran

[-- Attachment #1: Type: text/plain, Size: 429 bytes --]

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.

Thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Recommended developer options when building GCC from source
  2024-04-06 23:54 Recommended developer options when building GCC from source Neil Carlson
@ 2024-04-07  3:31 ` Jerry D
  2024-04-10 18:19 ` Steve Kargl
  1 sibling, 0 replies; 3+ messages in thread
From: Jerry D @ 2024-04-07  3:31 UTC (permalink / raw)
  To: Neil Carlson, fortran

On 4/6/24 4:54 PM, 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.
> 
> Thanks!

I use this:

#! /bin/bash

rm -rf /home/jerry/dev/objdir/*
cd /home/jerry/dev/objdir
../trunk/configure --prefix=/home/jerry/dev/usr 
--enable-languages=c,c++,fortran --enable-libgomp --disable-
bootstrap --enable-valgrind-annotations
make -j10 1>/dev/null && make install 1>/dev/null
echo "Build of trunk complete.."

-fdump-tree-original is one of the options if you intend to do front-end 
work.

More info here:

Must read links for new developers/contributors:

https://gcc.gnu.org/fortran/

https://www.gnu.org/prep/standards/standards.html

https://gcc.gnu.org/gitwrite.html

https://gcc.gnu.org/wiki/GFortranHacking

https://gcc.gnu.org/onlinedocs/gcc-13.2.0/gccint/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Recommended developer options when building GCC from source
  2024-04-06 23:54 Recommended developer options when building GCC from source Neil Carlson
  2024-04-07  3:31 ` Jerry D
@ 2024-04-10 18:19 ` Steve Kargl
  1 sibling, 0 replies; 3+ messages in thread
From: Steve Kargl @ 2024-04-10 18:19 UTC (permalink / raw)
  To: Neil Carlson; +Cc: fortran

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-04-10 18:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-06 23:54 Recommended developer options when building GCC from source Neil Carlson
2024-04-07  3:31 ` Jerry D
2024-04-10 18:19 ` Steve Kargl

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).