Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bac1ea9

Browse files
author
Andrew MacIntyre
committed
More pre-2.3 build tweaks for the OS/2 EMX port:
- more clean up of the generated import library definiton (.DEF file) following checking of patch 770521, and tightening of the sed regexps. - use -O3 even with gcc 2.8.1 - worth nearly 10% with 2.3; worth nothing with 2.2.x. - clean up a couple of whitespace issues introduced by a cut'n'paste.
1 parent d24c767 commit bac1ea9

4 files changed

Lines changed: 24 additions & 43 deletions

File tree

PC/os2emx/Makefile

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ ifeq ($(MODE),debug)
9191
CFLAGS+= -g -O
9292
LDFLAGS+= -g
9393
else
94-
CFLAGS+= -s -O2 -fomit-frame-pointer
94+
CFLAGS+= -s -O3 -fomit-frame-pointer
9595
LDFLAGS+= -s
9696
endif
9797
CFLAGS+= $(PY_DEF)
@@ -515,28 +515,16 @@ $(PYTHON.DEF): $(PYTHON.LIB)
515515
@echo DATA MULTIPLE NONSHARED >>$@
516516
@echo EXPORTS >>$@
517517
$(EXPLIB) -u $(PYTHON.LIB) |\
518-
sed -e "/ .init.*/s/^ /; /" \
519-
-e "/ .pcre_.*/s/^ /; /" \
520-
-e "/ .array_methods/s/^ /; /" \
521-
-e "/ .fast_save_leave/s/^ /; /" \
522-
-e "/ .dlopen/s/^ /; /" \
523-
-e "/ .dlsym/s/^ /; /" \
524-
-e "/ .dlclose/s/^ /; /" \
525-
-e "/ .dlerror/s/^ /; /" \
526-
-e "/ .cycle_type/s/^ /; /" \
527-
-e "/ .dropwhile_type/s/^ /; /" \
528-
-e "/ .takewhile_type/s/^ /; /" \
529-
-e "/ .islice_type/s/^ /; /" \
530-
-e "/ .starmap_type/s/^ /; /" \
531-
-e "/ .imap_type/s/^ /; /" \
532-
-e "/ .chain_type/s/^ /; /" \
533-
-e "/ .ifilter_type/s/^ /; /" \
534-
-e "/ .ifilterfalse_type/s/^ /; /" \
535-
-e "/ .count_type/s/^ /; /" \
536-
-e "/ .izip_type/s/^ /; /" \
537-
-e "/ .repeat_type/s/^ /; /" \
538-
-e "/ ._Py_re_.*/s/^ /; /" \
539-
-e "/ ._Py_MD5.*/s/^ /; /" >>$@
518+
sed -e "/^ .init.*/s/^ /; /" \
519+
-e "/^ .pcre_.*/s/^ /; /" \
520+
-e "/^ .array_methods/s/^ /; /" \
521+
-e "/^ .fast_save_leave/s/^ /; /" \
522+
-e "/^ .dlopen/s/^ /; /" \
523+
-e "/^ .dlsym/s/^ /; /" \
524+
-e "/^ .dlclose/s/^ /; /" \
525+
-e "/^ .dlerror/s/^ /; /" \
526+
-e "/^ ._Py_re_.*/s/^ /; /" \
527+
-e "/^ ._Py_MD5.*/s/^ /; /" >>$@
540528

541529
$(PYTHON.IMPLIB): $(PYTHON.DEF)
542530
$(IMPLIB) -o $@ $^

PC/os2emx/README.os2emx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -554,10 +554,15 @@ error.
554554
I have not attempted to compile Python with any version of gcc prior to
555555
v2.8.1.
556556

557-
While gcc supports more aggressive optimisation than I use, a lot of
558-
benchmarking indicates that Python's performance is at best only
559-
marginally improved by more aggressive optimisation, at least on my
560-
hardware (AMD Athlon 1.4GHz, VIA C3 800MHz).
557+
This release sees the default optimisation change to
558+
"-O3 -fomit-frame-pointer". This works fine too for pgcc 2.95 but not
559+
for gcc 3.2.1.
560+
561+
With gcc 3.2.1, -O3 causes 2 unexpected test failures: test_format and
562+
test_unicode. Both these tests pass if -O2 is instead of -O3 with this
563+
compiler, and the performance difference is negligible (in contrast to
564+
gcc 2.8.1 and pgcc 2.95, where the performance difference between the
565+
2 optimisation settings approaches 10%).
561566

562567
17. os.spawnv() and os.spawnve() expose EMX's library routines rather
563568
than use the emulation in os.py.

PC/os2emx/pyconfig.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@
3131
* imported from the Python core DLL aren't duplicated.
3232
*/
3333
#ifdef Py_BUILD_CORE
34-
# define PyAPI_FUNC(RTYPE) RTYPE
34+
# define PyAPI_FUNC(RTYPE) RTYPE
3535
#else
36-
# define PyAPI_FUNC(RTYPE) extern RTYPE
36+
# define PyAPI_FUNC(RTYPE) extern RTYPE
3737
#endif
38-
#define PyAPI_DATA(RTYPE) extern RTYPE
39-
#define PyMODINIT_FUNC void
38+
#define PyAPI_DATA(RTYPE) extern RTYPE
39+
#define PyMODINIT_FUNC void
4040

4141
/* Use OS/2 flavour of threads */
4242
#define WITH_THREAD 1

PC/os2emx/python23.def

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,18 +1070,6 @@ EXPORTS
10701070

10711071
; From python23_s.lib(itertoolsmodule)
10721072
; "inititertools"
1073-
; "cycle_type"
1074-
; "dropwhile_type"
1075-
; "takewhile_type"
1076-
; "islice_type"
1077-
; "starmap_type"
1078-
; "imap_type"
1079-
; "chain_type"
1080-
; "ifilter_type"
1081-
; "ifilterfalse_type"
1082-
; "count_type"
1083-
; "izip_type"
1084-
; "repeat_type"
10851073

10861074
; From python23_s.lib(_localemodule)
10871075
; "init_locale"

0 commit comments

Comments
 (0)