Skip to content

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

Closed

Description

@mmokrejs
mannequin
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']

    Activity

    1. mmokrejs commented on Jul 3, 2008

      mmokrejsmannequin
      MannequinAuthor

      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". ;-)

    2. loewis commented on Jul 3, 2008

      loewismannequin
      Mannequin

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

    3. mmokrejs commented on Jul 3, 2008

      mmokrejsmannequin
      MannequinAuthor
    4. mmokrejs commented on Jul 3, 2008

      mmokrejsmannequin
      MannequinAuthor
    5. loewis commented on Jul 3, 2008

      loewismannequin
      Mannequin

      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.

    6. mmokrejs commented on Jul 3, 2008

      mmokrejsmannequin
      MannequinAuthor

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

    7. theller commented on Aug 19, 2008

      @theller

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

    8. theller commented on Aug 19, 2008

      @theller

      Corrected the patch.

    9. agoode commented on Mar 18, 2009

      agoodemannequin
      Mannequin

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

    10. terryjreedy commented on Aug 3, 2010

      @terryjreedy
      Member

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

    11. terryjreedy commented on Jun 1, 2011

      @terryjreedy
      Member

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

    12. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions