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

make fails when compiling Python 2.6 from source (posixmodule.c) #82111

Closed
Oguzeren mannequin opened this issue Aug 23, 2019 · 4 comments
Closed

make fails when compiling Python 2.6 from source (posixmodule.c) #82111

Oguzeren mannequin opened this issue Aug 23, 2019 · 4 comments
Labels
build The build process and cross-build topic-installation

Comments

@Oguzeren
Copy link
Mannequin

Oguzeren mannequin commented Aug 23, 2019

BPO 37930
Nosy @ned-deily, @pablogsal
Files
  • config.log: config log
  • 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 = None
    closed_at = <Date 2019-08-23.18:59:13.947>
    created_at = <Date 2019-08-23.13:49:47.329>
    labels = ['build', 'expert-installation']
    title = 'make fails when compiling Python 2.6 from source (posixmodule.c)'
    updated_at = <Date 2019-10-21.19:12:30.446>
    user = 'https://bugs.python.org/Oguzeren'

    bugs.python.org fields:

    activity = <Date 2019-10-21.19:12:30.446>
    actor = 'gilles.bardoux'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-08-23.18:59:13.947>
    closer = 'ned.deily'
    components = ['Installation']
    creation = <Date 2019-08-23.13:49:47.329>
    creator = 'Oguz_eren'
    dependencies = []
    files = ['48558']
    hgrepos = []
    issue_num = 37930
    keywords = []
    message_count = 4.0
    messages = ['350283', '350302', '350325', '355100']
    nosy_count = 4.0
    nosy_names = ['ned.deily', 'pablogsal', 'Oguz_eren', 'gilles.bardoux']
    pr_nums = []
    priority = 'normal'
    resolution = 'out of date'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'compile error'
    url = 'https://bugs.python.org/issue37930'
    versions = []

    @Oguzeren
    Copy link
    Mannequin Author

    Oguzeren mannequin commented Aug 23, 2019

    I'm trying to compile Python 2.6.8 on Kubuntu 19.04.

    Current system version is Python 2.7.16. See below the error message I receive, during make.

    oguz@dikanka:$ tar -xvzf Python-2.6.8.tgz
    oguz@dikanka:
    $ cd Python-2.6.8/

    oguz@dikanka:~/Python-2.6.8$ ./configure

    oguz@dikanka:~/Python-2.6.8$ make



    gcc -pthread -Xlinker -export-dynamic -o python \
    Modules/python.o \
    libpython2.6.a -lpthread -ldl -lutil -lm
    /usr/bin/ld: libpython2.6.a(posixmodule.o): in function posix_tmpnam': /home/oguz/Python-2.6.8/./Modules/posixmodule.c:7261: warning: the use of tmpnam_r' is dangerous, better use mkstemp' /usr/bin/ld: libpython2.6.a(posixmodule.o): in functionposix_tempnam':
    /home/oguz/Python-2.6.8/./Modules/posixmodule.c:7216: warning: the use of tempnam' is dangerous, better use m
    kstemp'
    Segmentation fault (core dumped)
    make: *** [Makefile:414: sharedmods] Error 139

    I found this python bug to be very similar to my case, but it's a rather old bug : https://bugs.python.org/issue535545

    Here it says, posixmodule fails because resource.h is not detected properly by configure. Similarly in my case, pyconfig.h file's HAVE_SYS_RESOURCE_H line is commented out. I also realized that my c lib headers are not under /usr/include/sys and /usr/include/bits. Instead, I can find them under the following locations :

    oguz@dikanka:/usr/include/linux$ find /usr/include -name resource.h
    /usr/include/asm-generic/resource.h
    /usr/include/linux/resource.h
    /usr/include/x86_64-linux-gnu/asm/resource.h
    /usr/include/x86_64-linux-gnu/bits/resource.h
    /usr/include/x86_64-linux-gnu/sys/resource.h

    I tried symlinks to x86_64-linux-gnu/sys and x86_64-linux-gnu/bits, but the the issue persists.

    Any ideas ? Thanks in advance!

    @Oguzeren Oguzeren mannequin added topic-installation build The build process and cross-build labels Aug 23, 2019
    @pablogsal
    Copy link
    Member

    Hi Oguz,

    Sadly Python 2.6.8 is not supported anymore

    @ned-deily
    Copy link
    Member

    Python 2.6 reached end-of-life in 2013, six years ago, and has not received any non-security bug fixes since 2010. We strongly recommend thst you migrate to a modern, supported version of Python, if not Python 3.7, then at least Python 2.7 which itself will reach end-of-life in 2020.

    @gillesbardoux
    Copy link
    Mannequin

    gillesbardoux mannequin commented Oct 21, 2019

    Hi Oguz,
    You just need to change one line in Include/objimpl.h: replace "long double dummy" by "double dummy". Enjoy!

    --- a/Include/objimpl.h
    +++ b/Include/objimpl.h
    @@ -248,7 +248,7 @@ typedef union _gc_head {
             union _gc_head *gc_prev;
             Py_ssize_t gc_refs;
         } gc;
    -    long double dummy;  /* force worst-case alignment */
    +    double dummy;  /* force worst-case alignment */
     } PyGC_Head;
     
     extern PyGC_Head *_PyGC_generation0;

    @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
    build The build process and cross-build topic-installation
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants