Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ctypes extension does not compile on Mac OS 10.3.9 #43109

Closed
dalke mannequin opened this issue Mar 29, 2006 · 5 comments
Closed

ctypes extension does not compile on Mac OS 10.3.9 #43109

dalke mannequin opened this issue Mar 29, 2006 · 5 comments
Assignees

Comments

@dalke
Copy link
Mannequin

dalke mannequin commented Mar 29, 2006

BPO 1460514
Nosy @theller

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/theller'
closed_at = <Date 2006-05-09.18:36:47.000>
created_at = <Date 2006-03-29.08:28:53.000>
labels = []
title = 'ctypes extension does not compile on Mac OS 10.3.9'
updated_at = <Date 2006-05-09.18:36:47.000>
user = 'https://bugs.python.org/dalke'

bugs.python.org fields:

activity = <Date 2006-05-09.18:36:47.000>
actor = 'theller'
assignee = 'theller'
closed = True
closed_date = None
closer = None
components = ['None']
creation = <Date 2006-03-29.08:28:53.000>
creator = 'dalke'
dependencies = []
files = []
hgrepos = []
issue_num = 1460514
keywords = []
message_count = 5.0
messages = ['27945', '27946', '27947', '27948', '27949']
nosy_count = 2.0
nosy_names = ['theller', 'dalke']
pr_nums = []
priority = 'high'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue1460514'
versions = ['Python 2.5']

@dalke
Copy link
Mannequin Author

dalke mannequin commented Mar 29, 2006

I compiled Python from CVS this morning. It silently failed to compile
ctypes. Here is the text surrounding the failure

gcc [deleted] -c /Users/dalke/cvses/python-svn/Modules/_ctypes/
libffi/src/powerpc/darwin_closure.S -o build/temp.darwin-7.9.0-
Power_Macintosh-2.5/darwin_closure.o
darwin_closure.S:249:unknown section attribute: live_support
darwin_closure.S:249:Rest of line ignored. 1st junk character valued 69
(E).
building 'itertools' extension
...

Python installed but when I tried to import ctypes I got

File "/usr/local/lib/python2.5/ctypes/init.py", line 8, in
<module>
from _ctypes import Union, Structure, Array
ImportError: No module named _ctypes

I tracked it down to the '+live_support' attribute from the
darwin_closure.S. My compiler does not understand that.

Thomas Heller (in private email) pointed out the text from the ctypes
README

    On OS X, the segment attribute live_support must be
defined. If your compiler doesn't know about it, upgrade or
set the environment variable CCASFLAGS="-Dno_live_support".

Upgrading is out of the option. I set the environment variable but that
did not fix things when I tried to recompile Python. However, editing
the file to remove the "+live_support" works. All the self-tests passed,
and my experimentation this afternoon was successful.

@dalke dalke mannequin closed this as completed Mar 29, 2006
@dalke dalke mannequin assigned theller Mar 29, 2006
@dalke dalke mannequin closed this as completed Mar 29, 2006
@dalke dalke mannequin assigned theller Mar 29, 2006
@theller
Copy link

theller commented Apr 3, 2006

Logged In: YES
user_id=11105

As a temporary fix, I removed the '+live_support' attribute
in the source file. Andrew, can you please verify that this
works for you?

Thanks, Thomas

@dalke
Copy link
Mannequin Author

dalke mannequin commented Apr 14, 2006

Logged In: YES
user_id=190903

Sorry - was ill and not doing anything for a week.

I've built the latest code from SVN. No problems with the compilation and I
am able to import just fine.

I did get the following compiler warnings

/Users/dalke/cvses/python-svn/Modules/_ctypes/cfield.c: In function
`CField_repr':
/Users/dalke/cvses/python-svn/Modules/_ctypes/cfield.c:259: warning:
signed size_t format, Py_ssize_t arg (arg 3)
/Users/dalke/cvses/python-svn/Modules/_ctypes/cfield.c:267: warning:
signed size_t format, Py_ssize_t arg (arg 3)

/Users/dalke/cvses/python-svn/Modules/_ctypes/libffi/src/powerpc/
ffi_darwin.c:383: warning: function declaration isn't a prototype
/Users/dalke/cvses/python-svn/Modules/_ctypes/libffi/src/powerpc/
ffi_darwin.c:384: warning: function declaration isn't a prototype
/Users/dalke/cvses/python-svn/Modules/_ctypes/libffi/src/powerpc/
ffi_darwin.c:388: warning: function declaration isn't a prototype
/Users/dalke/cvses/python-svn/Modules/_ctypes/libffi/src/powerpc/
ffi_darwin.c:389: warning: function declaration isn't a prototype
/Users/dalke/cvses/python-svn/Modules/_ctypes/libffi/src/powerpc/
ffi_darwin.c:394: warning: function declaration isn't a prototype
/Users/dalke/cvses/python-svn/Modules/_ctypes/libffi/src/powerpc/
ffi_darwin.c: In function ffi_closure_helper_DARWIN': /Users/dalke/cvses/python-svn/Modules/_ctypes/libffi/src/powerpc/ ffi_darwin.c:622: warning: unused variable temp_ld'

When I run the self test I get one error

FAILED (errors=1)
Traceback (most recent call last):
  File "Lib/test/test_ctypes.py", line 12, in <module>
    test_main()
  File "Lib/test/test_ctypes.py", line 9, in test_main
    run_suite(unittest.TestSuite(suites))
  File "/Users/dalke/cvses/python-svn/Lib/test/test_support.py", line 285, in 
run_suite
    raise TestFailed(err)
test.test_support.TestFailed: Traceback (most recent call last):
  File "/Users/dalke/cvses/python-svn/Lib/ctypes/test/test_loading.py", line 
30, in test_load
    cdll.load(libc_name)
  File "/Users/dalke/cvses/python-svn/Lib/ctypes/_loader.py", line 112, in 
load
    return self._load(libname, mode)
  File "/Users/dalke/cvses/python-svn/Lib/ctypes/_loader.py", line 153, in 
_load
    return self.load_library(pathname, mode)
  File "/Users/dalke/cvses/python-svn/Lib/ctypes/_loader.py", line 124, in 
load_library
    return self._dlltype(libname, mode)
  File "/Users/dalke/cvses/python-svn/Lib/ctypes/__init__.py", line 288, in 
__init__
    self._handle = _dlopen(self._name, mode)
OSError: dlcompat: unable to open this file with RTLD_LOCAL

which is probably ignorable - OS X has its own sense of what shared libraries
do.

@theller
Copy link

theller commented Apr 15, 2006

Logged In: YES
user_id=11105

Thanks for the feedback.

For the warnings in Modules/_ctypes/cfield.c, I have no idea
what is wrong there.

For the warnings in the libffi-sources I tend to ignore them
because I don't want to change them too much.

For the test-failure: can you find out why this fails?

(In the meantime I'm trying to get hold of 10.3 installation
disks - any tips how to shrink the only existing partition
on my mac mini running 10.4 and setting up a multi-boot
system would be appreciated, if anyone wants to help. As an
alternative ssh-access to an existing osx installation for
testing would of course also help. I don't know if this is
feasible or not ;-)

@theller
Copy link

theller commented May 9, 2006

Logged In: YES
user_id=11105

I forgot to close this item.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant