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

Marcg/openssl essential #9

Open
wants to merge 5 commits into
base: 2.7
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Lib/idlelib/PyShell.py
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,9 @@ def begin(self):
return False
else:
nosub = "==== No Subprocess ===="
self.write("Python %s on %s\n%s\n%s" %
self.write(
("ActivePython PT_CONFIG_fullver (ActiveState Software Inc.) " + \
"based on\nPython %s on %s\n%s\n%s") %
(sys.version, sys.platform, self.COPYRIGHT, nosub))
self.text.focus_force()
self.showprompt()
Expand Down
10 changes: 10 additions & 0 deletions Modules/_multiprocessing/multiprocessing.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@
#define HAVE_FD_TRANSFER 0
#endif

#ifndef _CMSG_ALIGN
#define _CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) & ~(sizeof (size_t) - 1))
#endif
#ifndef CMSG_SPACE
#define CMSG_SPACE(len) (_CMSG_ALIGN(sizeof(struct cmsghdr)) + _CMSG_ALIGN(len))
#endif
#ifndef CMSG_LEN
#define CMSG_LEN(len) (_CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))
#endif

PyObject *create_win32_namespace(void);

PyObject *pickle_dumps, *pickle_loads, *pickle_protocol;
Expand Down
37 changes: 24 additions & 13 deletions Modules/ld_so_aix.in
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,6 @@ if test ! -n "$*"; then
echo $usage; exit 2
fi

# Default import file for Python
# Can be overridden by providing a -bI: argument.
impfile="./python.exp"

# Parse arguments
while test -n "$1"
do
Expand All @@ -114,7 +110,15 @@ do
objfile=`echo $1 | sed "s/-o//"`
;;
-bI:* | -Wl,-bI:*)
impfile=`echo $1 | sed -e "s/-Wl,//" -e "s/-bI://"`
if test -z "$impfile"; then
# The first -bI:* is specially processed.
impfile=`echo $1 | sed -e "s/-Wl,//" -e "s/-bI://"`
else
#args="$args -Wl,$1"
x=`echo $1 | sed -e "s/-Wl,//" -e "s/-bI://"`
x=`dirname $x`/`basename $x .exp`.so
args="$args $x"
fi
;;
-bE:* | -Wl,-bE:*)
expfile=`echo $1 | sed -e "s/-Wl,//" -e "s/-bE://"`
Expand All @@ -136,6 +140,11 @@ if test "$objfile" = "libpython@VERSION@.so"; then
ldsocoremode="true"
fi

# Default import file for Python
# Can be overriden by providing a -bI: argument.
if test -z "$impfile"; then
impfile="./python.exp"
fi
if test -z "$objs"; then
echo "ld_so_aix: No input files; exiting."
exit 2
Expand All @@ -162,13 +171,13 @@ if test -z "$entry"; then
entry=init`echo $filename | sed "s/module.*//"`
fi

#echo "ld_so_aix: Debug info section"
#echo " -> output file : $objfile"
#echo " -> import file : $impfile"
#echo " -> export file : $expfile"
#echo " -> entry point : $entry"
#echo " -> object files: $objs"
#echo " -> CC arguments: $args"
echo "ld_so_aix: Debug info section"
echo " -> output file : $objfile"
echo " -> import file : $impfile"
echo " -> export file : $expfile"
echo " -> entry point : $entry"
echo " -> object files: $objs"
echo " -> CC arguments: $args"

if test -z "$ldsocoremode"; then
CCOPT="-Wl,-e$entry -Wl,-bE:$expfile -Wl,-bI:$impfile -Wl,-bhalt:4"
Expand All @@ -184,7 +193,9 @@ CCARGS="$args"
$makexp $expfile "$objfile" $objs

# Perform the link.
#echo $CC $CCOPT $CCARGS
echo %%%%%%%%%%%%%%%%%%%%%%
echo $CC -L/usr/lib $CCOPT $CCARGS
echo %%%%%%%%%%%%%%%%%%%%%%
$CC $CCOPT $CCARGS
retval=$?

Expand Down
6 changes: 6 additions & 0 deletions Modules/posixmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -6901,7 +6901,13 @@ posix_fdopen(PyObject *self, PyObject *args)
return NULL;

