Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Static linking with XLF



Unfortunately this will not work because the XL Fortran drivers pass "-dynamic" to the linker and you cannot pass both "-static" and "-dynamic".

You can never create a truly statically linked executable on Mac OS X because Apple does not provide a static library copy of libSystem or libm. So even if you edited the config file to remove -dynamic or constructed your own linker command this would not work. I (and IBM support) believe the solution I posted previously is best.


------------- Scott Campbell Absoft Technical Support email@hidden http://www.absoft.com/support.html

Fawzi Mohamed wrote:
You can try with
    -Wl -static
and maybe also adding
    -Wl -static-libgcc

from xlf help:
       -W<x>,<option1>[,<option2>[, ... [,<optionN>] ... ]]
              Sends options to component <x>, where <x> can be
              one of the following:

              Component                <x>           Program Name
              C preprocessor            F               cpp
              compiler front end        c               xlfentry
              IPA/loop optimizer        I (uppercase i) ipa
              assembler                 a               as
              linker                    l (lowercase L) ld
              binder                    z               bolt

from the man page of gcc
-static
On systems that support dynamic linking, this prevents linking with
the shared libraries. On other systems, this option has no effect.


This option will not work on Mac OS X unless all of your libraries
(including libgcc.a) have also been compiled with -static.


Fawzi
On Jan 4, 2005, at 6:35 PM, Toby White wrote:

Absoft Technical Support wrote:

Since the Mac OS X linker searchs dynamic libraries first, e.g., libx.dylib first and then libx.a, dynamic libraries are used by default. In order to link the archive libraries, one would need to make sure dynamic libraries are not used by the linker in resolving symbols.
There can be many ways to achieve this. One way to accomplish this is:


[snip]

But are there any ways which
a) do not require me to have administrator privileges
and
b) would allow me to create a makefile with the appropriate commands
in, that I can distribute to other people to use without requiring
them to alter their system configuration?

Toby White
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Fortran-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/fortran-dev/email@hidden

This email sent to email@hidden



!DSPAM:41dad7c4166471992096785!

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Fortran-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/fortran-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: Static linking with XLF (From: Absoft Technical Support <email@hidden>)
 >Re: Static linking with XLF (From: Toby White <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.