Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(299)

Side by Side Diff: libraries/python/nacl.patch

Issue 18112024: Fix python to build with newlib. (Closed) Base URL: https://naclports.googlecode.com/svn/trunk/src
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 diff --git a/Makefile.pre.in b/Makefile.pre.in 1 diff --git a/Makefile.pre.in b/Makefile.pre.in
2 index 9d55550..09e7a69 100644 2 index 9d55550..09e7a69 100644
3 --- a/Makefile.pre.in 3 --- a/Makefile.pre.in
4 +++ b/Makefile.pre.in 4 +++ b/Makefile.pre.in
5 @@ -592,14 +592,18 @@ Modules/pwdmodule.o: $(srcdir)/Modules/pwdmodule.c $(srcdi r)/Modules/posixmodule 5 @@ -592,14 +592,18 @@ Modules/pwdmodule.o: $(srcdir)/Modules/pwdmodule.c $(srcdi r)/Modules/posixmodule
6 6
7 $(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS) 7 $(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS)
8 @$(MKDIR_P) Include 8 @$(MKDIR_P) Include
9 +ifndef CROSS_COMPILE 9 +ifndef CROSS_COMPILE
10 $(MAKE) $(PGEN) 10 $(MAKE) $(PGEN)
(...skipping 19 matching lines...) Expand all
30 $(PYTHON_FOR_BUILD) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \ 30 $(PYTHON_FOR_BUILD) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
31 -d $(LIBDEST) -f \ 31 -d $(LIBDEST) -f \
32 @@ -1018,6 +1023,7 @@ libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(src dir)/Modules/xxmodule.c 32 @@ -1018,6 +1023,7 @@ libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(src dir)/Modules/xxmodule.c
33 $(PYTHON_FOR_BUILD) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \ 33 $(PYTHON_FOR_BUILD) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
34 -d $(LIBDEST)/site-packages -f \ 34 -d $(LIBDEST)/site-packages -f \
35 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages 35 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
36 +endif 36 +endif
37 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ 37 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
38 $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST) /lib2to3/Grammar.txt 38 $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST) /lib2to3/Grammar.txt
39 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ 39 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
40 diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
41 index 65ade9f..3aaf148 100644
42 --- a/Modules/posixmodule.c
43 +++ b/Modules/posixmodule.c
44 @@ -216,6 +216,24 @@ extern int lstat(const char *, struct stat *);
45
46 #endif /* !_MSC_VER */
47
48 +#if defined(__native_client__) && !defined(__GLIBC__)
49 +// NaCl's newlib headers don't declare these functions
50 +extern int ftruncate(int fd, off_t length);
51 +extern int lstat(const char *, struct stat *);
Mark Seaborn 2013/07/12 19:47:29 This is fixed in https://src.chromium.org/viewvc/n
Sam Clegg 2013/07/12 21:54:29 Added TODO to remove when this lands.
Mark Seaborn 2013/07/16 15:40:12 The change to fix this should have rolled into Chr
Sam Clegg 2013/07/16 16:19:16 This is still missing in the lastest SDK built aga
52 +
53 +// These functions are missing from NaCl's newlib
54 +// and nosys libraries.
55 +int fsync(int fd) {
Mark Seaborn 2013/07/12 19:47:29 This is fixed in https://src.chromium.org/viewvc/n
Sam Clegg 2013/07/12 21:54:29 Added TODO to remove when this lands.
56 + errno = ENOSYS;
57 + return -1;
58 +}
59 +
60 +int fdatasync(int fd) {
61 + errno = ENOSYS;
62 + return -1;
63 +}
64 +#endif
65 +
66 #ifdef HAVE_UTIME_H
67 #include <utime.h>
68 #endif /* HAVE_UTIME_H */
40 diff --git a/Modules/pwdmodule.c b/Modules/pwdmodule.c 69 diff --git a/Modules/pwdmodule.c b/Modules/pwdmodule.c
41 index c2907f6..9e64898 100644 70 index c2907f6..9e64898 100644
42 --- a/Modules/pwdmodule.c 71 --- a/Modules/pwdmodule.c
43 +++ b/Modules/pwdmodule.c 72 +++ b/Modules/pwdmodule.c
44 @@ -94,6 +94,22 @@ mkpwent(struct passwd *p) 73 @@ -94,6 +94,22 @@ mkpwent(struct passwd *p)
45 return v; 74 return v;
46 } 75 }
47 76
48 +#ifdef __native_client__ 77 +#ifdef __native_client__
49 +struct passwd *getpwuid(uid_t uid) 78 +struct passwd *getpwuid(uid_t uid)
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 @@ -20,5 +24,9 @@ main(int argc, char **argv) 111 @@ -20,5 +24,9 @@ main(int argc, char **argv)
83 m = fpgetmask(); 112 m = fpgetmask();
84 fpsetmask(m & ~FP_X_OFL); 113 fpsetmask(m & ~FP_X_OFL);
85 #endif 114 #endif
86 +#ifdef __native_client__ 115 +#ifdef __native_client__
87 + setvbuf(stdout, NULL, _IOLBF, 0); 116 + setvbuf(stdout, NULL, _IOLBF, 0);
88 + setvbuf(stdin, NULL, _IOLBF, 0); 117 + setvbuf(stdin, NULL, _IOLBF, 0);
89 +#endif 118 +#endif
90 return Py_Main(argc, argv); 119 return Py_Main(argc, argv);
91 } 120 }
121 diff --git a/Python/thread.c b/Python/thread.c
122 index dd333e8..ac05657 100644
123 --- a/Python/thread.c
124 +++ b/Python/thread.c
125 @@ -17,6 +17,10 @@
126 # endif
127 #endif
128
129 +#if defined __native_client__ && !defined __GLIBC__
Mark Seaborn 2013/07/12 19:47:29 Can you link to https://code.google.com/p/nativecl
Sam Clegg 2013/07/12 21:54:29 Done.
130 +#define _POSIX_THREADS
131 +#endif
132 +
133 #ifndef DONT_HAVE_STDIO_H
134 #include <stdio.h>
135 #endif
92 diff --git a/configure b/configure 136 diff --git a/configure b/configure
93 index dc0dfd0..d45f7b0 100755 137 index dc0dfd0..d45f7b0 100755
94 --- a/configure 138 --- a/configure
95 +++ b/configure 139 +++ b/configure
96 @@ -2853,19 +2853,26 @@ if test "$cross_compiling" = yes; then 140 @@ -2853,19 +2853,26 @@ if test "$cross_compiling" = yes; then
97 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python interpreter fo r cross build" >&5 141 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python interpreter fo r cross build" >&5
98 $as_echo_n "checking for python interpreter for cross build... " >&6; } 142 $as_echo_n "checking for python interpreter for cross build... " >&6; }
99 if test -z "$PYTHON_FOR_BUILD"; then 143 if test -z "$PYTHON_FOR_BUILD"; then
100 - for interp in python$PACKAGE_VERSION python2 python; do 144 - for interp in python$PACKAGE_VERSION python2 python; do
101 - which $interp >/dev/null 2>&1 || continue 145 - which $interp >/dev/null 2>&1 || continue
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 OpenUNIX*|UnixWare*) 309 OpenUNIX*|UnixWare*)
266 @@ -2128,7 +2147,7 @@ then 310 @@ -2128,7 +2147,7 @@ then
267 LINKFORSHARED="-Wl,-E -Wl,+s";; 311 LINKFORSHARED="-Wl,-E -Wl,+s";;
268 # LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";; 312 # LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
269 BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";; 313 BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";;
270 - Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";; 314 - Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";;
271 + Linux*|GNU*|NaCl*) LINKFORSHARED="-Xlinker -export-dynamic";; 315 + Linux*|GNU*|NaCl*) LINKFORSHARED="-Xlinker -export-dynamic";;
272 # -u libsys_s pulls in all symbols in libsys 316 # -u libsys_s pulls in all symbols in libsys
273 Darwin/*) 317 Darwin/*)
274 # -u _PyMac_Error is needed to pull in the mac toolbox glue, 318 # -u _PyMac_Error is needed to pull in the mac toolbox glue,
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698