This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Fix dynamic module linking on Mac OSX/OSXS
Type: Stage:
Components: Build Versions:
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: gvanrossum Nosy List: bbum, gvanrossum, loewis
Priority: normal Keywords: patch

Created on 2000-11-11 08:01 by bbum, last changed 2022-04-10 16:03 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
None bbum, 2000-11-11 08:01 None
Messages (6)
msg34778 - (view) Author: Bill Bumgarner (bbum) Date: 2000-11-11 08:01
 
msg34779 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2001-01-10 21:37
Looks to me like a newer version of this patch is submitted as #102362, so I'm rejecting this one.
msg34780 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2000-11-12 10:07
If you add an option that is required for something, then it would be good to add a comment to indicate what the something is. Also, are you sure that linking with the Foundation framework is absolutely necessary? Would it be possible for extension modules to link with the framework themselves if they need it?
msg34781 - (view) Author: Bill Bumgarner (bbum) Date: 2000-11-11 19:05
*** /tmp/Python-2.0/configure.in        Mon Oct 16 17:50:06 2000
--- configure.in        Sat Nov 11 13:54:43 2000
***************
*** 573,581 ****
          Darwin/*|next/*) 
                if test "$ns_dyld"
                then 
!                 if test "$ac_sys_system" = Darwin
!                 then LDSHARED='$(CC) $(LDFLAGS) -bundle -undefined suppress'
!                 else LDSHARED='$(CC) $(LDFLAGS) -bundle -prebind'
                  fi
                else LDSHARED='$(CC) $(CFLAGS) -nostdlib -r';
                fi
--- 573,579 ----
          Darwin/*|next/*) 
                if test "$ns_dyld"
                then 
!                 LDSHARED='$(CC) $(LDFLAGS) -bundle -undefined suppress'
                  fi
                else LDSHARED='$(CC) $(CFLAGS) -nostdlib -r';
                fi
***************
*** 646,652 ****
        # in System.framework; otherwise, __objcInit (referenced in
        # crt1.o) gets erroneously defined as common, which breaks dynamic
        # loading of any modules which reference it in System.framework
!       next/4*|next/5*) LINKFORSHARED="-u __dummy -framework System" ;;
        Darwin/*) LINKFORSHARED="-framework System" ;;
        SCO_SV*) LINKFORSHARED="-Bdynamic -dy -Wl,-Bexport";;
        ReliantUNIX*) LINKFORSHARED="-W1 -Blargedynsym";;
--- 644,650 ----
        # in System.framework; otherwise, __objcInit (referenced in
        # crt1.o) gets erroneously defined as common, which breaks dynamic
        # loading of any modules which reference it in System.framework
!       next/4*|next/5*) LINKFORSHARED="-u __dummy -framework System -framework Foundation" ;;
        Darwin/*) LINKFORSHARED="-framework System" ;;
        SCO_SV*) LINKFORSHARED="-Bdynamic -dy -Wl,-Bexport";;
        ReliantUNIX*) LINKFORSHARED="-W1 -Blargedynsym";;
msg34782 - (view) Author: Bill Bumgarner (bbum) Date: 2000-11-11 19:07
The addition of -framework Foundation is required to allow dynamically loaded modules to have access to the Objective-C runtiem under OSXS.

This *may* also be required under Darwin/OSX, but-- if that is the case-- it will be submitted as a separate patch once I restore my OSX work environment and can verify that it is the case.
msg34783 - (view) Author: Bill Bumgarner (bbum) Date: 2000-11-12 16:22
(It isn't clear where one can actually document a patch when uploading the first version.   I'll have to make sure and add a comment after the initial upload-- or document the code better.  Sorry about that.)

The Foundation framework must be linked into the python executable if any dynamically loaded module is to ever use the Objective-C runtime.   At least, I haven't found a workaround that allows one to link it into the loadable module.

If it isn't, then the load dies with one of two erros depending on platform:

OSX:   dies with a duplicate symbol error on __objcInit.

OSXS:  dies with a "objc: link required classes into application"


History
Date User Action Args
2022-04-10 16:03:29adminsetgithub: 33464
2000-11-11 08:01:32bbumcreate