[oi-dev] hipster: runtime/python-26 refresh

Alexander Pyhalov alp at rsu.ru
Fri Sep 6 05:37:54 UTC 2013


Marcel Telka писал 06.09.2013 09:19:

> >http://pkg.openindiana.org/hipster/info/0/runtime%2Fpython-26%402.6.8%2C5.11-0.151.1.8.1%3A20130622T145445Z
> 
> This fix is incorrect - it breaks compilation of 32-bit modules,
> 
> 
> Which fix? This one?
> 
> https://github.com/OpenIndiana/oi-userland/commit/915f0cf9f393b4f3c1c968bfb587669d170bb097
> 
> 
> If so, please provide a testcase.

Here's the test case
$ cat test_stat.c
#include <sys/types.h> /* Here I explicitly include this header, because 
in my version of pyconfg.h it is not included */
#include <python2.6/pyconfig.h>
#include <sys/stat.h>
#include <stdio.h>
int main( int argc, char *argv[])
{
struct stat st;
int ret,kind;

if(argc==0)
ret = lstat("nightly.sh", &st);
else
ret = lstat(argv[1],&st);
kind = st.st_mode & S_IFMT;
printf("ret=%d, st.st_mode=%d, kind=%X\n", ret,st.st_mode,kind);
return 0;
}

$ gcc test_stat.c -o test_stat
$ ./test_stat test_stat.c
ret=0, st.st_mode=0, kind=0

$ gcc -D_FILE_OFFSET_BITS=64 test_stat.c -o test_stat
$ ./test_stat test_stat.c
ret=0, st.st_mode=33188, kind=8000

<sys/feature_tests.h> included from <sys/types.h> overwrites 
_FILE_OFFSET_BITS definition from pyconfig.h.

So, I assume the correct fix is to ship the following pyconfig.h:
#if defined ( _LP64 ) || defined (__amd64)
#include <python2.6/pyconfig-64.h>
#else
#include <python2.6/pyconfig-32.h>
#endif

or just

#if defined (__amd64)
#include <python2.6/pyconfig-64.h>
#else
#include <python2.6/pyconfig-32.h>
#endif

---
System Administrator of Southern Federal University Computer Center





More information about the oi-dev mailing list