Navigation Menu

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

Python-2.5.2/Modules/_ctypes/malloc_closure.c:70: error: `MAP_ANONYMOUS' undeclared #47515

Closed
mmokrejs mannequin opened this issue Jul 3, 2008 · 11 comments
Closed

Python-2.5.2/Modules/_ctypes/malloc_closure.c:70: error: `MAP_ANONYMOUS' undeclared #47515

mmokrejs mannequin opened this issue Jul 3, 2008 · 11 comments
Assignees

Comments

@mmokrejs
Copy link
Mannequin

mmokrejs mannequin commented Jul 3, 2008

BPO 3265
Nosy @loewis, @theller, @terryjreedy
Files
  • mmap.2
  • malloc_closure.patch: mmap /dev/zero when MAP_ANONYMOUS not defined.
  • 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 2011-06-01.06:17:23.515>
    created_at = <Date 2008-07-03.00:07:45.512>
    labels = []
    title = "Python-2.5.2/Modules/_ctypes/malloc_closure.c:70: error: `MAP_ANONYMOUS' undeclared"
    updated_at = <Date 2011-06-01.06:17:23.514>
    user = 'https://bugs.python.org/mmokrejs'

    bugs.python.org fields:

    activity = <Date 2011-06-01.06:17:23.514>
    actor = 'terry.reedy'
    assignee = 'theller'
    closed = True
    closed_date = <Date 2011-06-01.06:17:23.515>
    closer = 'terry.reedy'
    components = []
    creation = <Date 2008-07-03.00:07:45.512>
    creator = 'mmokrejs'
    dependencies = []
    files = ['10799', '11162']
    hgrepos = []
    issue_num = 3265
    keywords = ['patch']
    message_count = 11.0
    messages = ['69152', '69165', '69170', '69171', '69174', '69176', '71453', '71454', '83735', '112655', '137418']
    nosy_count = 6.0
    nosy_names = ['loewis', 'theller', 'terry.reedy', 'mmokrejs', 'movement', 'agoode']
    pr_nums = []
    priority = 'normal'
    resolution = 'out of date'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue3265'
    versions = ['Python 2.5']

    @mmokrejs
    Copy link
    Mannequin Author

    mmokrejs mannequin commented Jul 3, 2008

    Hi,
    when building on Solaris 2.6 with gcc I get the following error:

    building '_ctypes' extension
    gcc -shared -fPIC -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
    -Wstrict-prototypes -I. -I/usr/scratch/Python-2.5.2/./Include
    -Ibuild/temp.solaris-2.6-sun4u-2.5/libffi/include
    -Ibuild/temp.solaris-2.6-sun4u-2.5/libffi
    -I/usr/scratch/Python-2.5.2/Modules/_ctypes/libffi/src -I. -IInclude
    -I./Include -I/usr/local/include -I/usr/scratch/Python-2.5.2/Include
    -I/usr/scratch/Python-2.5.2 -c
    /usr/scratch/Python-2.5.2/Modules/_ctypes/_ctypes.c -o
    build/temp.solaris-2.6-sun4u-2.5/usr/scratch/Python-2.5.2/Modules/_ctypes/_ctypes.o
    gcc -shared -fPIC -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
    -Wstrict-prototypes -I. -I/usr/scratch/Python-2.5.2/./Include
    -Ibuild/temp.solaris-2.6-sun4u-2.5/libffi/include
    -Ibuild/temp.solaris-2.6-sun4u-2.5/libffi
    -I/usr/scratch/Python-2.5.2/Modules/_ctypes/libffi/src -I. -IInclude
    -I./Include -I/usr/local/include -I/usr/scratch/Python-2.5.2/Include
    -I/usr/scratch/Python-2.5.2 -c
    /usr/scratch/Python-2.5.2/Modules/_ctypes/callbacks.c -o
    build/temp.solaris-2.6-sun4u-2.5/usr/scratch/Python-2.5.2/Modules/_ctypes/callbacks.o
    gcc -shared -fPIC -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
    -Wstrict-prototypes -I. -I/usr/scratch/Python-2.5.2/./Include
    -Ibuild/temp.solaris-2.6-sun4u-2.5/libffi/include
    -Ibuild/temp.solaris-2.6-sun4u-2.5/libffi
    -I/usr/scratch/Python-2.5.2/Modules/_ctypes/libffi/src -I. -IInclude
    -I./Include -I/usr/local/include -I/usr/scratch/Python-2.5.2/Include
    -I/usr/scratch/Python-2.5.2 -c
    /usr/scratch/Python-2.5.2/Modules/_ctypes/callproc.c -o
    build/temp.solaris-2.6-sun4u-2.5/usr/scratch/Python-2.5.2/Modules/_ctypes/callproc.o
    /usr/scratch/Python-2.5.2/Modules/_ctypes/callproc.c: In function
    _CallProc': /usr/scratch/Python-2.5.2/Modules/_ctypes/callproc.c:921: warning: implicit declaration of function alloca'
    gcc -shared -fPIC -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
    -Wstrict-prototypes -I. -I/usr/scratch/Python-2.5.2/./Include
    -Ibuild/temp.solaris-2.6-sun4u-2.5/libffi/include
    -Ibuild/temp.solaris-2.6-sun4u-2.5/libffi
    -I/usr/scratch/Python-2.5.2/Modules/_ctypes/libffi/src -I. -IInclude
    -I./Include -I/usr/local/include -I/usr/scratch/Python-2.5.2/Include
    -I/usr/scratch/Python-2.5.2 -c
    /usr/scratch/Python-2.5.2/Modules/_ctypes/stgdict.c -o
    build/temp.solaris-2.6-sun4u-2.5/usr/scratch/Python-2.5.2/Modules/_ctypes/stgdict.o
    gcc -shared -fPIC -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
    -Wstrict-prototypes -I. -I/usr/scratch/Python-2.5.2/./Include
    -Ibuild/temp.solaris-2.6-sun4u-2.5/libffi/include
    -Ibuild/temp.solaris-2.6-sun4u-2.5/libffi
    -I/usr/scratch/Python-2.5.2/Modules/_ctypes/libffi/src -I. -IInclude
    -I./Include -I/usr/local/include -I/usr/scratch/Python-2.5.2/Include
    -I/usr/scratch/Python-2.5.2 -c
    /usr/scratch/Python-2.5.2/Modules/_ctypes/cfield.c -o
    build/temp.solaris-2.6-sun4u-2.5/usr/scratch/Python-2.5.2/Modules/_ctypes/cfield.o
    gcc -shared -fPIC -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
    -Wstrict-prototypes -I. -I/usr/scratch/Python-2.5.2/./Include
    -Ibuild/temp.solaris-2.6-sun4u-2.5/libffi/include
    -Ibuild/temp.solaris-2.6-sun4u-2.5/libffi
    -I/usr/scratch/Python-2.5.2/Modules/_ctypes/libffi/src -I. -IInclude
    -I./Include -I/usr/local/include -I/usr/scratch/Python-2.5.2/Include
    -I/usr/scratch/Python-2.5.2 -c
    /usr/scratch/Python-2.5.2/Modules/_ctypes/malloc_closure.c -o
    build/temp.solaris-2.6-sun4u-2.5/usr/scratch/Python-2.5.2/Modules/_ctypes/malloc_closure.o
    /usr/scratch/Python-2.5.2/Modules/_ctypes/malloc_closure.c: In function
    more_core': /usr/scratch/Python-2.5.2/Modules/_ctypes/malloc_closure.c:70: error: MAP_ANONYMOUS' undeclared (first use in this function)
    /usr/scratch/Python-2.5.2/Modules/_ctypes/malloc_closure.c:70: error:
    (Each undeclared identifier is reported only once
    /usr/scratch/Python-2.5.2/Modules/_ctypes/malloc_closure.c:70: error:
    for each function it appears in.)
    building '_ctypes_test' extension
    gcc -shared -fPIC -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
    -Wstrict-prototypes -I. -I/usr/scratch/Python-2.5.2/./Include -I.
    -IInclude -I./Include -I/usr/local/include
    -I/usr/scratch/Python-2.5.2/Include -I/usr/scratch/Python-2.5.2 -c
    /usr/scratch/Python-2.5.2/Modules/_ctypes/_ctypes_test.c -o
    build/temp.solaris-2.6-sun4u-2.5/usr/scratch/Python-2.5.2/Modules/_ctypes/_ctypes_test.o
    gcc -shared -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
    -Wstrict-prototypes
    build/temp.solaris-2.6-sun4u-2.5/usr/scratch/Python-2.5.2/Modules/_ctypes/_ctypes_test.o
    -L/usr/local/lib -o build/lib.solaris-2.6-sun4u-2.5/_ctypes_test.so

    Let me add that I see -fPIC in the top-level Makefile but do not know
    why -static is not in the same variable as well. Anyway, it is not
    a shared library problem I think as I already recompiled my bzip2,
    openssl and ncurses libs with "-shared -fpic". ;-)

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Jul 3, 2008

    Can you please report from the mmap man page how anonymous mappings can
    be achieved on Solaris 2.6?

    @loewis loewis mannequin assigned theller Jul 3, 2008
    @mmokrejs
    Copy link
    Mannequin Author

    mmokrejs mannequin commented Jul 3, 2008

    @mmokrejs
    Copy link
    Mannequin Author

    mmokrejs mannequin commented Jul 3, 2008

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Jul 3, 2008

    I will stop posting URLs. ;-)

    Thanks. None of the URLs seem to be helpful, anyway.
    Please avoid posting URLs without any indication as to what
    specific conclusion you like to see drawn from the page.

    It seems that Solaris 2.6 just doesn't have explicit support
    anonymous mmap explicitly. As a consequence, ctypes, in its
    current form, just can't run on it.

    A solution might be to map /dev/zero instead. Contributions
    are welcome.

    @mmokrejs
    Copy link
    Mannequin Author

    mmokrejs mannequin commented Jul 3, 2008

    Thanks, but I can only help with testing. :(

    @theller
    Copy link

    theller commented Aug 19, 2008

    Here is a patch for Modules/_ctypes/malloc_closure.c that may work
    (totally untested). The code snippet is copied from Modules/mmapmodule.c.

    @theller
    Copy link

    theller commented Aug 19, 2008

    Corrected the patch.

    @agoode
    Copy link
    Mannequin

    agoode mannequin commented Mar 18, 2009

    Issue bpo-5504 shows a possibly more future proof way to fix this issue.

    @terryjreedy
    Copy link
    Member

    Should this be closed as won't fix? outofdate? superseded by 5504?
    Does it even apply to 2.7 or 3.x?

    @terryjreedy
    Copy link
    Member

    2.5 is done with and no response to question about more recent versions.

    @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

    2 participants