g95 linking problems after upgrading from MaOSX 10.4 Tiger to 10.5 Leopard

88 views
Skip to first unread message

Al Greynolds

unread,
Nov 3, 2007, 6:45:24 PM11/3/07
to gg95
After upgrading to Leopard, g95 can no longer create a binary due to
the following link errors:

ld: /usr/lib///libm.dylib unknown flags (type) of section 6
(__TEXT,__dof_plockstat) in load command 0
ld: /usr/lib///libmx.dylib segment __TEXT contains no sections and
can't be link-edited
ld: /usr/lib///libSystem.dylib unknown flags (type) of section 6
(__TEXT,__dof_plockstat) in load command 0

Any ideas?

Al Greynolds
www.ruda.com

Martin Costabel

unread,
Nov 4, 2007, 3:46:49 AM11/4/07
to gg...@googlegroups.com

Are you using a special ld made for g95? It seems to be too old to
understand the Leopard libraries.

Unfortunately, g95 also does not build on Leopard. So, unless the g95
developers do something, and very quickly, the game for g95 on the Mac
is over.

--
Martin

Al Greynolds

unread,
Nov 5, 2007, 6:47:01 AM11/5/07
to gg95
I believe I'm using the latest ld for gcc 4.0.1 from Apple:

/usr/bin$ ld -v
Apple Computer, Inc. version cctools-622.5.obj~13

I hope the problem with g95 under Leopard is fixed soon.
Unforturnately the last time I e-mailed the developer
an...@firstinter.net on an unrelated issue, it was returned as
undeliverable.

Al

Martin Costabel

unread,
Nov 5, 2007, 2:29:35 PM11/5/07
to gg...@googlegroups.com
Al Greynolds wrote:
> I believe I'm using the latest ld for gcc 4.0.1 from Apple:
>
> /usr/bin$ ld -v
> Apple Computer, Inc. version cctools-622.5.obj~13

This is not necessarily the same ld that is used by g95. For example, I
have here a g95 that answers on "g95 -v":

Using built-in specs.
Target:
Configured with: ../configure
--prefix=/sw/lib/gcc-lib/powerpc-apple-darwin8/4.0.3
--enable-languages=c --with-as=/sw/lib/odcctools590/bin/as
--with-ld=/sw/lib/odcctools590/bin/ld
--with-nm=/sw/lib/odcctools590/bin/nm --with-included-gettext
Thread model: posix
gcc version 4.0.3 (g95 0.90!) Nov 14 2006

This is from Fink, and it uses a special Fink-provided ld from
odcctools590. It works on Tiger, but on Leopard it gives the same error
as you have been seeing.

--
Martin

Peter Knowles

unread,
Nov 6, 2007, 9:06:18 AM11/6/07
to gg95
I am seeing quite a different error message, but the same frustration:

