python-emscripten  Check-in [bb5cfad2ac]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix py3 for Emscripten 1.39.18 Notably fix build dependencies by regenerating Makefile after modifying Setup.local
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: bb5cfad2ac02afc27143cd7f9bc65f2bdd691f5116011fcd23d37561a3812838
User & Date: Beuc 2020-06-27 14:09:56
Context
2020-07-27
16:48
2.7.10: disable C-patched static submodule support check-in: 0a34aed2ad user: Beuc tags: trunk
2020-06-27
14:09
Fix py3 for Emscripten 1.39.18 Notably fix build dependencies by regenerating Makefile after modifying Setup.local check-in: bb5cfad2ac user: Beuc tags: trunk
12:29
Fix py2 for Emscripten 1.39.18 check-in: 59f1b3b50e user: Beuc tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to 2.7.10/python.sh.

92
93
94
95
96
97
98

99
100
101
102
103
104
105
        # note: PGEN=../native/Parser/pgen doesn't work, make overwrites it
        emmake make Parser/pgen
        \cp --preserve=mode ../native/Parser/pgen Parser/

        # Modules/Setup.local
        echo '*static*' > Modules/Setup.local
        cat $SETUPLOCAL >> Modules/Setup.local

        # drop -I/-L/-lz, we USE_ZLIB=1 (keep it in SETUPLOCAL for mock)
        sed -i -e 's/^\(zlib zlibmodule.c\).*/\1/' Modules/Setup.local
    
        (
            export PATH=$BUILD/Python-$VERSION/native:$PATH
            emmake make -j$(nproc)
            # setup.py install_lib doesn't respect DESTDIR







>







92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
        # note: PGEN=../native/Parser/pgen doesn't work, make overwrites it
        emmake make Parser/pgen
        \cp --preserve=mode ../native/Parser/pgen Parser/

        # Modules/Setup.local
        echo '*static*' > Modules/Setup.local
        cat $SETUPLOCAL >> Modules/Setup.local
        emmake make Makefile
        # drop -I/-L/-lz, we USE_ZLIB=1 (keep it in SETUPLOCAL for mock)
        sed -i -e 's/^\(zlib zlibmodule.c\).*/\1/' Modules/Setup.local
    
        (
            export PATH=$BUILD/Python-$VERSION/native:$PATH
            emmake make -j$(nproc)
            # setup.py install_lib doesn't respect DESTDIR

Changes to 3.8/python.sh.

58
59
60
61
62
63
64
65

66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85

86
87
88
89
90
91
92
        # CONFIG_SITE: deals with cross-compilation https://bugs.python.org/msg136962
        # PATH: detect our Python, beware of conflict with emcc's python3
        #       don't use PYTHON_FOR_BUILD which is high-level / lots of options
        # --without-pymalloc: ?
        # --disable-ipv6: ?
        # --disable-shared: compile statically for Emscripten perfs + incomplete PIC support
        if [ ! -e config.status ]; then
            CONFIG_SITE=../config-emscripten.site BASECFLAGS='-s USE_ZLIB=1' READELF=true \

                PATH=$BUILD/Python-$VERSION/native:$PATH \
                emconfigure ../configure \
                --host=asmjs-unknown-emscripten --build=$(../config.guess) \
                --prefix='' \
                --without-pymalloc --disable-ipv6 \
                --disable-shared
        fi
	cat <<EOF >> pyconfig.h
/* issues with posixmodule.c */
#undef HAVE_POSIX_SPAWN
#undef HAVE_POSIX_SPAWNP
/* issues with signalmodule.c */
#undef HAVE_PTHREAD_SIGMASK
EOF

        # Modules/Setup.local
        echo '*static*' > Modules/Setup.local
        cat $SETUPLOCAL >> Modules/Setup.local
        # drop -I/-L/-lz, we USE_ZLIB=1 (keep it in SETUPLOCAL for mock)
        sed -i -e 's/^\(zlib zlibmodule.c\).*/\1/' Modules/Setup.local

        # decrease .pyo size by dropping docstrings
        sed -i -e '/compileall.py/ s/ -O / -OO /' Makefile

        (
            export PATH=$BUILD/Python-$VERSION/native:$PATH
            # Trigger setup.py:CROSS_COMPILING (introduced in 3.8)
            export _PYTHON_HOST_PLATFORM=emscripten







|
>




















>







58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
        # CONFIG_SITE: deals with cross-compilation https://bugs.python.org/msg136962
        # PATH: detect our Python, beware of conflict with emcc's python3
        #       don't use PYTHON_FOR_BUILD which is high-level / lots of options
        # --without-pymalloc: ?
        # --disable-ipv6: ?
        # --disable-shared: compile statically for Emscripten perfs + incomplete PIC support
        if [ ! -e config.status ]; then
            CONFIG_SITE=../config-emscripten.site READELF=true \
		BASECFLAGS='-s USE_ZLIB=1' LDFLAGS='-s USE_ZLIB=1' \
                PATH=$BUILD/Python-$VERSION/native:$PATH \
                emconfigure ../configure \
                --host=asmjs-unknown-emscripten --build=$(../config.guess) \
                --prefix='' \
                --without-pymalloc --disable-ipv6 \
                --disable-shared
        fi
	cat <<EOF >> pyconfig.h
/* issues with posixmodule.c */
#undef HAVE_POSIX_SPAWN
#undef HAVE_POSIX_SPAWNP
/* issues with signalmodule.c */
#undef HAVE_PTHREAD_SIGMASK
EOF

        # Modules/Setup.local
        echo '*static*' > Modules/Setup.local
        cat $SETUPLOCAL >> Modules/Setup.local
        # drop -I/-L/-lz, we USE_ZLIB=1 (keep it in SETUPLOCAL for mock)
        sed -i -e 's/^\(zlib zlibmodule.c\).*/\1/' Modules/Setup.local
        emmake make Makefile
        # decrease .pyo size by dropping docstrings
        sed -i -e '/compileall.py/ s/ -O / -OO /' Makefile

        (
            export PATH=$BUILD/Python-$VERSION/native:$PATH
            # Trigger setup.py:CROSS_COMPILING (introduced in 3.8)
            export _PYTHON_HOST_PLATFORM=emscripten