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: Python-2.5.2/Modules/_ctypes/malloc_closure.c:70: error: `MAP_ANONYMOUS' undeclared
Type: Stage:
Components: Versions: Python 2.5
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: theller Nosy List: agoode, loewis, mmokrejs, movement, terry.reedy, theller
Priority: normal Keywords: patch

Created on 2008-07-03 00:07 by mmokrejs, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
mmap.2 mmokrejs, 2008-07-03 06:36
malloc_closure.patch theller, 2008-08-19 17:49 mmap /dev/zero when MAP_ANONYMOUS not defined.
Messages (11)
msg69152 - (view) Author: Martin Mokrejs (mmokrejs) Date: 2008-07-03 00:07
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". ;-)
msg69165 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2008-07-03 06:22
Can you please report from the mmap man page how anonymous mappings can
be achieved on Solaris 2.6?
msg69170 - (view) Author: Martin Mokrejs (mmokrejs) Date: 2008-07-03 06:36
A Goggle search gives between many others:
http://gcc.gnu.org/ml/gcc/2000-09/msg00054.html
http://www.ravenbrook.com/project/mps/master/design/vmso/
http://developers.sun.com/solaris/articles/read_mmap.html
msg69171 - (view) Author: Martin Mokrejs (mmokrejs) Date: 2008-07-03 06:44
http://unix.derkeiler.com/Newsgroups/comp.unix.solaris/2004-07/0256.html
http://source.winehq.org/source/libs/wine/mmap.c

I will stop posting URLs. ;-)
msg69174 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2008-07-03 06:55
> 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.
msg69176 - (view) Author: Martin Mokrejs (mmokrejs) Date: 2008-07-03 06:57
Thanks, but I can only help with testing. :(
msg71453 - (view) Author: Thomas Heller (theller) * (Python committer) Date: 2008-08-19 17:46
Here is a patch for Modules/_ctypes/malloc_closure.c that may work
(totally untested).  The code snippet is copied from Modules/mmapmodule.c.
msg71454 - (view) Author: Thomas Heller (theller) * (Python committer) Date: 2008-08-19 17:49
Corrected the patch.
msg83735 - (view) Author: Adam Goode (agoode) Date: 2009-03-18 03:57
Issue #5504 shows a possibly more future proof way to fix this issue.
msg112655 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2010-08-03 19:31
Should this be closed as won't fix? outofdate? superseded by 5504?
Does it even apply to 2.7 or 3.x?
msg137418 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2011-06-01 06:17
2.5 is done with and no response to question about more recent versions.
History
Date User Action Args
2022-04-11 14:56:36adminsetgithub: 47515
2011-06-01 06:17:23terry.reedysetstatus: open -> closed
resolution: out of date
messages: + msg137418
2010-08-03 19:31:18terry.reedysetnosy: + terry.reedy
messages: + msg112655
2009-03-18 03:57:29agoodesetnosy: + agoode
messages: + msg83735
2009-02-16 01:01:04movementsetnosy: + movement
2008-08-19 17:49:08thellersetfiles: + malloc_closure.patch
messages: + msg71454
2008-08-19 17:48:25thellersetfiles: - malloc_closure.patch
2008-08-19 17:46:32thellersetfiles: + malloc_closure.patch
keywords: + patch
messages: + msg71453
2008-07-03 06:57:49mmokrejssetmessages: + msg69176
2008-07-03 06:55:47loewissetmessages: + msg69174
2008-07-03 06:44:32mmokrejssetmessages: + msg69171
2008-07-03 06:36:19mmokrejssetfiles: + mmap.2
messages: + msg69170
2008-07-03 06:22:16loewissetassignee: theller
messages: + msg69165
nosy: + loewis, theller
2008-07-03 00:07:45mmokrejscreate