$ g95 test.F
/var/folders/3e/3exGxwUPGCadpQCXucA8S+++-++/-Tmp-//cc17LJ0r.s:
59:indirect jmp without `*'
/var/folders/3e/3exGxwUPGCadpQCXucA8S+++-++/-Tmp-//cc17LJ0r.s:
78:indirect jmp without `*'
/var/folders/3e/3exGxwUPGCadpQCXucA8S+++-++/-Tmp-//cc17LJ0r.s:
97:indirect jmp without `*'
/var/folders/3e/3exGxwUPGCadpQCXucA8S+++-++/-Tmp-//cc17LJ0r.s:
112:indirect jmp without `*'
ld: unknown/unsupported architecture name for: -arch i686
$ g95 -v
Using built-in specs.
Target:
Configured with: ../configure --enable-languages=c
Thread model: posix
gcc version 4.0.3 (g95 0.91!) Oct 27 2007
$ ld -v -v
@(#)PROGRAM:ld PROJECT:ld64-77
@(#)PROGRAM:ld PROJECT:ld64-77
Library search paths:
/usr/lib
/usr/local/lib
Framework search paths:
/Library/Frameworks/
/System/Library/Frameworks/
/Network/Library/Frameworks/
ld: warning -arch not specified
ld: no object files specified for inferred architecture i386

This is with the g95 downloaded from g95.org, and after doing an
upgrade to Leopard, including developer tools. Any ideas?
Peter

Al Greynolds

unread,
Nov 15, 2007, 11:04:56 AM11/15/07
to gg95
Still having problems with latest g95 build under Leopard.

~/g95/geloe$ gcc -v
Using built-in specs.
Target: i686-apple-darwin9
Configured with: /var/tmp/gcc/gcc-5465~16/src/configure --disable-
checking -enable-werror --prefix=/usr --mandir=/share/man --enable-
languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/
$/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/
lib --build=i686-apple-darwin9 --with-arch=apple --with-tune=generic --
host=i686-apple-darwin9 --target=i686-apple-darwin9
Thread model: posix
gcc version 4.0.1 (Apple Inc. build 5465)

~/g95/geloe$ ld -v
Apple Computer, Inc. version cctools-622.5.obj~13

~/g95/geloe$ g95 -fdollar-ok -v geloe.f90
Driving: g95 -fdollar-ok -v geloe.f90 -lf95 -lm
Using built-in specs.
Target:
Configured with: ../configure
Thread model: posix
gcc version 4.0.3 (g95 0.91!) Nov 13 2007
/Users/algreynolds/g95-install/bin/../lib/gcc-lib/i386-apple-
darwin8.10.3/4.0.3//f951 geloe.f90 -fPIC -quiet -dumpbase geloe.f90 -
auxbase geloe -version -fdollar-ok -o /var/folders/Me/
Meqa884QGJiMLOhCHzRL9++++TI/-Tmp-//ccs0ZskE.s
G95 Fortran 95 version 4.0.3 (g95 0.91!) Nov 13 2007 (i386-apple-
darwin8.10.3)
compiled by GNU C version 4.0.1 (Apple Computer, Inc. build 5367).
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-
heapsize=131072
I/var/folders/Me/Meqa884QGJiMLOhCHzRL9++++TI/-Tmp-//ccs0ZskE.s:
515261:indirect jmp without `*'
ld -dynamic -arch i386 -weak_reference_mismatches non-weak -o a.out -
lcrt1.o /Users/algreynolds/g95-install/bin/../lib/gcc-lib/i386-apple-
darwin8.10.3/4.0.3//crt2.o -L/Users/algreynolds/g95-install/bin/../lib/
gcc-lib/i386-apple-darwin8.10.3/4.0.3/ -L/Users/algreynolds/g95-
install/bin/../lib/gcc-lib/i386-apple-darwin8.10.3/4.0.3 -L/usr/lib/
gcc// -L/Users/algreynolds/g95-install/bin/../lib/gcc-lib/i386-apple-
darwin8.10.3/4.0.3/// -L/Users/algreynolds/g95-install/bin/../lib/gcc-
lib/i386-apple-darwin8.10.3/4.0.3/ -L/usr/lib// /var/folders/Me/
Meqa884QGJiMLOhCHzRL9++++TI/-Tmp-//ccVBueb6.o -lf95 -lm -lgcc -lgcc_eh
-lSystemStubs -lmx -lSystem

Martin Costabel

unread,
Nov 15, 2007, 6:29:21 PM11/15/07
to gg...@googlegroups.com
Al Greynolds wrote:
[]

> ~/g95/geloe$ ld -v
> Apple Computer, Inc. version cctools-622.5.obj~13

This is not /usr/bin/ld from Leopard, it's something else, and too old.

[]


> ld: /usr/lib///libm.dylib unknown flags (type) of section 6
> (__TEXT,__dof_plockstat) in load command 0

But even if you use Leopard's ld, g95 won't build on Leopard, and a g95
built on Tiger won't work on Leopard as you are showing.

--
Martin

Peter Knowles

unread,
Nov 16, 2007, 4:01:01 AM11/16/07
to gg95
Andy has now fixed this.

Takeshi

unread,
Nov 18, 2007, 9:16:30 PM11/18/07
to gg95
Peter,

> Andy has now fixed this.

Do you know what kind of fix is this?
Is it a fix for gcc or g95?

I maintain a g95 package for MacPorts.
Now I can build g95-0.9 for both PPC and Intel Macs.

The dist files can not rely on a snapshot but a stable version.
So if possible, I would like to continue to use g95-0.9.
I would like to create patches for g95-0.9 if the fix is not
complicated.

> > /var/folders/3e/3exGxwUPGCadpQCXucA8S+++-++/-Tmp-//cc17LJ0r.s:
> > 59:indirect jmp without `*'

I still get similar messages.
An executable ("Hello, world!") is created and seems to work.

> > ld: unknown/unsupported architecture name for: -arch i686

I replaced "i686" with "i386" in gcc-4.0.3/gcc/config/i386/darwin.h.

See <http://trac.macosforge.org/projects/macports/ticket/13190>.

Takeshi

unread,
Nov 19, 2007, 4:06:11 AM11/19/07
to gg95, peterj...@googlemail.com
Peter,

Thanks for your reply.

I have just succeed in building g95 that does not complain!
I modified a source in gcc-4.0.3.

There was a similar problem with gpc.

<http://www.nabble.com/indirect-jmp-redux-(Mac-OS-on-Intel)-
t3368601.html>

I uploaded patches.
<http://trac.macosforge.org/projects/macports/ticket/13190>

Takeshi

jwhowarth

unread,
Nov 20, 2007, 10:38:22 AM11/20/07
to gg95
Takeshi,
Which version of cctools are you building g95 against?
I have created packaging for g95 under fink that builds using
the patches you uploaded to MacPorts. with the system cctools...

http://sourceforge.net/tracker/index.php?func=detail&aid=1834902&group_id=17203&atid=414256

The resulting g95 seems to work fine except that building programs
like
ncarg on Macintel under Leopard results in warnings that symbol sizes
have changed
during the linkage. These warnings also appear when the resulting
binaries are executed.
I am wondering if you see the same issues or if you have managed to
patch odcctools 590
to build under Leopard. I'm sure the problem is due to patches not
having been backported
from gcc 4.2,x to gcc 4.0.x for the newer cctools support. I plan on
looking into whether these
patches can be identified and backported but the real solution is for
Andy to support building
g95 with the gcc 4.2.x source tree.
Thanks in advance for any information.
Jack

Takeshi

unread,
Nov 21, 2007, 8:58:24 AM11/21/07
to gg95
Jack

> Which version of cctools are you building g95 against?

I used systems cctools (/usr/bin/ld for example) since odcctools does
not build.

> The resulting g95 seems to work fine except that building programs
> like ncarg on Macintel under Leopard results in warnings that symbol sizes
> have changed during the linkage. These warnings also appear when the resulting
> binaries are executed.

I have not yet tested throughly. I will try it with NCARG.
Since the package cannot rely on snapshots,
it would be nice to have an updated stable version > 0.9.

Takeshi

jwhowarth

unread,
Nov 21, 2007, 9:56:46 AM11/21/07
to gg95
Takeshi,
The g95-0.91 snapshot does contain configure code for GCC41
which is triggered for a build against gcc 4.2.2. However the
framework
of gcc has changed so that we end up with a couple undefined symbols
when g95 is linked. I'll play around over the weekend with that build
to
see if I can coax g95 to link.
I vaguely recall the linker warnings from the run-up to gcc 4.2.2
and
believe they may have been why g95 has been built against odcctools
590 rather than the later releases of odcctools.
Jack

Max

unread,
Nov 22, 2007, 1:36:55 PM11/22/07
to gg95
Thank you so much for solving this problem! I was beginning to regret
upgrading to Leopard.
Where can I download a precompiled binary including your fix?
I just installed the allegedly fixed Mac binary from http://www.g95.org
(updated November 16 2007), but got the same old error messages:

ld: /usr/lib///libm.dylib unknown flags (type) of section 6
(__TEXT,__dof_plockstat) in load command 0
ld: /usr/lib///libmx.dylib segment __TEXT contains no sections and
can't be link-edited
ld: /usr/lib///libSystem.dylib unknown flags (type) of section 6
(__TEXT,__dof_plockstat) in load command 0

Thanks in advance,
Max

Hellary

unread,
Nov 26, 2007, 7:47:03 PM11/26/07
to gg95
Takeshi,

I was wondering if you could help me. I need g95 for some work I'm
about to start doing but I'm new to the whole MacPorts thing. I've
installed MacPorts, created a local library for portfiles etc and
indexed it (following instructions found here:
http://homepage.mac.com/simx/technonova/C488455530/E20070507215650/index.html

I then created a lang/g95 folder and placed the extracted files from
g95.tgz into it, then portfile.patch, then the two patch**.c files
into the files folder. When I attempt to build g95 using "sudo port
install g95" I still get the same error as I did before, i.e. its
attempting to build odcctools.

This is probably the wrong place to ask you this but I figured if
anyone would know, you would. Is there something I'm missing?

Kind Regards,

Phil

Ed Worth

unread,
Jan 6, 2008, 9:30:42 PM1/6/08
to gg95
I installed the latest g95 compiler after switching to Leopard. The
installation went fine, but now when I compile a simple Fortran
program I get the following messages. So far the compile appears to
have generated an executable that runs satisfactorily. Still the
messages have me concerned when I try recompiling my more complex
fortran code.

/var/folders/le/leEO469q2RasIk+BYoqdOU+++TI/-Tmp-//ccHrd4s4.s:
11081:indirect jmp without `*'
/var/folders/le/leEO469q2RasIk+BYoqdOU+++TI/-Tmp-//ccHrd4s4.s:
11100:indirect jmp without `*'
/var/folders/le/leEO469q2RasIk+BYoqdOU+++TI/-Tmp-//ccHrd4s4.s:
11115:indirect jmp without `*'
.
.
.
.


On Nov 26 2007, 7:47 pm, Hellary <goo...@hellary.co.uk> wrote:
> Takeshi,
>
> I was wondering if you could help me. I need g95 for some work I'm
> about to start doing but I'm new to the whole MacPorts thing. I've
> installed MacPorts, created a local library for portfiles etc and
> indexed it (following instructions found here:http://homepage.mac.com/simx/technonova/C488455530/E20070507215650/in...

Takeshi

unread,
Jan 11, 2008, 3:00:45 AM1/11/08
to gg95
Hello Ed,


> /var/folders/le/leEO469q2RasIk+BYoqdOU+++TI/-Tmp-//ccHrd4s4.s:
> 11081:indirect jmp without `*'

I fixed this problems with g95 package in MacPorts.

See the patches under 'files' directory
<http://svn.macports.org/repository/macports/trunk/dports/lang/g95/>
if you rather wish to compile on your own.

Takeshi

Ed Worth

unread,
Jan 12, 2008, 5:03:32 PM1/12/08
to gg95
Takeshi,
Thanks, that fixed the problem.
I had not used MacPorts prior to this. Once I had it installed,
everything went smoothly.
I assume that this has installed a completely new copy of g95 and I
can trash the original version.
Ed

Astro Guy

unread,
Apr 6, 2008, 4:27:21 PM4/6/08
to Ed Worth, gg...@googlegroups.com
Hi
I also had similar problem linking g95 after upgrading to Leopard.
I did the following and now its running smoothly.

1) Installed XCode from the Leopard DVD
2) Installed macports from macports.org (http://www.macports.org/
install.php). Installed .dmg for Leopard (Universal)
3) using terminal or X11 goto to the directory where "port" is
installed (/opt/local/bin)
4) run this command:
sudo port -d install g95
(enter the password, you should have administrative privilages)
5) once the installation is over, add the path in either .bashrc
or .cshrc file depending on which shell you are using.

The g95 will be installed in " /opt/local/var/macports/software/
g95/0.90_6+darwin_9/opt/local/bin "

So add this path to your .bashrc or .cshrc file
Heres how mine looks like in .cshrc file

setenv PATH /usr/local/bin:/usr/bin:/opt/local/var/macports/software/
g95/0.90_6+darwin_9/opt/local/bin:$PATH

setenv LD_LIBRARY_PATH ///opt/local/var/macports/software/
g95/0.90_6+darwin_9/opt/local/lib/

Now open new terminal and g95 should run.

Tilvi
Reply all
Reply to author
Forward
0 new messages