From 0715a801b4ae852bfbe7c9b9485feef13776daaf Mon Sep 17 00:00:00 2001 From: stes Date: Wed, 29 Apr 2020 13:31:35 +0200 Subject: [PATCH 01/17] SunPRO change --- platforms/Cross/plugins/IA32ABI/ia32abicc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platforms/Cross/plugins/IA32ABI/ia32abicc.c b/platforms/Cross/plugins/IA32ABI/ia32abicc.c index 166a1a5e4c..c9ca3b281b 100644 --- a/platforms/Cross/plugins/IA32ABI/ia32abicc.c +++ b/platforms/Cross/plugins/IA32ABI/ia32abicc.c @@ -232,7 +232,7 @@ thunkEntry(void *thunkp, sqIntptr_t *stackp) long vhigh = vmcc.rvs.valleint64.high; #if _MSC_VER _asm mov edx, dword ptr vhigh; -#elif __GNUC__ +#elif __GNUC__ || __SUNPRO_C __asm__ ("mov %0,%%edx" : : "m"(vhigh)); #else # error need to load edx with vmcc.rvs.valleint64.high on this compiler @@ -244,7 +244,7 @@ thunkEntry(void *thunkp, sqIntptr_t *stackp) double valflt64 = vmcc.rvs.valflt64; #if _MSC_VER _asm fld qword ptr valflt64; -#elif __GNUC__ +#elif __GNUC__ || __SUNPRO_C __asm__ ("fldl %0" : : "m"(valflt64)); #else # error need to load %f0 with vmcc.rvs.valflt64 on this compiler From 42000ad5a2ebbc8d76e08b075ff530c02c89e66c Mon Sep 17 00:00:00 2001 From: stes Date: Wed, 29 Apr 2020 13:32:17 +0200 Subject: [PATCH 02/17] SunPRO change --- platforms/Cross/plugins/IA32ABI/x64sysvabicc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platforms/Cross/plugins/IA32ABI/x64sysvabicc.c b/platforms/Cross/plugins/IA32ABI/x64sysvabicc.c index 44f6691ee3..7eda494e26 100644 --- a/platforms/Cross/plugins/IA32ABI/x64sysvabicc.c +++ b/platforms/Cross/plugins/IA32ABI/x64sysvabicc.c @@ -224,7 +224,7 @@ thunkEntry(long a0, long a1, long a2, long a3, long a4, long a5, double valflt64 = vmcc.rvs.valflt64; #if _MSC_VER _asm mov qword ptr valflt64, xmm0; -#elif __GNUC__ +#elif __GNUC__ || __SUNPRO_C __asm__("movq %0, %%xmm0" : : "m"(valflt64)); #else # error need to load %xmm0 with vmcc.rvs.valflt64 on this compiler From 372e3a78180b66a0833a27f214a0f55e28210c83 Mon Sep 17 00:00:00 2001 From: stes Date: Wed, 29 Apr 2020 13:32:51 +0200 Subject: [PATCH 03/17] SunPRO change --- platforms/Cross/vm/sqAtomicOps.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/platforms/Cross/vm/sqAtomicOps.h b/platforms/Cross/vm/sqAtomicOps.h index dab6390938..ff5d3fdd7f 100644 --- a/platforms/Cross/vm/sqAtomicOps.h +++ b/platforms/Cross/vm/sqAtomicOps.h @@ -106,7 +106,7 @@ AtomicGet(uint64_t *target) # define set64(variable,value) AtomicSet(&(variable),value) /* Currently we provide definitions for x86 and GCC only. But see below. */ -# elif defined(__GNUC__) && (defined(i386) || defined(__i386) || defined(__i386__) || defined(_X86_)) +# elif (defined(__GNUC__) || defined(__SUNPRO_C)) && (defined(i386) || defined(__i386) || defined(__i386__) || defined(_X86_)) /* atomic read & write of 64-bit values using SSE2 movq to/from sse register. * 64-bit reads & writes are only guaranteed to be atomic if aligned on a 64-bit @@ -210,6 +210,7 @@ AtomicGet(__int64 *target) # define set64(variable,value) (variable = value) #else + /* Dear implementor, you have choices. For example consider defining get64 & * set64 thusly * #define get64(var) read64(&(var)) @@ -251,7 +252,7 @@ AtomicGet(__int64 *target) error("no interlocked add for this variable size"); \ } while (0) -#elif defined(__GNUC__) || defined(__clang__) +#elif defined(__GNUC__) || defined(__clang__) || defined(__SUNPRO_C) /* N.B. I know you want to use the intrinsics; they're pretty; they're official; * they're portable. But they only apply to int, long and long long sizes. * Since we want to use 16-bit variables for signal requests and responses in @@ -314,7 +315,7 @@ AtomicGet(__int64 *target) # define sqCompareAndSwap(var,old,new) \ InterlockedCompareExchange(&(var), new, old) -#elif defined(__GNUC__) || defined(__clang__) +#elif defined(__GNUC__) || defined(__clang__) || defined(__SUNPRO_C) # if GCC_HAS_BUILTIN_SYNC || defined(__clang__) # define sqCompareAndSwap(var,old,new) \ __sync_bool_compare_and_swap(&(var), old, new) From d4496d536b2970912393fba474f8b52d5395f323 Mon Sep 17 00:00:00 2001 From: stes Date: Wed, 29 Apr 2020 13:34:07 +0200 Subject: [PATCH 04/17] SunPRO change --- platforms/Cross/vm/sqMemoryFence.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platforms/Cross/vm/sqMemoryFence.h b/platforms/Cross/vm/sqMemoryFence.h index 971e7039cd..4ba9cc5747 100644 --- a/platforms/Cross/vm/sqMemoryFence.h +++ b/platforms/Cross/vm/sqMemoryFence.h @@ -52,6 +52,8 @@ # define sqLowLevelMFence() asm volatile ("mfence") # endif # endif +#elif defined(__SUNPRO_C) +# define sqLowLevelMFence() asm volatile ("mfence") #elif defined(_MSC_VER) /* # define sqLowLevelMFence() _asm { mfence } */ /* could use mfence here but */ \ From b118a116b908fca7e34e41ff709585b7a26eb24f Mon Sep 17 00:00:00 2001 From: stes Date: Wed, 29 Apr 2020 13:38:49 +0200 Subject: [PATCH 05/17] sun change: define MIN function --- platforms/unix/plugins/SqueakSSL/sqUnixOpenSSL.inc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/platforms/unix/plugins/SqueakSSL/sqUnixOpenSSL.inc b/platforms/unix/plugins/SqueakSSL/sqUnixOpenSSL.inc index f45af7ac35..c5135c4d86 100644 --- a/platforms/unix/plugins/SqueakSSL/sqUnixOpenSSL.inc +++ b/platforms/unix/plugins/SqueakSSL/sqUnixOpenSSL.inc @@ -13,6 +13,11 @@ #include +#ifdef __sun +/* MIN is not C stdlib - perhaps is defining it on Linux */ +static int MIN(int a,int b) { return (a Date: Wed, 29 Apr 2020 13:43:27 +0200 Subject: [PATCH 06/17] sun change: include to define FASYNC --- platforms/unix/vm/aio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/platforms/unix/vm/aio.c b/platforms/unix/vm/aio.c index 3a44067092..6d61359bf0 100644 --- a/platforms/unix/vm/aio.c +++ b/platforms/unix/vm/aio.c @@ -81,6 +81,7 @@ # if __sun__ # include + # include /* FASYNC or ioctl FIOASYNC will be issued */ # define signal(a, b) sigset(a, b) # endif From 279638a5e2f5b73f43a7a8ce0d92caf0681e2968 Mon Sep 17 00:00:00 2001 From: stes Date: Wed, 29 Apr 2020 13:51:19 +0200 Subject: [PATCH 07/17] sun change: include for --- platforms/unix/vm/include_ucontext.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/platforms/unix/vm/include_ucontext.h b/platforms/unix/vm/include_ucontext.h index 7dc8d92d0d..09e52ac4d6 100644 --- a/platforms/unix/vm/include_ucontext.h +++ b/platforms/unix/vm/include_ucontext.h @@ -19,6 +19,9 @@ #endif #ifdef __OpenBSD__ # include +#elif __sun +/* Single UNIX Specification (SUS), Version 2 specifies */ +# include #else # include #endif @@ -36,6 +39,10 @@ # define _PC_IN_UCONTEXT uc_mcontext->__ss.__rip #elif __APPLE__ && __MACH__ && __x86_64__ # define _PC_IN_UCONTEXT uc_mcontext->ss.rip +#elif __sun && __amd64 +# define _PC_IN_UCONTEXT uc_mcontext.gregs[REG_RIP] +#elif __sun && __i386__ +# define _PC_IN_UCONTEXT uc_mcontext.gregs[EIP] #elif __linux__ && __i386__ # define _PC_IN_UCONTEXT uc_mcontext.gregs[REG_EIP] #elif __linux__ && __x86_64__ From 9e5c8569f747880cf30c886f7a74f8aa7c49b8d8 Mon Sep 17 00:00:00 2001 From: stes Date: Wed, 29 Apr 2020 13:53:49 +0200 Subject: [PATCH 08/17] SunPRO change --- platforms/unix/vm/sqUnixHeartbeat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platforms/unix/vm/sqUnixHeartbeat.c b/platforms/unix/vm/sqUnixHeartbeat.c index 908affd6bf..5ea811b8b0 100644 --- a/platforms/unix/vm/sqUnixHeartbeat.c +++ b/platforms/unix/vm/sqUnixHeartbeat.c @@ -172,9 +172,9 @@ ioHighResClock(void) /* return the value of the high performance counter */ sqLong value = 0; -#if defined(__GNUC__) && (defined(i386) || defined(__i386) || defined(__i386__)) +#if (defined(__GNUC__) || defined(__SUNPRO_C)) && (defined(i386) || defined(__i386) || defined(__i386__)) __asm__ __volatile__ ("rdtsc" : "=A"(value)); -#elif defined(__GNUC__) && (defined(x86_64) || defined(__x86_64) || defined (__x86_64__)) +#elif (defined(__GNUC__) || defined(__SUNPRO_C)) && (defined(x86_64) || defined(__x86_64) || defined (__x86_64__)) __asm__ __volatile__ ("rdtsc\n\t" // Returns the time in EDX:EAX. "shl $32, %%rdx\n\t" // Shift the upper bits left. "or %%rdx, %0" // 'Or' in the lower bits. From f317a846e1ac2ba572dcd5742da861667ee5c9da Mon Sep 17 00:00:00 2001 From: stes Date: Wed, 29 Apr 2020 13:55:26 +0200 Subject: [PATCH 09/17] SunPRO change --- platforms/unix/vm/sqUnixITimerHeartbeat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platforms/unix/vm/sqUnixITimerHeartbeat.c b/platforms/unix/vm/sqUnixITimerHeartbeat.c index 15984f0b10..27dc2cf6b6 100644 --- a/platforms/unix/vm/sqUnixITimerHeartbeat.c +++ b/platforms/unix/vm/sqUnixITimerHeartbeat.c @@ -161,9 +161,9 @@ ioHighResClock(void) /* return the value of the high performance counter */ sqLong value = 0; -#if defined(__GNUC__) && (defined(i386) || defined(__i386) || defined(__i386__)) +#if (defined(__GNUC__) || defined(__SUNPRO_C)) && (defined(i386) || defined(__i386) || defined(__i386__)) __asm__ __volatile__ ("rdtsc" : "=A"(value)); -#elif defined(__GNUC__) && (defined(x86_64) || defined(__x86_64) || defined (__x86_64__)) +#elif (defined(__GNUC__) || defined(__SUNPRO_C)) && (defined(x86_64) || defined(__x86_64) || defined (__x86_64__)) __asm__ __volatile__ ("rdtsc\n\t" // Returns the time in EDX:EAX. "shl $32, %%rdx\n\t" // Shift the upper bits left. "or %%rdx, %0" // 'Or' in the lower bits. From de13b0a55ab702bfc2b4d29c0f4698dabd704449 Mon Sep 17 00:00:00 2001 From: stes Date: Wed, 29 Apr 2020 14:00:20 +0200 Subject: [PATCH 10/17] sun change: fp and sp in amd64 case --- platforms/unix/vm/sqUnixMain.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/platforms/unix/vm/sqUnixMain.c b/platforms/unix/vm/sqUnixMain.c index 2d2196f31d..c2f5981b1c 100644 --- a/platforms/unix/vm/sqUnixMain.c +++ b/platforms/unix/vm/sqUnixMain.c @@ -943,6 +943,9 @@ reportStackState(char *msg, char *date, int printAll, ucontext_t *uap) # elif __sun__ && __i386__ void *fp = (void *)(uap ? uap->uc_mcontext.gregs[REG_FP] : 0); void *sp = (void *)(uap ? uap->uc_mcontext.gregs[REG_SP] : 0); +# elif __sun__ && __amd64 + void *fp = (void *)(uap ? uap->uc_mcontext.gregs[REG_FP] : 0); + void *sp = (void *)(uap ? uap->uc_mcontext.gregs[REG_SP] : 0); # elif defined(__arm64__) || defined(__aarch64__) || defined(ARM64) void *fp = (void *)(uap ? uap->uc_mcontext.regs[29] : 0); void *sp = (void *)(uap ? uap->uc_mcontext.sp : 0); From 5953e6305a89cd56b6d2dac54aed7c38e5deaad4 Mon Sep 17 00:00:00 2001 From: stes Date: Wed, 29 Apr 2020 14:02:17 +0200 Subject: [PATCH 11/17] sun change: define MIN/MAX functions --- platforms/unix/vm-sound-pulse/sqUnixSoundPulseAudio.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/platforms/unix/vm-sound-pulse/sqUnixSoundPulseAudio.c b/platforms/unix/vm-sound-pulse/sqUnixSoundPulseAudio.c index 5769574cf7..c7320a6742 100644 --- a/platforms/unix/vm-sound-pulse/sqUnixSoundPulseAudio.c +++ b/platforms/unix/vm-sound-pulse/sqUnixSoundPulseAudio.c @@ -275,6 +275,13 @@ static double max_delay_frames = 0; /* ================================== UTILS */ + +#ifdef __sun +/* no MIN/MAX in C stdlib - perhaps is defining it on Linux */ +static int MIN(int a,int b) { return (a Date: Wed, 29 Apr 2020 14:05:17 +0200 Subject: [PATCH 12/17] sun change: no -q option for fgrep --- scripts/checkSCCSversion | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/checkSCCSversion b/scripts/checkSCCSversion index f0e246889e..db4c481804 100755 --- a/scripts/checkSCCSversion +++ b/scripts/checkSCCSversion @@ -6,7 +6,7 @@ PWD="`dirname $0`" VERSION_FILE="platforms/Cross/vm/sqSCCSVersion.h" -if fgrep -q '$Rev$' "$PWD/../$VERSION_FILE" ; then +if fgrep '$Rev$' "$PWD/../$VERSION_FILE" ; then echo "$VERSION_FILE not up-to-date." 1>&2 echo "You must run $PWD/updateSCCSVersions" 1>&2 exit 0 # i.e. so that we can say if checkSCCSVersion; then exit 1; fi From 8528024f1879dbcf4ed231f90c1363df41a1ef29 Mon Sep 17 00:00:00 2001 From: David Stes Date: Wed, 29 Apr 2020 13:45:06 +0200 Subject: [PATCH 13/17] sqo_SSL_CTX_set_options problem with --disable-dynamicopenssl (openssl 1.0.2) --- platforms/unix/plugins/SqueakSSL/openssl_overlay.h | 1 + 1 file changed, 1 insertion(+) diff --git a/platforms/unix/plugins/SqueakSSL/openssl_overlay.h b/platforms/unix/plugins/SqueakSSL/openssl_overlay.h index d693c26a45..0ea6e9fd4d 100644 --- a/platforms/unix/plugins/SqueakSSL/openssl_overlay.h +++ b/platforms/unix/plugins/SqueakSSL/openssl_overlay.h @@ -102,6 +102,7 @@ #define sqo_sk_GENERAL_NAME_pop_free sk_GENERAL_NAME_pop_free #if OPENSSL_VERSION_NUMBER >= 0x10002000L +#define sqo_SSL_CTX_set_options SSL_CTX_set_options #define sqo_X509_check_ip_asc X509_check_ip_asc #define sqo_X509_check_host X509_check_host #elif OPENSSL_VERSION_NUMBER < 0x10002000L From a68e4aa7b24dab83c4f85a6192fa393602e3fe8d Mon Sep 17 00:00:00 2001 From: stes Date: Thu, 30 Apr 2020 09:45:43 +0200 Subject: [PATCH 14/17] Add build.sunos32x86 and build.sunos64x64 directories --- build.sunos32x86/HowToBuild | 3 + build.sunos32x86/squeak.cog.spur/build/mvm | 39 +++++ build.sunos32x86/squeak.cog.spur/plugins.ext | 17 ++ build.sunos32x86/squeak.cog.spur/plugins.int | 37 +++++ build.sunos32x86/squeak.stack.spur/build/mvm | 40 +++++ .../squeak.stack.spur/plugins.ext | 14 ++ .../squeak.stack.spur/plugins.int | 37 +++++ build.sunos64x64/HowToBuild | 145 ++++++++++++++++++ build.sunos64x64/squeak.cog.spur/build/mvm | 38 +++++ build.sunos64x64/squeak.cog.spur/plugins.ext | 17 ++ build.sunos64x64/squeak.cog.spur/plugins.int | 37 +++++ build.sunos64x64/squeak.stack.spur/build/mvm | 32 ++++ .../squeak.stack.spur/plugins.ext | 14 ++ .../squeak.stack.spur/plugins.int | 37 +++++ 14 files changed, 507 insertions(+) create mode 100644 build.sunos32x86/HowToBuild create mode 100755 build.sunos32x86/squeak.cog.spur/build/mvm create mode 100644 build.sunos32x86/squeak.cog.spur/plugins.ext create mode 100644 build.sunos32x86/squeak.cog.spur/plugins.int create mode 100755 build.sunos32x86/squeak.stack.spur/build/mvm create mode 100644 build.sunos32x86/squeak.stack.spur/plugins.ext create mode 100644 build.sunos32x86/squeak.stack.spur/plugins.int create mode 100644 build.sunos64x64/HowToBuild create mode 100755 build.sunos64x64/squeak.cog.spur/build/mvm create mode 100644 build.sunos64x64/squeak.cog.spur/plugins.ext create mode 100644 build.sunos64x64/squeak.cog.spur/plugins.int create mode 100755 build.sunos64x64/squeak.stack.spur/build/mvm create mode 100644 build.sunos64x64/squeak.stack.spur/plugins.ext create mode 100644 build.sunos64x64/squeak.stack.spur/plugins.int diff --git a/build.sunos32x86/HowToBuild b/build.sunos32x86/HowToBuild new file mode 100644 index 0000000000..285457293e --- /dev/null +++ b/build.sunos32x86/HowToBuild @@ -0,0 +1,3 @@ + +See the file ../build.sunos64x64 "HowToBuild" for Solaris (SunOS) Notes. + diff --git a/build.sunos32x86/squeak.cog.spur/build/mvm b/build.sunos32x86/squeak.cog.spur/build/mvm new file mode 100755 index 0000000000..4bd73a5de9 --- /dev/null +++ b/build.sunos32x86/squeak.cog.spur/build/mvm @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +set -e +case "`uname -m`" in # ensure we see x86 as machine type +i86pc) ;; # we're good +*) if type i386 2>&1 >/dev/null; then + echo "Re-exec as x86" + exec i386 "$0" "$@" +fi ;; +esac +# Spur VM with VM profiler and threaded heartbeat +MAKE=/usr/bin/gmake +INSTALLDIR=sqcogspursunosht/usr +# Some gcc versions create a broken VM using -O2 +OPT="-g -DNDEBUG -DDEBUGVM=0" + +if [ $# -ge 1 ]; then + INSTALLDIR="$1"; shift +fi + +if ../../../scripts/checkSCCSversion ; then exit 1; fi +echo -n "clean? " +read a +case $a in +n|no|N|NO) echo "ok but this isn't safe!!";; +*) test -f Makefile && $MAKE reallyclean +esac +test -f plugins.int || (test -f ../plugins.int && cp -p ../plugins.int . || cp -p ../../plugins.int .) +test -f plugins.ext || (test -f ../plugins.ext && cp -p ../plugins.ext . || cp -p ../../plugins.ext .) +test -f config.h || ../../../platforms/unix/config/configure --without-npsqueak \ + --with-vmversion=5.0 \ + --disable-dynamicopenssl \ + --with-src=spursrc \ + TARGET_ARCH="-m32" \ + CFLAGS="$OPT -DCOGMTVM=0" +rm -f vm/sqUnixMain.o # nuke version info +rm -rf ../../../products/$INSTALLDIR +# prefer $MAKE install prefix=`readlink -f \`pwd\`/../../../products/$INSTALLDIR` +# but older linux readlinks lack the -f flag +$MAKE install-squeak install-plugins prefix=`(cd ../../../;pwd)`/products/$INSTALLDIR 2>&1 | tee LOG diff --git a/build.sunos32x86/squeak.cog.spur/plugins.ext b/build.sunos32x86/squeak.cog.spur/plugins.ext new file mode 100644 index 0000000000..50bdfef8f7 --- /dev/null +++ b/build.sunos32x86/squeak.cog.spur/plugins.ext @@ -0,0 +1,17 @@ +# Copied, perhaps edited, from ../../src/examplePlugins.ext +EXTERNAL_PLUGINS = \ +MIDIPlugin \ +B3DAcceleratorPlugin \ +BochsIA32Plugin \ +BochsX64Plugin \ +GdbARMPlugin \ +FileAttributesPlugin \ +Squeak3D \ +SqueakFFIPrims \ +SqueakSSL \ +LocalePlugin \ +UnicodePlugin \ +UnixOSProcessPlugin \ +UUIDPlugin \ +ImmX11Plugin \ +XDisplayControlPlugin diff --git a/build.sunos32x86/squeak.cog.spur/plugins.int b/build.sunos32x86/squeak.cog.spur/plugins.int new file mode 100644 index 0000000000..7d1445aa36 --- /dev/null +++ b/build.sunos32x86/squeak.cog.spur/plugins.int @@ -0,0 +1,37 @@ +# Copied, perhaps edited, from ../../src/examplePlugins.int +INTERNAL_PLUGINS = \ +ADPCMCodecPlugin \ +AioPlugin \ +AsynchFilePlugin \ +B2DPlugin \ +BitBltPlugin \ +BMPReadWriterPlugin \ +CroquetPlugin \ +HostWindowPlugin \ +ZipPlugin \ +DropPlugin \ +DSAPrims \ +FFTPlugin \ +FileCopyPlugin \ +FilePlugin \ +FloatArrayPlugin \ +FloatMathPlugin \ +IA32ABI \ +JoystickTabletPlugin \ +JPEGReaderPlugin \ +JPEGReadWriter2Plugin \ +Klatt \ +LargeIntegers \ +Matrix2x3Plugin \ +MiscPrimitivePlugin \ +Mpeg3Plugin \ +RePlugin \ +SecurityPlugin \ +SerialPlugin \ +SocketPlugin \ +SoundCodecPrims \ +SoundGenerationPlugin \ +SoundPlugin \ +StarSqueakPlugin \ +SurfacePlugin \ +VMProfileLinuxSupportPlugin diff --git a/build.sunos32x86/squeak.stack.spur/build/mvm b/build.sunos32x86/squeak.stack.spur/build/mvm new file mode 100755 index 0000000000..53ebe27e4f --- /dev/null +++ b/build.sunos32x86/squeak.stack.spur/build/mvm @@ -0,0 +1,40 @@ +#!/usr/bin/env bash +set -e +case "`uname -m`" in # ensure we see x86 as machine type +i86pc) ;; # we're good +*) if type i386 2>&1 >/dev/null; then + echo "Re-exec as x86" + exec i386 "$0" "$@" +fi ;; +esac +# Stack Spur VM with VM profiler and threaded heartbeat +INSTALLDIR=sqstkspursunosht/usr +# Some gcc versions create a broken VM using -O2 +OPT="-g -DNDEBUG -DDEBUGVM=0" +MAKE=/usr/bin/gmake + +if [ $# -ge 1 ]; then + INSTALLDIR="$1"; shift +fi +if ../../../scripts/checkSCCSversion ; then exit 1; fi +echo -n "clean? " +read a +case $a in +n|no|N|NO) echo "ok but this isn't safe!!";; +*) rm -f config.h; test -f Makefile && $MAKE reallyclean +esac +test -f plugins.int || (test -f ../plugins.int && cp -p ../plugins.int . || cp -p ../../plugins.int .) +test -f plugins.ext || (test -f ../plugins.ext && cp -p ../plugins.ext . || cp -p ../../plugins.ext .) +test -f config.h || ../../../platforms/unix/config/configure \ + --with-vmversion=5.0 \ + --disable-dynamicopenssl \ + --with-src=spurstacksrc --disable-cogit \ + --without-vm-display-fbdev --without-npsqueak \ + TARGET_ARCH="-m32" \ + ac_cv_cflags_warn_all="-v" \ + CFLAGS="$OPT" +rm -f vm/sqUnixMain.o # nuke version info +rm -rf ../../../products/$INSTALLDIR +# prefer $MAKE install prefix=`readlink -f \`pwd\`/../../../products/$INSTALLDIR` +# but older linux readlinks lack the -f flag +$MAKE install-squeak install-doc install-plugins prefix=`(cd ../../../;pwd)`/products/$INSTALLDIR 2>&1 | tee LOG diff --git a/build.sunos32x86/squeak.stack.spur/plugins.ext b/build.sunos32x86/squeak.stack.spur/plugins.ext new file mode 100644 index 0000000000..3dc9503209 --- /dev/null +++ b/build.sunos32x86/squeak.stack.spur/plugins.ext @@ -0,0 +1,14 @@ +# Copied, perhaps edited, from ../../src/examplePlugins.ext +EXTERNAL_PLUGINS = \ +MIDIPlugin \ +B3DAcceleratorPlugin \ +FileAttributesPlugin \ +Squeak3D \ +SqueakFFIPrims \ +SqueakSSL \ +LocalePlugin \ +UnicodePlugin \ +UnixOSProcessPlugin \ +UUIDPlugin \ +ImmX11Plugin \ +XDisplayControlPlugin diff --git a/build.sunos32x86/squeak.stack.spur/plugins.int b/build.sunos32x86/squeak.stack.spur/plugins.int new file mode 100644 index 0000000000..7d1445aa36 --- /dev/null +++ b/build.sunos32x86/squeak.stack.spur/plugins.int @@ -0,0 +1,37 @@ +# Copied, perhaps edited, from ../../src/examplePlugins.int +INTERNAL_PLUGINS = \ +ADPCMCodecPlugin \ +AioPlugin \ +AsynchFilePlugin \ +B2DPlugin \ +BitBltPlugin \ +BMPReadWriterPlugin \ +CroquetPlugin \ +HostWindowPlugin \ +ZipPlugin \ +DropPlugin \ +DSAPrims \ +FFTPlugin \ +FileCopyPlugin \ +FilePlugin \ +FloatArrayPlugin \ +FloatMathPlugin \ +IA32ABI \ +JoystickTabletPlugin \ +JPEGReaderPlugin \ +JPEGReadWriter2Plugin \ +Klatt \ +LargeIntegers \ +Matrix2x3Plugin \ +MiscPrimitivePlugin \ +Mpeg3Plugin \ +RePlugin \ +SecurityPlugin \ +SerialPlugin \ +SocketPlugin \ +SoundCodecPrims \ +SoundGenerationPlugin \ +SoundPlugin \ +StarSqueakPlugin \ +SurfacePlugin \ +VMProfileLinuxSupportPlugin diff --git a/build.sunos64x64/HowToBuild b/build.sunos64x64/HowToBuild new file mode 100644 index 0000000000..a49eca96cd --- /dev/null +++ b/build.sunos64x64/HowToBuild @@ -0,0 +1,145 @@ + +How To Build On Solaris +----------------------- + +Contents: + - Overview + - Real-Time + - Swapspace + - C Compiler + - GNU make + - IPS package + +Overview +-------- + +These are some notes on building the OpenSmalltalk VM on Oracle Solaris 11. + +For some history on this operating system, see +https://en.wikipedia.org/wiki/Solaris_(operating_system) + +On Solaris "uname -s" reports the value "SunOS". + +To build, + + scripts/updateSCCSVersions + cd build.sunos64x64 (or cd build.sunos32x86) + cd squeak.cog.spur (or cd squeak.stack.spur) + cd build + ./mvm or ./mvm INSTALLDIR + +This will build and install into INSTALLDIR. +The default value for INSTALLDIR is products/sqcogspur64sunos[ht]/usr, +for the Cog Spur VM (see other values in the mvm scripts). + +To run the vm, consider running the process in the RT (real-time) class. + +For Solaris specific suggestions you can contact me (David Stes) +or alternatively (and maybe better!) the OpenSmalltalk team ... + +Real-Time +--------- + +When running the squeak vm, after copying a Squeak .image and .change file, +and after copying the Squeak Smalltalk source file (SqueakV50.sources). + +bash-4.4$ bin/squeak Squeak6.0alpha-19547-32bit.image +pthread_setschedparam failed: Not owner + +Note that it is possible to suppress the "pthread_setschedparam" warning, +by running the squeak vm in the RT (real-time) class. + +One way would be to use priocntl -e and execute the squeak in the -c RT class. + +Or perhaps at the "authorization" (auths) level it could perhaps +be possible to have an entry in /etc/security/exec_attr.d for +an authorization that gives "proc_priocntl" to squeak. + +You must do this as "root". + +Another way is to change a "bash" shell to RT class, + +bash-4.4$ priocntl -d $$ +INTERACTIVE CLASS PROCESSES: + PID[/LWP] IAUPRILIM IAUPRI IAMODE + 4026 0 0 1 + +bash-4.4$ sudo priocntl -c RT -p 0 -s $$ + +bash-4.4$ priocntl -d $$ +REAL TIME PROCESSES: + PID[/LWP] RTPRI TQNTM TQSIG + 3966 0 1000 0 + +After changing the "bash" shell to the RT class, you can launch + +bash-4.4$ bin/squeak Squeak6.0alpha-19547-32bit.image + +It will inherit the RT class and the pthread_setschedparam warning is gone. + +Verify as follows the squeak threads (LWP light-weight processes) + +bash-4.4$ ps -eLo pid,pri,lwp,class,comm | grep squeak + 4029 100 1 RT bin/../lib/squeak/5.0-202003240214-solaris/squeak + 4029 101 2 RT bin/../lib/squeak/5.0-202003240214-solaris/squeak + +Note that one thread is running in priority 101 and another in priority 100. + +Swapspace +--------- + +It's not certain that the following notes apply, it depends on how much +RAM you have in your machine(s) ... + +But make sure that there is sufficient free space in /tmp, +mounted on swap in Solaris. + +The C compiler may use a lot of space for temporary files under /tmp. + +For example (the example 8G is what I use) : + +$ df -h /tmp +Filesystem Size Used Available Capacity Mounted on +swap 8.2G 78M 8.1G 1% /tmp + +If required, increase the "volsize" of the rpool/swap volume : + +# zfs get volsize rpool/swap +NAME PROPERTY VALUE SOURCE +rpool/swap volsize 8G local + +The command to increase the size is: + +# zpool list rpool (check FREE space) +# zfs set volsize=8G rpool/swap + +This can be done online, but a reboot is not a bad idea after doing this. + +C Compiler +---------- + +As C compiler we have used both the Sun C compiler and GCC for Solaris. +Currently we have succesfully built the VM with gcc 7.3 and gcc 9.2. + +Note that in the past Squeak3 was available on SunOS for SPARC and Intel. + +http://squeakvm.org/unix/release/Squeak-3.7-7.sparc-sun-solaris2.9.tar.gz +http://squeakvm.org/unix/release/Squeak-3.7-7.i386-pc-solaris2.9.tar.gz + +It appears that those old Squeak V3 VM's were built with "gcc" for Solaris. + +GNU Make +-------- + +For the Makefiles, pkg:/developer/build/gnu-make must be installed. + +IPS Package +----------- + +There exists an IPS (Solaris Image Packaging System) package for squeak. + +That's the easiest way to get a Squeak VM to run Squeak images, +instead of compiling yourself. + +That package is available in the "solaris-userland" . + diff --git a/build.sunos64x64/squeak.cog.spur/build/mvm b/build.sunos64x64/squeak.cog.spur/build/mvm new file mode 100755 index 0000000000..7ca44b4886 --- /dev/null +++ b/build.sunos64x64/squeak.cog.spur/build/mvm @@ -0,0 +1,38 @@ +#!/usr/bin/env bash +set -e +# Spur VM with VM profiler and threaded heartbeat +INSTALLDIR=sqcogspur64sunosht/usr +# Some gcc versions create a broken VM using -O2 +OPT="-g -DNDEBUG -DDEBUGVM=0" +MAKE=/usr/bin/gmake + +CFLAGS="$OPT -DCOGMTVM=0" +LIBS="" +LDFLAGS="" + +if [ $# -ge 1 ]; then + INSTALLDIR="$1"; shift +fi + +if ../../../scripts/checkSCCSversion ; then exit 1; fi +echo -n "clean? " +read a +case $a in +n|no|N|NO) echo "ok but this isn't safe!!";; +*) test -f Makefile && $MAKE reallyclean +esac +test -f plugins.int || (test -f ../plugins.int && cp -p ../plugins.int . || cp -p ../../plugins.int .) +test -f plugins.ext || (test -f ../plugins.ext && cp -p ../plugins.ext . || cp -p ../../plugins.ext .) +test -f config.h || ../../../platforms/unix/config/configure --without-npsqueak \ + --with-vmversion=5.0 \ + --disable-dynamicopenssl \ + --with-src=spur64src \ + TARGET_ARCH="-m64" \ + CFLAGS="$CFLAGS" \ + LIBS="$LIBS" \ + LDFLAGS="$LDFLAGS" +rm -f vm/sqUnixMain.o # nuke version info +rm -rf ../../../products/$INSTALLDIR +# prefer $MAKE install prefix=`readlink -f \`pwd\`/../../../products/$INSTALLDIR` +# but older linux readlinks lack the -f flag +$MAKE install-squeak install-doc install-plugins prefix=`(cd ../../../;pwd)`/products/$INSTALLDIR 2>&1 | tee LOG diff --git a/build.sunos64x64/squeak.cog.spur/plugins.ext b/build.sunos64x64/squeak.cog.spur/plugins.ext new file mode 100644 index 0000000000..50bdfef8f7 --- /dev/null +++ b/build.sunos64x64/squeak.cog.spur/plugins.ext @@ -0,0 +1,17 @@ +# Copied, perhaps edited, from ../../src/examplePlugins.ext +EXTERNAL_PLUGINS = \ +MIDIPlugin \ +B3DAcceleratorPlugin \ +BochsIA32Plugin \ +BochsX64Plugin \ +GdbARMPlugin \ +FileAttributesPlugin \ +Squeak3D \ +SqueakFFIPrims \ +SqueakSSL \ +LocalePlugin \ +UnicodePlugin \ +UnixOSProcessPlugin \ +UUIDPlugin \ +ImmX11Plugin \ +XDisplayControlPlugin diff --git a/build.sunos64x64/squeak.cog.spur/plugins.int b/build.sunos64x64/squeak.cog.spur/plugins.int new file mode 100644 index 0000000000..7d1445aa36 --- /dev/null +++ b/build.sunos64x64/squeak.cog.spur/plugins.int @@ -0,0 +1,37 @@ +# Copied, perhaps edited, from ../../src/examplePlugins.int +INTERNAL_PLUGINS = \ +ADPCMCodecPlugin \ +AioPlugin \ +AsynchFilePlugin \ +B2DPlugin \ +BitBltPlugin \ +BMPReadWriterPlugin \ +CroquetPlugin \ +HostWindowPlugin \ +ZipPlugin \ +DropPlugin \ +DSAPrims \ +FFTPlugin \ +FileCopyPlugin \ +FilePlugin \ +FloatArrayPlugin \ +FloatMathPlugin \ +IA32ABI \ +JoystickTabletPlugin \ +JPEGReaderPlugin \ +JPEGReadWriter2Plugin \ +Klatt \ +LargeIntegers \ +Matrix2x3Plugin \ +MiscPrimitivePlugin \ +Mpeg3Plugin \ +RePlugin \ +SecurityPlugin \ +SerialPlugin \ +SocketPlugin \ +SoundCodecPrims \ +SoundGenerationPlugin \ +SoundPlugin \ +StarSqueakPlugin \ +SurfacePlugin \ +VMProfileLinuxSupportPlugin diff --git a/build.sunos64x64/squeak.stack.spur/build/mvm b/build.sunos64x64/squeak.stack.spur/build/mvm new file mode 100755 index 0000000000..69229c0b64 --- /dev/null +++ b/build.sunos64x64/squeak.stack.spur/build/mvm @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +set -e +# Stack Spur VM with VM profiler and threaded heartbeat +INSTALLDIR=sqstkspur64sunosht/usr +# Some gcc versions create a broken VM using -O2 +OPT="-g -DNDEBUG -DDEBUGVM=0" +MAKE=/usr/bin/gmake + +if [ $# -ge 1 ]; then + INSTALLDIR="$1"; shift +fi +if ../../../scripts/checkSCCSversion ; then exit 1; fi +echo -n "clean? " +read a +case $a in +n|no|N|NO) echo "ok but this isn't safe!!";; +*) rm -f config.h; test -f Makefile && $MAKE reallyclean +esac +test -f plugins.int || (test -f ../plugins.int && cp -p ../plugins.int . || cp -p ../../plugins.int .) +test -f plugins.ext || (test -f ../plugins.ext && cp -p ../plugins.ext . || cp -p ../../plugins.ext .) +test -f config.h || ../../../platforms/unix/config/configure \ + --with-vmversion=5.0 \ + --disable-dynamicopenssl \ + --with-src=spurstack64src --disable-cogit \ + --without-vm-display-fbdev --without-npsqueak \ + TARGET_ARCH="-m64" \ + CFLAGS="$OPT" +rm -f vm/sqUnixMain.o # nuke version info +rm -rf ../../../products/$INSTALLDIR +# prefer $MAKE install prefix=`readlink -f \`pwd\`/../../../products/$INSTALLDIR` +# but older linux readlinks lack the -f flag +$MAKE install-squeak install-doc install-plugins prefix=`(cd ../../../;pwd)`/products/$INSTALLDIR 2>&1 | tee LOG diff --git a/build.sunos64x64/squeak.stack.spur/plugins.ext b/build.sunos64x64/squeak.stack.spur/plugins.ext new file mode 100644 index 0000000000..3dc9503209 --- /dev/null +++ b/build.sunos64x64/squeak.stack.spur/plugins.ext @@ -0,0 +1,14 @@ +# Copied, perhaps edited, from ../../src/examplePlugins.ext +EXTERNAL_PLUGINS = \ +MIDIPlugin \ +B3DAcceleratorPlugin \ +FileAttributesPlugin \ +Squeak3D \ +SqueakFFIPrims \ +SqueakSSL \ +LocalePlugin \ +UnicodePlugin \ +UnixOSProcessPlugin \ +UUIDPlugin \ +ImmX11Plugin \ +XDisplayControlPlugin diff --git a/build.sunos64x64/squeak.stack.spur/plugins.int b/build.sunos64x64/squeak.stack.spur/plugins.int new file mode 100644 index 0000000000..7d1445aa36 --- /dev/null +++ b/build.sunos64x64/squeak.stack.spur/plugins.int @@ -0,0 +1,37 @@ +# Copied, perhaps edited, from ../../src/examplePlugins.int +INTERNAL_PLUGINS = \ +ADPCMCodecPlugin \ +AioPlugin \ +AsynchFilePlugin \ +B2DPlugin \ +BitBltPlugin \ +BMPReadWriterPlugin \ +CroquetPlugin \ +HostWindowPlugin \ +ZipPlugin \ +DropPlugin \ +DSAPrims \ +FFTPlugin \ +FileCopyPlugin \ +FilePlugin \ +FloatArrayPlugin \ +FloatMathPlugin \ +IA32ABI \ +JoystickTabletPlugin \ +JPEGReaderPlugin \ +JPEGReadWriter2Plugin \ +Klatt \ +LargeIntegers \ +Matrix2x3Plugin \ +MiscPrimitivePlugin \ +Mpeg3Plugin \ +RePlugin \ +SecurityPlugin \ +SerialPlugin \ +SocketPlugin \ +SoundCodecPrims \ +SoundGenerationPlugin \ +SoundPlugin \ +StarSqueakPlugin \ +SurfacePlugin \ +VMProfileLinuxSupportPlugin From ddf91d5dd68263469f08b0d4f830f82e9b7468e3 Mon Sep 17 00:00:00 2001 From: David Stes Date: Fri, 1 May 2020 10:17:14 +0200 Subject: [PATCH 15/17] Add a note on uninstall header-audio to avoid OSS and Sun audio build --- build.sunos64x64/HowToBuild | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/build.sunos64x64/HowToBuild b/build.sunos64x64/HowToBuild index a49eca96cd..07e86f57c6 100644 --- a/build.sunos64x64/HowToBuild +++ b/build.sunos64x64/HowToBuild @@ -4,6 +4,7 @@ How To Build On Solaris Contents: - Overview + - Audio Headers - Real-Time - Swapspace - C Compiler @@ -37,6 +38,24 @@ To run the vm, consider running the process in the RT (real-time) class. For Solaris specific suggestions you can contact me (David Stes) or alternatively (and maybe better!) the OpenSmalltalk team ... +Audio Headers +------------- + +The configure script will look for header files (#include) and enable +the build of some sound plugins, depending on what it finds. + +Personally I like the "pulse" server supported by the "vm-sound-pulse" plugin. + +Make sure that you *uninstall* the audio headers: + +# pkg list -a system/header/header-audio +# pkg list -a library/audio/pulseaudio + +Make sure (before you configure and build) that header-audio is uninstalled, +and that pulseaudio is installed. + +The header files for pulseaudio are in the pulseaudio package. + Real-Time --------- From 8f71c4a19b6ced608d2417210d152d19feb64ae7 Mon Sep 17 00:00:00 2001 From: David Stes Date: Fri, 1 May 2020 10:29:33 +0200 Subject: [PATCH 16/17] Note on runtime/tcl-8/tcl-openssl which provides tls.h --- build.sunos64x64/HowToBuild | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/build.sunos64x64/HowToBuild b/build.sunos64x64/HowToBuild index 07e86f57c6..3efa79b9b2 100644 --- a/build.sunos64x64/HowToBuild +++ b/build.sunos64x64/HowToBuild @@ -5,6 +5,7 @@ How To Build On Solaris Contents: - Overview - Audio Headers + - OpenSSL - Real-Time - Swapspace - C Compiler @@ -56,6 +57,24 @@ and that pulseaudio is installed. The header files for pulseaudio are in the pulseaudio package. +OpenSSL +------- + +We have tested with openssl 1.0.2 and build the VM with the option: + + --disable-dynamicopenssl + +You may have to uninstall packages that provide/ usr/include/tls.h. + +The configure script may think that it has to enable TLS support, +if it finds the tls.h header file. + +The package runtime/tcl-8 or runtime/tcl-8/tcl-openssl may provide tls.h. + +In order to avoid this problem, we build the VM with the option: + + --without-libtls + Real-Time --------- From 600cfa91e6dbdcd2883cce1631a4c0fe5416d1a0 Mon Sep 17 00:00:00 2001 From: David Stes Date: Fri, 1 May 2020 10:35:48 +0200 Subject: [PATCH 17/17] Add --without-libtls for SunOS mvm scripts --- build.sunos32x86/squeak.cog.spur/build/mvm | 1 + build.sunos32x86/squeak.stack.spur/build/mvm | 1 + build.sunos64x64/squeak.cog.spur/build/mvm | 1 + build.sunos64x64/squeak.stack.spur/build/mvm | 1 + 4 files changed, 4 insertions(+) diff --git a/build.sunos32x86/squeak.cog.spur/build/mvm b/build.sunos32x86/squeak.cog.spur/build/mvm index 4bd73a5de9..dbe3bb408e 100755 --- a/build.sunos32x86/squeak.cog.spur/build/mvm +++ b/build.sunos32x86/squeak.cog.spur/build/mvm @@ -28,6 +28,7 @@ test -f plugins.int || (test -f ../plugins.int && cp -p ../plugins.int . || cp - test -f plugins.ext || (test -f ../plugins.ext && cp -p ../plugins.ext . || cp -p ../../plugins.ext .) test -f config.h || ../../../platforms/unix/config/configure --without-npsqueak \ --with-vmversion=5.0 \ + --without-libtls \ --disable-dynamicopenssl \ --with-src=spursrc \ TARGET_ARCH="-m32" \ diff --git a/build.sunos32x86/squeak.stack.spur/build/mvm b/build.sunos32x86/squeak.stack.spur/build/mvm index 53ebe27e4f..4454289ba2 100755 --- a/build.sunos32x86/squeak.stack.spur/build/mvm +++ b/build.sunos32x86/squeak.stack.spur/build/mvm @@ -28,6 +28,7 @@ test -f plugins.ext || (test -f ../plugins.ext && cp -p ../plugins.ext . || cp - test -f config.h || ../../../platforms/unix/config/configure \ --with-vmversion=5.0 \ --disable-dynamicopenssl \ + --without-libtls \ --with-src=spurstacksrc --disable-cogit \ --without-vm-display-fbdev --without-npsqueak \ TARGET_ARCH="-m32" \ diff --git a/build.sunos64x64/squeak.cog.spur/build/mvm b/build.sunos64x64/squeak.cog.spur/build/mvm index 7ca44b4886..806b409307 100755 --- a/build.sunos64x64/squeak.cog.spur/build/mvm +++ b/build.sunos64x64/squeak.cog.spur/build/mvm @@ -25,6 +25,7 @@ test -f plugins.int || (test -f ../plugins.int && cp -p ../plugins.int . || cp - test -f plugins.ext || (test -f ../plugins.ext && cp -p ../plugins.ext . || cp -p ../../plugins.ext .) test -f config.h || ../../../platforms/unix/config/configure --without-npsqueak \ --with-vmversion=5.0 \ + --without-libtls \ --disable-dynamicopenssl \ --with-src=spur64src \ TARGET_ARCH="-m64" \ diff --git a/build.sunos64x64/squeak.stack.spur/build/mvm b/build.sunos64x64/squeak.stack.spur/build/mvm index 69229c0b64..129e93fea7 100755 --- a/build.sunos64x64/squeak.stack.spur/build/mvm +++ b/build.sunos64x64/squeak.stack.spur/build/mvm @@ -20,6 +20,7 @@ test -f plugins.int || (test -f ../plugins.int && cp -p ../plugins.int . || cp - test -f plugins.ext || (test -f ../plugins.ext && cp -p ../plugins.ext . || cp -p ../../plugins.ext .) test -f config.h || ../../../platforms/unix/config/configure \ --with-vmversion=5.0 \ + --without-libtls \ --disable-dynamicopenssl \ --with-src=spurstack64src --disable-cogit \ --without-vm-display-fbdev --without-npsqueak \