/* Sanitize mode. See fileobject.c */
#ifdef _AIX
/* Patch to fix MemoryError when trying to open files in AIX 64-bit
See http://bugs.python.org/issue6600 */
mode = PyMem_MALLOC(3+strlen(orgmode));
#else
mode = PyMem_MALLOC(strlen(orgmode)+3);
#endif
if (!mode) {
PyErr_NoMemory();
return NULL;
Expand Down
12 changes: 12 additions & 0 deletions Modules/signalmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,18 @@ static long main_thread;
static pid_t main_pid;
#endif

/* Code copied from _hotshot.c. Aix's cc dislikes inline in the function definitions. */
#if !defined(__cplusplus) && !defined(inline)
#ifdef __GNUC__
#define inline __inline
#endif
#endif

#ifndef inline
#define inline
#endif


static struct {
int tripped;
PyObject *func;
Expand Down
6 changes: 6 additions & 0 deletions Objects/fileobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,13 @@ open_the_file(PyFileObject *f, char *name, char *mode)
assert(f->f_fp == NULL);

/* probably need to replace 'U' by 'rb' */
#ifdef _AIX
/* Patch to fix MemoryError when trying to open files in AIX 64-bit
See http://bugs.python.org/issue6600 */
newmode = PyMem_MALLOC(3 + strlen(mode));
#else
newmode = PyMem_MALLOC(strlen(mode) + 3);
#endif
if (!newmode) {
PyErr_NoMemory();
return NULL;
Expand Down
25 changes: 13 additions & 12 deletions PCbuild/_hashlib.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,25 @@
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="pyproject.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="openssl.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="openssl.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="openssl.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="openssl.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(opensslIncludeDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<AdditionalDependencies>ws2_32.lib;$(OutDir)libeay$(PyDebugExt).lib;$(OutDir)ssleay$(PyDebugExt).lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
Expand All @@ -75,14 +84,6 @@
<Project>{cf7ac3d1-e2df-41d2-bea6-1e2556cdea26}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="ssleay.vcxproj">
<Project>{10615b24-73bf-4efa-93aa-236916321317}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="libeay.vcxproj">
<Project>{e5b04cc0-eb4c-42ab-b4dc-18ef95f864b0}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
Expand Down
25 changes: 13 additions & 12 deletions PCbuild/_ssl.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,25 @@
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="pyproject.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="openssl.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="openssl.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="openssl.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="openssl.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(opensslIncludeDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<AdditionalDependencies>ws2_32.lib;crypt32.lib;$(OutDir)libeay$(PyDebugExt).lib;$(OutDir)ssleay$(PyDebugExt).lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>ws2_32.lib;crypt32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
Expand All @@ -75,14 +84,6 @@
<Project>{cf7ac3d1-e2df-41d2-bea6-1e2556cdea26}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="libeay.vcxproj">
<Project>{e5b04cc0-eb4c-42ab-b4dc-18ef95f864b0}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="ssleay.vcxproj">
<Project>{10615b24-73bf-4efa-93aa-236916321317}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="_socket.vcxproj">
<Project>{86937f53-c189-40ef-8ce8-8759d8e7d480}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
Expand Down
110 changes: 110 additions & 0 deletions PCbuild/build_activestate.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
@echo off
goto Run
:Usage
echo.%~nx0 [flags and arguments] [quoted MSBuild options]
echo.
echo.Build CPython from the command line. Requires the appropriate
echo.version(s) of Microsoft Visual Studio to be installed (see readme.txt).
echo.Also requires Subversion (svn.exe) to be on PATH if the '-e' flag is
echo.given.
echo.
echo.After the flags recognized by this script, up to 9 arguments to be passed
echo.directly to MSBuild may be passed. If the argument contains an '=', the
echo.entire argument must be quoted (e.g. `%~nx0 "/p:PlatformToolset=v100"`)
echo.
echo.Available flags:
echo. -h Display this help message
echo. -V Display version information for the current build
echo. -r Target Rebuild instead of Build
echo. -d Set the configuration to Debug
echo. -e Build external libraries fetched by get_externals.bat
echo. Extension modules that depend on external libraries will not attempt
echo. to build if this flag is not present
echo. -m Enable parallel build (enabled by default)
echo. -M Disable parallel build
echo. -v Increased output messages
echo. -k Attempt to kill any running Pythons before building (usually done
echo. automatically by the pythoncore project)
echo.
echo.Available flags to avoid building certain modules.
echo.These flags have no effect if '-e' is not given:
echo. --no-ssl Do not attempt to build _ssl
echo. --no-tkinter Do not attempt to build Tkinter
echo. --no-bsddb Do not attempt to build _bsddb
echo.
echo.Available arguments:
echo. -c Release ^| Debug ^| PGInstrument ^| PGUpdate
echo. Set the configuration (default: Release)
echo. -p x64 ^| Win32
echo. Set the platform (default: Win32)
echo. -t Build ^| Rebuild ^| Clean ^| CleanAll
echo. Set the target manually
echo. --test-marker Enable the test marker within the build.
exit /b 127

:Run
setlocal
set platf=Win32
set vs_platf=x86
set conf=Release
set target=Build
set dir=%~dp0
set parallel=/m
set verbose=/nologo /v:m
set kill=

:CheckOpts
if "%~1"=="-h" goto Usage
if "%~1"=="-c" (set conf=%2) & shift & shift & goto CheckOpts
if "%~1"=="-p" (set platf=%2) & shift & shift & goto CheckOpts
if "%~1"=="-r" (set target=Rebuild) & shift & goto CheckOpts
if "%~1"=="-t" (set target=%2) & shift & shift & goto CheckOpts
if "%~1"=="-d" (set conf=Debug) & shift & goto CheckOpts
if "%~1"=="-m" (set parallel=/m) & shift & goto CheckOpts
if "%~1"=="-M" (set parallel=) & shift & goto CheckOpts
if "%~1"=="-v" (set verbose=/v:n) & shift & goto CheckOpts
if "%~1"=="-k" (set kill=true) & shift & goto CheckOpts
if "%~1"=="--test-marker" (set UseTestMarker=true) & shift & goto CheckOpts
if "%~1"=="-V" shift & goto Version
rem These use the actual property names used by MSBuild. We could just let
rem them in through the environment, but we specify them on the command line
rem anyway for visibility so set defaults after this
if "%~1"=="-e" (set IncludeExternals=true) & shift & goto CheckOpts
if "%~1"=="--no-ssl" (set IncludeSSL=false) & shift & goto CheckOpts
if "%~1"=="--no-tkinter" (set IncludeTkinter=false) & shift & goto CheckOpts
if "%~1"=="--no-bsddb" (set IncludeBsddb=false) & shift & goto CheckOpts

if "%IncludeExternals%"=="" set IncludeExternals=false
if "%IncludeSSL%"=="" set IncludeSSL=true
if "%IncludeTkinter%"=="" set IncludeTkinter=true
if "%IncludeBsddb%"=="" set IncludeBsddb=true

rem UBS has called get_externals_activestate.bat before running the build
rem if "%IncludeExternals%"=="true" call "%dir%get_externals_activestate.bat"

if "%platf%"=="x64" (set vs_platf=x86_amd64)

rem Setup the environment
call "%dir%env.bat" %vs_platf% >nul

if "%kill%"=="true" (
msbuild /v:m /nologo /target:KillPython "%dir%\pythoncore.vcxproj" /p:Configuration=%conf% /p:Platform=%platf% /p:KillPython=true
)

rem Call on MSBuild to do the work, echo the command.
rem Passing %1-9 is not the preferred option, but argument parsing in
rem batch is, shall we say, "lackluster"
echo on
msbuild "%dir%pcbuild.proj" /t:%target% %parallel% %verbose%^
/p:Configuration=%conf% /p:Platform=%platf%^
/p:IncludeExternals=%IncludeExternals%^
/p:IncludeSSL=%IncludeSSL% /p:IncludeTkinter=%IncludeTkinter%^
/p:IncludeBsddb=%IncludeBsddb%^
/p:UseTestMarker=%UseTestMarker%^
%1 %2 %3 %4 %5 %6 %7 %8 %9

@goto :eof

:Version
rem Display the current build version information
msbuild "%dir%python.props" /t:ShowVersionInfo /v:m /nologo %1 %2 %3 %4 %5 %6 %7 %8 %9
7 changes: 3 additions & 4 deletions PCbuild/get_externals.bat
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,9 @@ rem When updating these versions, remember to update the relevant property
rem files in both this dir and PC\VS9.0

set libraries=
set libraries=%libraries% bzip2-1.0.6
set libraries=%libraries% bzip2-1.0.8
if NOT "%IncludeBsddb%"=="false" set libraries=%libraries% bsddb-4.7.25.0
if NOT "%IncludeSSL%"=="false" set libraries=%libraries% openssl-1.0.2t
set libraries=%libraries% sqlite-3.28.0.0
set libraries=%libraries% sqlite-3.34.1.0
if NOT "%IncludeTkinter%"=="false" set libraries=%libraries% tcl-8.5.19.0
if NOT "%IncludeTkinter%"=="false" set libraries=%libraries% tk-8.5.19.0
if NOT "%IncludeTkinter%"=="false" set libraries=%libraries% tix-8.4.3.5
Expand All @@ -61,7 +60,7 @@ for %%e in (%libraries%) do (
git clone --depth 1 https://github.com/%ORG%/cpython-source-deps --branch %%e "%EXTERNALS_DIR%\%%e"
) else (
echo.Fetching %%e...
%PYTHON% "%PCBUILD%\get_external.py" -O %ORG% %%e
%PYTHON% "%PCBUILD%\get_external.py" -O %ORG% -e "%EXTERNALS_DIR%" %%e
)
)

Expand Down
Loading