Skip to content

Commit 1d7af14

Browse files
Fixes for compiling bootloader on Solaris 10 systems (pyinstaller#9171)
* exclude libsocket.so as this is specific to the Solaris installation and causes symbol errors otherwise * add identifier for SPARC vs Intel as bootloaders built on one do not work on the other * add definition for wcsdup which is not available on Solaris 10u11
1 parent 9f1d756 commit 1d7af14

4 files changed

Lines changed: 27 additions & 0 deletions

File tree

PyInstaller/_shared_with_waf.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ def _pyi_machine(machine, system):
5151
else:
5252
return "intel"
5353

54+
if system == "SunOS":
55+
if machine.lower() in ("x86", "i86pc"):
56+
return "intel"
57+
else:
58+
return "sparc"
59+
5460
if system != "Linux":
5561
# No architecture specifier for anything par Linux.
5662
# - macOS is on two 64 bit architectures, but they are merged into one "universal2" bootloader.

PyInstaller/depend/dylib.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,10 @@
237237
r'libz\.a',
238238
}
239239

240+
_solaris_excludes = {
241+
r'libsocket\.so(\..*)?',
242+
}
243+
240244
_cygwin_excludes = {
241245
r'cygwin1\.dll',
242246
}
@@ -249,6 +253,10 @@
249253
elif compat.is_aix:
250254
# The exclude list for AIX differs from other *nix platforms.
251255
_excludes |= _aix_excludes
256+
elif compat.is_solar:
257+
# The exclude list for Solaris differs from other *nix platforms.
258+
_excludes |= _solaris_excludes
259+
_excludes |= _unix_excludes
252260
elif compat.is_unix:
253261
# Common excludes for *nix platforms -- except AIX.
254262
_excludes |= _unix_excludes

bootloader/src/pyi_pyconfig.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,18 @@
2424
#include "pyi_main.h"
2525
#include "pyi_utils.h"
2626

27+
#ifndef HAVE_WCSDUP
28+
static wchar_t
29+
*wcsdup(const wchar_t *s)
30+
{
31+
size_t len = wcslen(s) + 1;
32+
wchar_t *new_s = malloc(len * sizeof(wchar_t));
33+
if (new_s) {
34+
wcscpy(new_s, s);
35+
}
36+
return new_s;
37+
}
38+
#endif
2739

2840
/*
2941
* Clean up and free the PyiRuntimeOptions structure created by

bootloader/wscript

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,7 @@ def configure(ctx):
686686
('unistd.h' if ctx.env.DEST_OS == 'darwin' else 'stdlib.h', 'mkdtemp'),
687687
('libgen.h', 'dirname'),
688688
('libgen.h', 'basename'),
689+
('wchar.h', 'wcsdup')
689690
):
690691
ctx.check(
691692
fragment=SNIP_FUNCTION % (header, function_name),

0 commit comments

Comments
 (0)