http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51779
--- Comment #11 from Tim Williams <zippy at anl dot gov> 2012-01-10 19:45:44 UTC --- (In reply to comment #10) > (In reply to comment #9) > > Thanks, Tobias. I did try out the gfortran 4.6.2 from here, and it does > > compile > > runnable code. Unfortunately, it still does not work with any version of > > gdb I > > have tried on Mac OS X. My end goal in building the whole of gcc 4.6.2 was > > to > > try building a Fortran code and debug it with the latest gdb version > > (7.3.1). > > No luck with this prebuilt gfortran binary either. > > You will need to compile binaries with -Wl,-no_pie if you want to debug in > FSF gdb > under Lion (which defaults to -pie in the linker). Apple's gdb automatically > disables > aslr under Lion (which can be turned back on by setting the disable-aslr flag > to 0 within > Apple's gdb). This option doesn't exist in FSF gdb yet as far as I know. > > ps There is some discussion of this at > http://reverse.put.as/2011/08/11/how-gdb-disables-aslr-in-mac-os-x-lion/. The -Wl,-no_pie linker flag is definitely secret sauce I was missing. This made gdb 7.3.1 work with my test fortran program---was able to set breakpoints and look at some variables. Thanks, Jack.