[ python-Bugs-1447587 ] Mac Framework build fails on intel

SourceForge.net noreply at sourceforge.net
Sun Apr 2 21:41:21 CEST 2006


Bugs item #1447587, was opened at 2006-03-10 22:02
Message generated for change (Settings changed) made by gbrandl
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1447587&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Build
Group: Python 2.4
>Status: Closed
>Resolution: Duplicate
Priority: 5
Submitted By: Michael Mondragon (mammon_)
Assigned to: Nobody/Anonymous (nobody)
Summary: Mac Framework build fails on intel

Initial Comment:
hardware: intel duo imac 20"
os x: 10.4.6

steps:
------
./configure
--enable-framework=/Library/Frameworks/Python.framework
--enable-shared
make
...
 c++  -u _PyMac_Error
Python.framework/Versions/2.4/Python -o python.exe \
                Modules/python.o \
                 -ldl      
/usr/bin/ld: warning
Python.framework/Versions/2.4/Python cputype (18,
architecture ppc) does not match cputype (7) for
specified -arch flag: i386 (file not loaded)
/usr/bin/ld: Undefined symbols:
_PyMac_Error
_Py_Main
collect2: ld returned 1 exit status
make: *** [python.exe] Error 1


analysis:
---------

The arch flag for the Python shared library in
the framework is incorrect.

file shows Python.framework/Versions/2.4/Python
to be a PPC binary.


scroll up in terminal to find link statement for
Python:

libtool -o Python.framework/Versions/2.4/Python
-dynamic  libpython2.4.a \
         -lSystem -lSystemStubs -arch_only ppc
-install_name
/Library/Frameworks/Python.framework/Python.framework/Versions/2.4/Python
-compatibility_version 2.4 -current_version 2.4

The '-arch_only ppc' flag is the problem.


workaround:
-----------

After running configure, open makefile and so
a s/arch_only ppc/arch_only i386/g


what needs to be fixed:
-----------------------

Around line 10218 in configure:
  Darwin/[01234567].*)    LIBTOOL_CRUFT="-framework
System -lcc_dynamic -arch_only ppc"   
LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name
$(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
    LIBTOOL_CRUFT=$LIBTOOL_CRUFT'
-compatibility_version $(VERSION) -current_version
$(VERSION)';;
  Darwin/*)
    gcc_version=`gcc -v 2>&1 |  grep version | cut -d\
 -f3`
    if test ${gcc_version} '<' 4.0
        then
            LIBTOOL_CRUFT="-lcc_dynamic"
        else
            LIBTOOL_CRUFT=""
    fi


----------------------------------------------------------------------

>Comment By: Georg Brandl (gbrandl)
Date: 2006-04-02 19:41

Message:
Logged In: YES 
user_id=849994

Duplicate of #1451717.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1447587&group_id=5470


More information about the Python-bugs-list mailing list