This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
gfortran, -static and cctools
- From: howarth at bromo dot msbb dot uc dot edu (Jack Howarth)
- To: echristo at apple dot com, fortran at gcc dot gnu dot org, geoffk at apple dot com
- Date: Sun, 10 Sep 2006 12:36:20 -0400 (EDT)
- Subject: gfortran, -static and cctools
Does anyone understand why gfortran on Darwin PPC is unable
to link with the -static flag. If I build current gcc trunk with
Xcode 2.4 (which is required now because of the literal16 change
unless the autoconf hack is added), I find that...
gfortran -O3 -g -static nan_inf_fmt.f90
...generates the linker error...
/usr/bin/ld: can't locate file for: -lcrt0.o
collect2: ld returned 1 exit status
Also, now that we care going to require Xcode 2.4's cctools
to be used we ought to try to understand the origin of the
regression in the gfortran testsuite of nan_inf_fmt failing
when libgfortran is built with Xcode 2.4. What I have found
is that I can use a Xcode 2.3 built gfortran under Xcode 2.4
and build a usable binary for the nan_inf_fmt testcase.
However if I compile gfortran under Xcode 2.4, then the
testcase starts to fail. I assume this implies the error
is in how libgfortran is being built by Xcode 2.4.
Jack
ps The backtrace for the segfault of nan_inf_fmt when
compiled with the cctools in Xcode 2.4 using a gfortran
built against the same is...
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x3fffe695
0x90101fc8 in strtol_l ()
(gdb) bt
#0 0x90101fc8 in strtol_l ()
#1 0x002538c8 in output_float (dtp=0xbfffeba8, f=0x1808c50, value=inf) at ../../../gcc-4.2-20060910/libgfortran/io/write.c:496
#2 0x002541dc in write_float (dtp=0xbfffeba8, f=0x1808c50, source=0xa <Address 0xa out of bounds>, len=-1610603800) at ../../../gcc-4.2-20060910/libgfortran/io/write.c:912
#3 0x0024e8c0 in formatted_transfer (dtp=0xbfffeba8, type=BT_REAL, p=0xa, kind=4, size=4, nelems=1) at ../../../gcc-4.2-20060910/libgfortran/io/transfer.c:954
#4 0x0024cb8c in *__gfortran_transfer_real (dtp=0x24e3e8, p=0xbfffeb6c, kind=4) at ../../../gcc-4.2-20060910/libgfortran/io/transfer.c:1237
#5 0x00002f6c in MAIN__ () at nan_inf_fmt.f90:17
#6 0x00003ae4 in main (argc=1073735317, argv=0x0) at ../../../gcc-4.2-20060910/libgfortran/fmain.c:18
Again this problem is unique to Xcode 2.4 and newer and doesn't occur
with Xcode 2.3.