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: Mac Framework build fails on intel
Type: Stage:
Components: Build Versions: Python 2.4
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, mammon_
Priority: normal Keywords:

Created on 2006-03-10 22:02 by mammon_, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg27733 - (view) Author: Michael Mondragon (mammon_) Date: 2006-03-10 22:02
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
msg27734 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-04-02 19:41
Logged In: YES 
user_id=849994

Duplicate of #1451717.
History
Date User Action Args
2022-04-11 14:56:15adminsetgithub: 43012
2006-03-10 22:02:24mammon_create