summaryrefslogtreecommitdiff
path: root/external/python3
diff options
context:
space:
mode:
authorChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2014-05-19 19:48:35 +0200
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2014-05-19 19:58:54 +0200
commite175eb3cedded28909247f4d46f2c17ff2f58be2 (patch)
tree841294bd60db85930acbc1d40c81a009ab8f5dcd /external/python3
parent36f58d4dd1ee5ebe220a5e1e7d1b28aeb15b8977 (diff)
fdo#77891 fix python crash when in GUI mode, target WinXP with VS2012
VS2012 did change return value of fileno function, this results in a crash when run in GUI mode (but not when launching from a shell), as python tries to access the nonexisting stdin/stdout/stderr Also explicitly target Windows XP Change-Id: Ic783713b55453f3c38b2e766a664b7f4678711de
Diffstat (limited to 'external/python3')
-rw-r--r--external/python3/ExternalProject_python3.mk2
-rw-r--r--external/python3/UnpackedTarball_python3.mk2
-rw-r--r--external/python3/python-3.3.3-msvc2012-winxp.patch.1117
-rw-r--r--external/python3/python-3.3.3-py17797.patch.144
4 files changed, 164 insertions, 1 deletions
diff --git a/external/python3/ExternalProject_python3.mk b/external/python3/ExternalProject_python3.mk
index 1e6f4c8fd6ce..1f7be7ffda57 100644
--- a/external/python3/ExternalProject_python3.mk
+++ b/external/python3/ExternalProject_python3.mk
@@ -37,7 +37,7 @@ $(call gb_ExternalProject_get_state_target,python3,build) :
/p:Platform=$(if $(filter INTEL,$(CPUNAME)),Win32,x64) \
$(if $(filter 100,$(VCVER)), \
/ToolsVersion:4.0, \
- /p:PlatformToolset=v110 /p:VisualStudioVersion=11.0) \
+ /p:PlatformToolset=v110_xp /p:VisualStudioVersion=11.0) \
&& cd $(EXTERNAL_WORKDIR) \
&& ln -s PCbuild LO_lib \
,PCBuild)
diff --git a/external/python3/UnpackedTarball_python3.mk b/external/python3/UnpackedTarball_python3.mk
index 15ca76af9c20..d08ba1f79cf1 100644
--- a/external/python3/UnpackedTarball_python3.mk
+++ b/external/python3/UnpackedTarball_python3.mk
@@ -29,6 +29,8 @@ $(eval $(call gb_UnpackedTarball_add_patches,python3,\
external/python3/python-3.3.0-pythreadstate.patch.1 \
external/python3/python-3.3.0-clang.patch.1 \
external/python3/python-3.3.3-quoted-printable.patch.1 \
+ external/python3/python-3.3.3-py17797.patch.1 \
+ external/python3/python-3.3.3-msvc2012-winxp.patch.1 \
))
ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD SOLARIS,$(OS)),)
diff --git a/external/python3/python-3.3.3-msvc2012-winxp.patch.1 b/external/python3/python-3.3.3-msvc2012-winxp.patch.1
new file mode 100644
index 000000000000..2addd4962c07
--- /dev/null
+++ b/external/python3/python-3.3.3-msvc2012-winxp.patch.1
@@ -0,0 +1,117 @@
+without explicit subsystem set, the linker tries to open a file
+with the name of the comptibility version
+(fatal error LNK1181: cannot open input file ",5.01")
+diff -ur python3.org/PCbuild/_ctypes.vcxproj python3/PCbuild/_ctypes.vcxproj
+--- python3.org/PCbuild/_ctypes.vcxproj 2014-05-19 19:06:01.274114800 +0200
++++ python3/PCbuild/_ctypes.vcxproj 2014-05-19 19:07:13.649079800 +0200
+@@ -174,7 +174,7 @@
+ </ClCompile>
+ <Link>
+ <AdditionalOptions>/EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE %(AdditionalOptions)</AdditionalOptions>
+- <SubSystem>NotSet</SubSystem>
++ <SubSystem>Console</SubSystem>
+ <BaseAddress>0x1D1A0000</BaseAddress>
+ </Link>
+ </ItemDefinitionGroup>
+@@ -187,7 +187,7 @@
+ </ClCompile>
+ <Link>
+ <AdditionalOptions>/EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE %(AdditionalOptions)</AdditionalOptions>
+- <SubSystem>NotSet</SubSystem>
++ <SubSystem>Console</SubSystem>
+ <BaseAddress>0x1D1A0000</BaseAddress>
+ </Link>
+ </ItemDefinitionGroup>
+@@ -197,7 +197,7 @@
+ </ClCompile>
+ <Link>
+ <AdditionalOptions>/EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE %(AdditionalOptions)</AdditionalOptions>
+- <SubSystem>NotSet</SubSystem>
++ <SubSystem>Console</SubSystem>
+ <BaseAddress>0x1D1A0000</BaseAddress>
+ </Link>
+ </ItemDefinitionGroup>
+@@ -210,7 +210,7 @@
+ </ClCompile>
+ <Link>
+ <AdditionalOptions>/EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE %(AdditionalOptions)</AdditionalOptions>
+- <SubSystem>NotSet</SubSystem>
++ <SubSystem>Console</SubSystem>
+ <BaseAddress>0x1D1A0000</BaseAddress>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+@@ -221,7 +221,7 @@
+ </ClCompile>
+ <Link>
+ <AdditionalOptions>/EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE %(AdditionalOptions)</AdditionalOptions>
+- <SubSystem>NotSet</SubSystem>
++ <SubSystem>Console</SubSystem>
+ <BaseAddress>0x1D1A0000</BaseAddress>
+ </Link>
+ </ItemDefinitionGroup>
+@@ -234,7 +234,7 @@
+ </ClCompile>
+ <Link>
+ <AdditionalOptions>/EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE %(AdditionalOptions)</AdditionalOptions>
+- <SubSystem>NotSet</SubSystem>
++ <SubSystem>Console</SubSystem>
+ <BaseAddress>0x1D1A0000</BaseAddress>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+diff -ur python3.org/PCbuild/_decimal.vcxproj python3/PCbuild/_decimal.vcxproj
+--- python3.org/PCbuild/_decimal.vcxproj 2014-05-19 19:06:01.274114800 +0200
++++ python3/PCbuild/_decimal.vcxproj 2014-05-19 19:07:13.649079800 +0200
+@@ -176,7 +176,7 @@
+ <AdditionalIncludeDirectories>..\Modules\_decimal;..\Modules\_decimal\libmpdec;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+- <SubSystem>NotSet</SubSystem>
++ <SubSystem>Console</SubSystem>
+ <BaseAddress>0x1D1A0000</BaseAddress>
+ </Link>
+ </ItemDefinitionGroup>
+@@ -189,7 +189,7 @@
+ <AdditionalIncludeDirectories>..\Modules\_decimal;..\Modules\_decimal\libmpdec;..\Include;..\PC;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+- <SubSystem>NotSet</SubSystem>
++ <SubSystem>Console</SubSystem>
+ <BaseAddress>0x1D1A0000</BaseAddress>
+ </Link>
+ </ItemDefinitionGroup>
+@@ -199,7 +199,7 @@
+ <AdditionalIncludeDirectories>..\Modules\_decimal;..\Modules\_decimal\libmpdec;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+- <SubSystem>NotSet</SubSystem>
++ <SubSystem>Console</SubSystem>
+ <BaseAddress>0x1D1A0000</BaseAddress>
+ </Link>
+ </ItemDefinitionGroup>
+@@ -212,7 +212,7 @@
+ <AdditionalIncludeDirectories>..\Modules\_decimal;..\Modules\_decimal\libmpdec;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+- <SubSystem>NotSet</SubSystem>
++ <SubSystem>Console</SubSystem>
+ <BaseAddress>0x1D1A0000</BaseAddress>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+@@ -223,7 +223,7 @@
+ <AdditionalIncludeDirectories>..\Modules\_decimal;..\Modules\_decimal\libmpdec;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+- <SubSystem>NotSet</SubSystem>
++ <SubSystem>Console</SubSystem>
+ <BaseAddress>0x1D1A0000</BaseAddress>
+ </Link>
+ </ItemDefinitionGroup>
+@@ -236,7 +236,7 @@
+ <AdditionalIncludeDirectories>..\Modules\_decimal;..\Modules\_decimal\libmpdec;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+- <SubSystem>NotSet</SubSystem>
++ <SubSystem>Console</SubSystem>
+ <BaseAddress>0x1D1A0000</BaseAddress>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
diff --git a/external/python3/python-3.3.3-py17797.patch.1 b/external/python3/python-3.3.3-py17797.patch.1
new file mode 100644
index 000000000000..3c43fb120713
--- /dev/null
+++ b/external/python3/python-3.3.3-py17797.patch.1
@@ -0,0 +1,44 @@
+http://bugs.python.org/issue17797
+http://connect.microsoft.com/VisualStudio/feedback/details/785119/
+
+Visual Studio 2012 changed return value for fileno function that breaks
+when python tries to check/setup stdin/out/err
+diff -ur python3.org/Python/pythonrun.c python3/Python/pythonrun.c
+--- python3.org/Python/pythonrun.c 2014-05-19 19:06:01.305362400 +0200
++++ python3/Python/pythonrun.c 2014-05-19 19:07:13.649079800 +0200
+@@ -1083,7 +1083,11 @@
+ * and fileno() may point to an invalid file descriptor. For example
+ * GUI apps don't have valid standard streams by default.
+ */
++#ifdef MS_WINDOWS
++ if (!is_valid_fd(fd) || GetStdHandle(STD_INPUT_HANDLE) == NULL) {
++#else
+ if (!is_valid_fd(fd)) {
++#endif
+ std = Py_None;
+ Py_INCREF(std);
+ }
+@@ -1098,7 +1102,11 @@
+
+ /* Set sys.stdout */
+ fd = fileno(stdout);
++#ifdef MS_WINDOWS
++ if (!is_valid_fd(fd) || GetStdHandle(STD_OUTPUT_HANDLE) == NULL) {
++#else
+ if (!is_valid_fd(fd)) {
++#endif
+ std = Py_None;
+ Py_INCREF(std);
+ }
+@@ -1114,7 +1122,11 @@
+ #if 1 /* Disable this if you have trouble debugging bootstrap stuff */
+ /* Set sys.stderr, replaces the preliminary stderr */
+ fd = fileno(stderr);
++#ifdef MS_WINDOWS
++ if (!is_valid_fd(fd) || GetStdHandle(STD_ERROR_HANDLE) == NULL) {
++#else
+ if (!is_valid_fd(fd)) {
++#endif
+ std = Py_None;
+ Py_INCREF(std);
+ }