diff --git a/.travis_build.sh b/.travis_build.sh index 5e2729cde..fdf649969 100755 --- a/.travis_build.sh +++ b/.travis_build.sh @@ -108,18 +108,31 @@ build_osx() { } build_windows() { + echo "Building for Windows" + + echo $ARCH + echo $FLAVOR + build_directory="./build.${ARCH}/${FLAVOR}/" + echo "${build_directory}" + [[ ! -d "${build_directory}" ]] && exit 100 pushd "${build_directory}" - # remove bochs plugins + echo "remove bochs plugins" sed -i 's/Bochs.* //g' plugins.ext + + echo "Let's build" + # We cannot zip dbg and ast if we pass -f to just to the full thing... + # Once this builds, let's pass -A instead of -f and put the full zip (but we should do several zips in the future) bash -e ./mvm -f || exit 1 - zip -r "${output_file}.zip" "./builddbg/vm/" "./buildast/vm/" "./build/vm/" + zip -r "${output_file}.zip" "./build/vm/" + # zip -r "${output_file}.zip" "./builddbg/vm/" "./buildast/vm/" "./build/vm/" popd } + if [[ ! $(type -t build_$PLATFORM) ]]; then echo "Unsupported platform '$(uname -s)'." 1>&2 exit 99 diff --git a/build.linux32ARMv6/editpharoinstall.sh b/build.linux32ARMv6/editpharoinstall.sh index b52485655..2000be28f 100755 --- a/build.linux32ARMv6/editpharoinstall.sh +++ b/build.linux32ARMv6/editpharoinstall.sh @@ -15,11 +15,11 @@ SOURCE=../../sources/$SourceFile.sources test -f $SOURCE || SOURCE=../../../sources/$SourceFile.sources if [ -f squeak ]; then mv squeak pharo - sed -i.bak 's/squeak/pharo/g' pharo + sed -i 's/squeak/pharo/g' pharo fi if [ -f bin/squeak ]; then mv bin/squeak bin/pharo - sed -i.bak 's/squeak/pharo/g' bin/pharo + sed -i 's/squeak/pharo/g' bin/pharo fi rm -rf man doc LIBDIR="`echo lib/squeak/[0-9.-]*`" diff --git a/build.linux32ARMv6/mkNamedPrims.sh b/build.linux32ARMv6/mkNamedPrims.sh deleted file mode 100755 index 7c707b88f..000000000 --- a/build.linux32ARMv6/mkNamedPrims.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -e -# Generate a sqNamedPrims.h file from plugins.int. The plugins.int used should -# be the one and only argument. -if [ $# != 1 -o ! -f "$1" ]; then - echo usage $0 plugins.int ">sqNamedPrims.h" 1>&2 - exit 1 -fi -echo "/* Automatically generated on "`date`" */" -echo "extern sqExport vm_exports[];"; -echo "extern sqExport os_exports[];"; -for p in `grep -v '^#' "$1" | sed 's/INTERNAL_PLUGINS = //' | tr -d '\\\\\\012'` -do - echo "extern sqExport "$p"_exports[];" -done -echo -echo "sqExport *pluginExports[] = {" -echo " vm_exports," -echo " os_exports," -for p in `grep -v '^#' "$1" | sed 's/INTERNAL_PLUGINS = //' | tr -d '\\\\\\012'` -do - echo " "$p"_exports," -done -echo " NULL" -echo "};" diff --git a/build.linux32ARMv6/pharo.cog.spur/build.assert/mvm b/build.linux32ARMv6/pharo.cog.spur/build.assert/mvm index e8f205d5f..10fd05934 100755 --- a/build.linux32ARMv6/pharo.cog.spur/build.assert/mvm +++ b/build.linux32ARMv6/pharo.cog.spur/build.assert/mvm @@ -25,7 +25,7 @@ test -f config.h || ../../../platforms/unix/config/configure \ CC="gcc -march=armv6 -mfpu=vfp -mfloat-abi=hard" \ CXX=g++ \ CFLAGS="$OPT -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DI_REALLY_DONT_CARE_HOW_UNSAFE_THIS_IS -DUSE_MIDI_ALSA -DCOGMTVM=0" \ - LIBS="-lpthread -luuid -lasound" \ + LIBS="-lpthread -luuid -lasound -Wl,-rpath,'\$\$ORIGIN'" \ LDFLAGS=-Wl,-z,now rm -f vm/sqUnixMain.o # nuke version info rm -rf ../../../products/$INSTALLDIR diff --git a/build.linux32ARMv6/pharo.cog.spur/build.debug/mvm b/build.linux32ARMv6/pharo.cog.spur/build.debug/mvm index fd5e702f4..e42ce9ef9 100755 --- a/build.linux32ARMv6/pharo.cog.spur/build.debug/mvm +++ b/build.linux32ARMv6/pharo.cog.spur/build.debug/mvm @@ -25,7 +25,7 @@ test -f config.h || ../../../platforms/unix/config/configure \ CC="gcc -march=armv6 -mfpu=vfp -mfloat-abi=hard" \ CXX=g++ \ CFLAGS="$OPT -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DI_REALLY_DONT_CARE_HOW_UNSAFE_THIS_IS -DUSE_MIDI_ALSA -DCOGMTVM=0" \ - LIBS="-lpthread -luuid -lasound" \ + LIBS="-lpthread -luuid -lasound -Wl,-rpath,'\$\$ORIGIN'" \ LDFLAGS=-Wl,-z,now rm -f vm/sqUnixMain.o # nuke version info rm -rf ../../../products/$INSTALLDIR diff --git a/build.linux32ARMv6/pharo.cog.spur/build/mvm b/build.linux32ARMv6/pharo.cog.spur/build/mvm index 259492119..ab697771d 100755 --- a/build.linux32ARMv6/pharo.cog.spur/build/mvm +++ b/build.linux32ARMv6/pharo.cog.spur/build/mvm @@ -43,7 +43,7 @@ test -f config.h || ../../../platforms/unix/config/configure \ CC="gcc -march=armv6 -mfpu=vfp -mfloat-abi=hard" \ CXX=g++ \ CFLAGS="$OPT -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DI_REALLY_DONT_CARE_HOW_UNSAFE_THIS_IS -DUSE_MIDI_ALSA -DCOGMTVM=0" \ - LIBS="-lpthread -luuid -lasound" \ + LIBS="-lpthread -luuid -lasound -Wl,-rpath,'\$\$ORIGIN'" \ LDFLAGS=-Wl,-z,now rm -f vm/sqUnixMain.o # nuke version info rm -rf ../../../products/$INSTALLDIR diff --git a/build.linux32ARMv7/mkNamedPrims.sh b/build.linux32ARMv7/mkNamedPrims.sh deleted file mode 100755 index 7c707b88f..000000000 --- a/build.linux32ARMv7/mkNamedPrims.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -e -# Generate a sqNamedPrims.h file from plugins.int. The plugins.int used should -# be the one and only argument. -if [ $# != 1 -o ! -f "$1" ]; then - echo usage $0 plugins.int ">sqNamedPrims.h" 1>&2 - exit 1 -fi -echo "/* Automatically generated on "`date`" */" -echo "extern sqExport vm_exports[];"; -echo "extern sqExport os_exports[];"; -for p in `grep -v '^#' "$1" | sed 's/INTERNAL_PLUGINS = //' | tr -d '\\\\\\012'` -do - echo "extern sqExport "$p"_exports[];" -done -echo -echo "sqExport *pluginExports[] = {" -echo " vm_exports," -echo " os_exports," -for p in `grep -v '^#' "$1" | sed 's/INTERNAL_PLUGINS = //' | tr -d '\\\\\\012'` -do - echo " "$p"_exports," -done -echo " NULL" -echo "};" diff --git a/build.linux32x86/editpharoinstall.sh b/build.linux32x86/editpharoinstall.sh index b52485655..2000be28f 100755 --- a/build.linux32x86/editpharoinstall.sh +++ b/build.linux32x86/editpharoinstall.sh @@ -15,11 +15,11 @@ SOURCE=../../sources/$SourceFile.sources test -f $SOURCE || SOURCE=../../../sources/$SourceFile.sources if [ -f squeak ]; then mv squeak pharo - sed -i.bak 's/squeak/pharo/g' pharo + sed -i 's/squeak/pharo/g' pharo fi if [ -f bin/squeak ]; then mv bin/squeak bin/pharo - sed -i.bak 's/squeak/pharo/g' bin/pharo + sed -i 's/squeak/pharo/g' bin/pharo fi rm -rf man doc LIBDIR="`echo lib/squeak/[0-9.-]*`" diff --git a/build.linux32x86/mkNamedPrims.sh b/build.linux32x86/mkNamedPrims.sh deleted file mode 100755 index 7c707b88f..000000000 --- a/build.linux32x86/mkNamedPrims.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -e -# Generate a sqNamedPrims.h file from plugins.int. The plugins.int used should -# be the one and only argument. -if [ $# != 1 -o ! -f "$1" ]; then - echo usage $0 plugins.int ">sqNamedPrims.h" 1>&2 - exit 1 -fi -echo "/* Automatically generated on "`date`" */" -echo "extern sqExport vm_exports[];"; -echo "extern sqExport os_exports[];"; -for p in `grep -v '^#' "$1" | sed 's/INTERNAL_PLUGINS = //' | tr -d '\\\\\\012'` -do - echo "extern sqExport "$p"_exports[];" -done -echo -echo "sqExport *pluginExports[] = {" -echo " vm_exports," -echo " os_exports," -for p in `grep -v '^#' "$1" | sed 's/INTERNAL_PLUGINS = //' | tr -d '\\\\\\012'` -do - echo " "$p"_exports," -done -echo " NULL" -echo "};" diff --git a/build.linux32x86/pharo.cog.spur/build.assert.itimerheartbeat/mvm b/build.linux32x86/pharo.cog.spur/build.assert.itimerheartbeat/mvm index d9248abc4..e27ab917c 100755 --- a/build.linux32x86/pharo.cog.spur/build.assert.itimerheartbeat/mvm +++ b/build.linux32x86/pharo.cog.spur/build.assert.itimerheartbeat/mvm @@ -28,7 +28,7 @@ test -f config.h || ../../../platforms/unix/config/configure --without-npsqueak CC="gcc -m32" \ CXX="g++ -m32" \ CFLAGS="$OPT -msse2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DCOGMTVM=0 -DITIMER_HEARTBEAT=1" \ - LIBS="-lpthread -luuid" \ + LIBS="-lpthread -luuid -Wl,-rpath,'\$\$ORIGIN' " \ LDFLAGS=-Wl,-z,now rm -f vm/sqUnixMain.o # nuke version info rm -rf ../../../products/$INSTALLDIR diff --git a/build.linux32x86/pharo.cog.spur/build.assert/mvm b/build.linux32x86/pharo.cog.spur/build.assert/mvm index 470002509..9fb92dbfd 100755 --- a/build.linux32x86/pharo.cog.spur/build.assert/mvm +++ b/build.linux32x86/pharo.cog.spur/build.assert/mvm @@ -30,7 +30,7 @@ test -f config.h || ../../../platforms/unix/config/configure \ CC="gcc -m32" \ CXX="g++ -m32" \ CFLAGS="$OPT -msse2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DCOGMTVM=0" \ - LIBS="-lpthread -luuid" \ + LIBS="-lpthread -luuid -Wl,-rpath,'\$\$ORIGIN' " \ LDFLAGS=-Wl,-z,now rm -f vm/sqUnixMain.o # nuke version info rm -rf ../../../products/$INSTALLDIR diff --git a/build.linux32x86/pharo.cog.spur/build.debug.itimerheartbeat/mvm b/build.linux32x86/pharo.cog.spur/build.debug.itimerheartbeat/mvm index 6c828ca1a..382457c99 100755 --- a/build.linux32x86/pharo.cog.spur/build.debug.itimerheartbeat/mvm +++ b/build.linux32x86/pharo.cog.spur/build.debug.itimerheartbeat/mvm @@ -28,7 +28,7 @@ test -f config.h || ../../../platforms/unix/config/configure --without-npsqueak CC="gcc -m32" \ CXX="g++ -m32" \ CFLAGS="$OPT -msse2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DCOGMTVM=0 -DITIMER_HEARTBEAT=1" \ - LIBS="-lpthread -luuid" \ + LIBS="-lpthread -luuid -Wl,-rpath,'\$\$ORIGIN' " \ LDFLAGS=-Wl,-z,now rm -f vm/sqUnixMain.o # nuke version info rm -rf ../../../products/$INSTALLDIR diff --git a/build.linux32x86/pharo.cog.spur/build.debug/mvm b/build.linux32x86/pharo.cog.spur/build.debug/mvm index 126991edc..a17107b1f 100755 --- a/build.linux32x86/pharo.cog.spur/build.debug/mvm +++ b/build.linux32x86/pharo.cog.spur/build.debug/mvm @@ -30,7 +30,7 @@ test -f config.h || ../../../platforms/unix/config/configure \ CC="gcc -m32" \ CXX="g++ -m32" \ CFLAGS="$OPT -msse2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DCOGMTVM=0" \ - LIBS="-lpthread -luuid" \ + LIBS="-lpthread -luuid -Wl,-rpath,'\$\$ORIGIN' " \ LDFLAGS=-Wl,-z,now rm -f vm/sqUnixMain.o # nuke version info rm -rf ../../../products/$INSTALLDIR diff --git a/build.linux32x86/pharo.cog.spur/build.itimerheartbeat/mvm b/build.linux32x86/pharo.cog.spur/build.itimerheartbeat/mvm index 5de7fa0c8..7776819e2 100755 --- a/build.linux32x86/pharo.cog.spur/build.itimerheartbeat/mvm +++ b/build.linux32x86/pharo.cog.spur/build.itimerheartbeat/mvm @@ -9,7 +9,7 @@ i*86) ;; # we're good fi ;; esac -THIRDPARTYLIBS="libsdl2 libssh2 libgit2" +THIRDPARTYLIBS="libsdl2 openssl libssh2 libgit2" INSTALLDIR=phcogspurlinux # Some gcc versions create a broken VM using -O2 @@ -45,7 +45,7 @@ test -f config.h || ../../../platforms/unix/config/configure --without-npsqueak CC="gcc -m32" \ CXX="g++ -m32" \ CFLAGS="$OPT -msse2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DCOGMTVM=0 -DITIMER_HEARTBEAT=1" \ - LIBS="-lpthread -luuid" \ + LIBS="-lpthread -luuid -Wl,-rpath,'\$\$ORIGIN' " \ LDFLAGS=-Wl,-z,now rm -f vm/sqUnixMain.o # nuke version info rm -rf ../../../products/$INSTALLDIR diff --git a/build.linux32x86/pharo.cog.spur/build/mvm b/build.linux32x86/pharo.cog.spur/build/mvm index 415982e4b..7db3be18f 100755 --- a/build.linux32x86/pharo.cog.spur/build/mvm +++ b/build.linux32x86/pharo.cog.spur/build/mvm @@ -1,6 +1,6 @@ #!/bin/bash -e # PharoVM with VM profiler and threaded heartbeat -THIRDPARTYLIBS="libsdl2 libssh2 libgit2" +THIRDPARTYLIBS="libsdl2 openssl libssh2 libgit2" case "`uname -m`" in # ensure we see x86 as machine type i*86) ;; # we're good @@ -47,7 +47,7 @@ test -f config.h || ../../../platforms/unix/config/configure \ CC="gcc -m32" \ CXX="g++ -m32" \ CFLAGS="$OPT -msse2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DCOGMTVM=0" \ - LIBS="-lpthread -luuid" \ + LIBS="-lpthread -luuid -Wl,-rpath,'\$\$ORIGIN' " \ LDFLAGS=-Wl,-z,now rm -f vm/sqUnixMain.o # nuke version info rm -rf ../../../products/$INSTALLDIR diff --git a/build.linux32x86/third-party/Makefile.libgit2 b/build.linux32x86/third-party/Makefile.libgit2 index 84c35baa3..530d199ba 100644 --- a/build.linux32x86/third-party/Makefile.libgit2 +++ b/build.linux32x86/third-party/Makefile.libgit2 @@ -22,6 +22,8 @@ $(LIBGIT2ARCHIVE): # NOTE: I'm adding this ugly hack of "sed..." because CMake does not find properly libssl and libcrypto # on 64bits envirenments (it always find the 64bits version, regardless the architecture). # this is ugly, but the only way I fond :( +# NOTE: We also need to edit the RPATH as CMAKE likes (because it ignores the -Wl line), that's why we +# need to add special flags as you can see here: https://cmake.org/Wiki/CMake_RPATH_handling $(THIRDPARTYLIBDIR)/$(LIBGIT2LIBNAME): $(LIBGIT2ARCHIVE) tar x -f $(LIBGIT2ARCHIVE) -C $(THIRDPARTYDIR) cd $(LIBGIT2DIR) \ @@ -31,11 +33,13 @@ $(THIRDPARTYLIBDIR)/$(LIBGIT2LIBNAME): $(LIBGIT2ARCHIVE) -DBUILD_CLAR=OFF \ -DCMAKE_C_FLAGS="-m32" \ -DOPENSSL_FOUND=ON \ + -DOPENSSL_INCLUDE_DIRS=$(THIRDPARTYINCLUDEDIR) \ + -DOPENSSL_LIBRARY_DIRS=$(THIRDPARTYLIBDIR) \ + -DOPENSSL_LIBRARIES=$(THIRDPARTYLIBDIR)/libssl.so \ -DLIBSSH2_FOUND=ON \ -DLIBSSH2_INCLUDE_DIRS=$(THIRDPARTYINCLUDEDIR) \ -DLIBSSH2_LIBRARY_DIRS=$(THIRDPARTYLIBDIR) \ -DLIBSSH2_LIBRARIES=$(THIRDPARTYLIBDIR)/libssh2.so.1.0.1 \ - -DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath=$(THIRDPARTYLIBDIR) \ && sed -i.bak 's/x86_64-linux-gnu/i386-linux-gnu/g' CMakeCache.txt \ && make \ && make install diff --git a/build.linux32x86/third-party/Makefile.libssh2 b/build.linux32x86/third-party/Makefile.libssh2 index e8c1556af..de0ad3599 100644 --- a/build.linux32x86/third-party/Makefile.libssh2 +++ b/build.linux32x86/third-party/Makefile.libssh2 @@ -24,8 +24,10 @@ $(THIRDPARTYLIBDIR)/$(LIBSSH2LIBNAME): $(LIBSSH2ARCHIVE) cd $(LIBSSH2DIR) \ && ./configure \ --prefix='$(THIRDPARTYOUTDIR)' \ - CFLAGS='-m32' \ - LDFLAGS='-m32' \ + --with-openssl \ + --with-libssl-prefix=$(THIRDPARTYLIBDIR) \ + CFLAGS='-m32 -L$(THIRDPARTYLIBDIR)' \ + LDFLAGS='-m32 -L$(THIRDPARTYLIBDIR)' \ && make \ && make install diff --git a/build.linux32x86/third-party/Makefile.openssl b/build.linux32x86/third-party/Makefile.openssl new file mode 100644 index 000000000..e80077bdc --- /dev/null +++ b/build.linux32x86/third-party/Makefile.openssl @@ -0,0 +1,48 @@ +ifndef THIRDPARTYDIR + include Makefile.lib.extra +endif +include ../../third-party/openssl.spec + +# plugin definitions +OPENSSLURL:=$(openssl_spec_download_url) +OPENSSLLIBNAME:=$(openssl_spec_product1_name_linux) +OPENSSLALLLIBNAMES:=$(openssl_spec_product2_name_linux) $(OPENSSLLIBNAME) +OPENSSLDIR:=$(THIRDPARTYDIR)/$(openssl_spec_unpack_dir_name) +OPENSSLARCHIVE:=$(THIRDPARTYCACHEDIR)/$(openssl_spec_archive_name) +OPENSSLLIB:=$(THIRDPARTYINSTALLDIR)/$(OPENSSLLIBNAME) +OPENSSLSYMLINKS:=$(openssl_spec_symlinks_linux) + +# ensure third-party library is built and recognised by plugins +INCDIRS:=$(INCDIRS) $(THIRDPARTYINCLUDEDIR) +EXTRALIBS:=$(EXTRALIBS) $(OPENSSLLIB) +PLUGINREQS:=$(THIRDPARTYLIBS) + +$(OPENSSLARCHIVE): + curl -o $(OPENSSLARCHIVE) -L $(OPENSSLURL) + +$(THIRDPARTYLIBDIR)/$(OPENSSLLIBNAME): $(OPENSSLARCHIVE) + tar x -f $(OPENSSLARCHIVE) -C $(THIRDPARTYDIR) + cd $(OPENSSLDIR) \ + && setarch i386 ./config -m32 --prefix='$(THIRDPARTYOUTDIR)' shared \ + && make install + +# Assuming building libssl will also build libcrypto +$(OPENSSLLIB): $(THIRDPARTYLIBDIR)/$(OPENSSLLIBNAME) + +openssl: $(OPENSSLLIB) + +install: + @for each in $(OPENSSLALLLIBNAMES); do \ + cp -f $(THIRDPARTYLIBDIR)/$$each $(THIRDPARTYINSTALLDIR); \ + done + @echo "Installing links" + @for each in $(THIRDPARTYLIBDIR)/$(OPENSSLSYMLINKS); do \ + if [ -L $$each ]; then \ + cp -a $$each $(THIRDPARTYINSTALLDIR); \ + fi \ + done + +all: $(THIRDPARTYOUTDIR) $(THIRDPARTYINSTALLDIR) $(THIRDPARTYCACHEDIR) openssl + +clean: + rm -Rf $(OPENSSLDIR) diff --git a/build.linux64x64/editpharoinstall.sh b/build.linux64x64/editpharoinstall.sh index b52485655..2000be28f 100755 --- a/build.linux64x64/editpharoinstall.sh +++ b/build.linux64x64/editpharoinstall.sh @@ -15,11 +15,11 @@ SOURCE=../../sources/$SourceFile.sources test -f $SOURCE || SOURCE=../../../sources/$SourceFile.sources if [ -f squeak ]; then mv squeak pharo - sed -i.bak 's/squeak/pharo/g' pharo + sed -i 's/squeak/pharo/g' pharo fi if [ -f bin/squeak ]; then mv bin/squeak bin/pharo - sed -i.bak 's/squeak/pharo/g' bin/pharo + sed -i 's/squeak/pharo/g' bin/pharo fi rm -rf man doc LIBDIR="`echo lib/squeak/[0-9.-]*`" diff --git a/build.linux64x64/mkNamedPrims.sh b/build.linux64x64/mkNamedPrims.sh deleted file mode 100755 index 13aa354a1..000000000 --- a/build.linux64x64/mkNamedPrims.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# Generate a sqNamedPrims.h file from plugins.int. The plugins.int used should -# be the one and only argument. -if [ $# != 1 -o ! -f "$1" ]; then - echo usage $0 plugins.int ">sqNamedPrims.h" 1>&2 - exit 1 -fi -echo "/* Automatically generated on "`date`" */" -echo "extern sqExport vm_exports[];"; -echo "extern sqExport os_exports[];"; -for p in `grep -v '^#' "$1" | sed 's/INTERNAL_PLUGINS = //' | tr -d '\\\\\\012'` -do - echo "extern sqExport "$p"_exports[];" -done -echo -echo "sqExport *pluginExports[] = {" -echo " vm_exports," -echo " os_exports," -for p in `grep -v '^#' "$1" | sed 's/INTERNAL_PLUGINS = //' | tr -d '\\\\\\012'` -do - echo " "$p"_exports," -done -echo " NULL" -echo "};" diff --git a/build.linux64x64/pharo.cog.spur/build.assert.itimerheartbeat/mvm b/build.linux64x64/pharo.cog.spur/build.assert.itimerheartbeat/mvm index 2455344a5..ee5fa4ec3 100755 --- a/build.linux64x64/pharo.cog.spur/build.assert.itimerheartbeat/mvm +++ b/build.linux64x64/pharo.cog.spur/build.assert.itimerheartbeat/mvm @@ -22,7 +22,7 @@ test -f config.h || ../../../platforms/unix/config/configure \ CC="gcc -m64" \ CXX="g++ -m64" \ CFLAGS="$OPT -msse2 -D_GNU_SOURCE -DCOGMTVM=0 -DITIMER_HEARTBEAT=1" \ - LIBS="-lpthread -luuid" \ + LIBS="-lpthread -luuid -Wl,-rpath,'\$\$ORIGIN' " \ LDFLAGS=-Wl,-z,now rm -f vm/sqUnixMain.o # nuke version info rm -rf ../../../products/$INSTALLDIR diff --git a/build.linux64x64/pharo.cog.spur/build.assert/mvm b/build.linux64x64/pharo.cog.spur/build.assert/mvm index 9c7551288..275d30281 100755 --- a/build.linux64x64/pharo.cog.spur/build.assert/mvm +++ b/build.linux64x64/pharo.cog.spur/build.assert/mvm @@ -22,7 +22,7 @@ test -f config.h || ../../../platforms/unix/config/configure \ CC="gcc -m64" \ CXX="g++ -m64" \ CFLAGS="$OPT -msse2 -D_GNU_SOURCE -DCOGMTVM=0" \ - LIBS="-lpthread -luuid" \ + LIBS="-lpthread -luuid -Wl,-rpath,'\$\$ORIGIN' " \ LDFLAGS=-Wl,-z,now rm -f vm/sqUnixMain.o # nuke version info rm -rf ../../../products/$INSTALLDIR diff --git a/build.linux64x64/pharo.cog.spur/build.debug.itimerheartbeat/mvm b/build.linux64x64/pharo.cog.spur/build.debug.itimerheartbeat/mvm index 5fd1f5035..541a12894 100755 --- a/build.linux64x64/pharo.cog.spur/build.debug.itimerheartbeat/mvm +++ b/build.linux64x64/pharo.cog.spur/build.debug.itimerheartbeat/mvm @@ -22,7 +22,7 @@ test -f config.h || ../../../platforms/unix/config/configure \ CC="gcc -m64" \ CXX="g++ -m64" \ CFLAGS="$OPT -msse2 -D_GNU_SOURCE -DCOGMTVM=0 -DITIMER_HEARTBEAT=1" \ - LIBS="-lpthread -luuid" \ + LIBS="-lpthread -luuid -Wl,-rpath,'\$\$ORIGIN' " \ LDFLAGS=-Wl,-z,now rm -f vm/sqUnixMain.o # nuke version info rm -rf ../../../products/$INSTALLDIR diff --git a/build.linux64x64/pharo.cog.spur/build.debug/mvm b/build.linux64x64/pharo.cog.spur/build.debug/mvm index fa06855e2..3b1f12771 100755 --- a/build.linux64x64/pharo.cog.spur/build.debug/mvm +++ b/build.linux64x64/pharo.cog.spur/build.debug/mvm @@ -22,7 +22,7 @@ test -f config.h || ../../../platforms/unix/config/configure \ CC="gcc -m64" \ CXX="g++ -m64" \ CFLAGS="$OPT -msse2 -D_GNU_SOURCE -DCOGMTVM=0" \ - LIBS="-lpthread -luuid" \ + LIBS="-lpthread -luuid -Wl,-rpath,'\$\$ORIGIN' " \ LDFLAGS=-Wl,-z,now rm -f vm/sqUnixMain.o # nuke version info rm -rf ../../../products/$INSTALLDIR diff --git a/build.linux64x64/pharo.cog.spur/build.itimerheartbeat/mvm b/build.linux64x64/pharo.cog.spur/build.itimerheartbeat/mvm index fb33ff153..0e3b98ea3 100755 --- a/build.linux64x64/pharo.cog.spur/build.itimerheartbeat/mvm +++ b/build.linux64x64/pharo.cog.spur/build.itimerheartbeat/mvm @@ -1,6 +1,6 @@ #!/bin/bash -e # PharoVM with VM profiler and itimer heartbeat -THIRDPARTYLIBS="libsdl2 libssh2 libgit2" +THIRDPARTYLIBS="libsdl2 openssl libssh2 libgit2" INSTALLDIR=cogspur64linux # Some gcc versions create a broken VM using -O2 case `gcc -v 2>&1 | grep version | sed 's/gcc version *//'` in @@ -36,7 +36,7 @@ test -f config.h || ../../../platforms/unix/config/configure \ CC="gcc -m64" \ CXX="g++ -m64" \ CFLAGS="$OPT -msse2 -D_GNU_SOURCE -DCOGMTVM=0 -DITIMER_HEARTBEAT=1" \ - LIBS="-lpthread -luuid" \ + LIBS="-lpthread -luuid -Wl,-rpath,'\$\$ORIGIN' " \ LDFLAGS=-Wl,-z,now rm -f vm/sqUnixMain.o # nuke version info rm -rf ../../../products/$INSTALLDIR diff --git a/build.linux64x64/pharo.cog.spur/build/mvm b/build.linux64x64/pharo.cog.spur/build/mvm index 207e4a880..81aa710f5 100755 --- a/build.linux64x64/pharo.cog.spur/build/mvm +++ b/build.linux64x64/pharo.cog.spur/build/mvm @@ -1,6 +1,6 @@ #!/bin/bash -ex # PharoVM with VM profiler and threaded heartbeat -THIRDPARTYLIBS="libsdl2 libssh2 libgit2" +THIRDPARTYLIBS="libsdl2 openssl libssh2 libgit2" INSTALLDIR=cogspur64linuxht # Some gcc versions create a broken VM using -O2 @@ -37,7 +37,7 @@ test -f config.h || ../../../platforms/unix/config/configure \ CC="gcc -m64" \ CXX="g++ -m64" \ CFLAGS="$OPT -msse2 -D_GNU_SOURCE -DCOGMTVM=0" \ - LIBS="-lpthread -luuid" \ + LIBS="-lpthread -luuid -Wl,-rpath,'\$\$ORIGIN' " \ LDFLAGS=-Wl,-z,now rm -f vm/sqUnixMain.o # nuke version info rm -rf ../../../products/$INSTALLDIR diff --git a/build.linux64x64/third-party/Makefile.openssl b/build.linux64x64/third-party/Makefile.openssl new file mode 100644 index 000000000..e7a83a5bf --- /dev/null +++ b/build.linux64x64/third-party/Makefile.openssl @@ -0,0 +1,48 @@ +ifndef THIRDPARTYDIR + include Makefile.lib.extra +endif +include ../../third-party/openssl.spec + +# plugin definitions +OPENSSLURL:=$(openssl_spec_download_url) +OPENSSLLIBNAME:=$(openssl_spec_product1_name_linux) +OPENSSLALLLIBNAMES:=$(openssl_spec_product2_name_linux) $(OPENSSLLIBNAME) +OPENSSLDIR:=$(THIRDPARTYDIR)/$(openssl_spec_unpack_dir_name) +OPENSSLARCHIVE:=$(THIRDPARTYCACHEDIR)/$(openssl_spec_archive_name) +OPENSSLLIB:=$(THIRDPARTYINSTALLDIR)/$(OPENSSLLIBNAME) +OPENSSLSYMLINKS:=$(openssl_spec_symlinks_linux) + +# ensure third-party library is built and recognised by plugins +INCDIRS:=$(INCDIRS) $(THIRDPARTYINCLUDEDIR) +EXTRALIBS:=$(EXTRALIBS) $(OPENSSLLIB) +PLUGINREQS:=$(THIRDPARTYLIBS) + +$(OPENSSLARCHIVE): + curl -o $(OPENSSLARCHIVE) -L $(OPENSSLURL) + +$(THIRDPARTYLIBDIR)/$(OPENSSLLIBNAME): $(OPENSSLARCHIVE) + tar x -f $(OPENSSLARCHIVE) -C $(THIRDPARTYDIR) + cd $(OPENSSLDIR) \ + && ./Configure linux-generic32 --prefix='$(THIRDPARTYOUTDIR)' shared \ + && make install + +# Assuming building libssl will also build libcrypto +$(OPENSSLLIB): $(THIRDPARTYLIBDIR)/$(OPENSSLLIBNAME) + +openssl: $(OPENSSLLIB) + +install: + @for each in $(OPENSSLALLLIBNAMES); do \ + cp -f $(THIRDPARTYLIBDIR)/$$each $(THIRDPARTYINSTALLDIR); \ + done + @echo "Installing links" + @for each in $(THIRDPARTYLIBDIR)/$(OPENSSLSYMLINKS); do \ + if [ -L $$each ]; then \ + cp -a $$each $(THIRDPARTYINSTALLDIR); \ + fi \ + done + +all: $(THIRDPARTYOUTDIR) $(THIRDPARTYINSTALLDIR) $(THIRDPARTYCACHEDIR) openssl + +clean: + rm -Rf $(OPENSSLDIR) diff --git a/platforms/iOS/vm/OSX/SqueakOSXAppDelegate.m b/platforms/iOS/vm/OSX/SqueakOSXAppDelegate.m index a45b3e6bb..0005916cd 100644 --- a/platforms/iOS/vm/OSX/SqueakOSXAppDelegate.m +++ b/platforms/iOS/vm/OSX/SqueakOSXAppDelegate.m @@ -84,11 +84,21 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { [self.squeakApplication setupEventQueue]; [self singleThreadStart]; // [self workerThreadStart]; - } - + +#ifdef PharoVM + [[NSUserNotificationCenter defaultUserNotificationCenter] setDelegate:self]; +#endif } +#ifdef PharoVM +- (BOOL)userNotificationCenter:(NSUserNotificationCenter *)center + shouldPresentNotification:(NSUserNotification *)notification +{ + return YES; +} +#endif + - (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender { return NO; } diff --git a/platforms/unix/plugins/SecurityPlugin/sqUnixSecurity.c b/platforms/unix/plugins/SecurityPlugin/sqUnixSecurity.c index 5d9771cdf..d067142df 100644 --- a/platforms/unix/plugins/SecurityPlugin/sqUnixSecurity.c +++ b/platforms/unix/plugins/SecurityPlugin/sqUnixSecurity.c @@ -32,7 +32,7 @@ static char* fromSqueak(char* string, int len) /* environment security *******************************************************/ static int allowEnvironmentAccess = 1; /* full access to C environment */ -sqInt ioDisableEnvironmentAccess(void) { return return allowEnvironmentAccess = 0; } +sqInt ioDisableEnvironmentAccess(void) { return allowEnvironmentAccess = 0; } sqInt ioHasEnvironmentAccess(void) { return allowEnvironmentAccess; } /* file security ***********************************************************/ @@ -132,7 +132,7 @@ sqInt ioCanSetFileTypeOfSize(char* pathString, sqInt pathStringLength) /* disabling/querying */ -sqInt ioDisableFileAccess(void) { return return allowFileAccess = 0; } +sqInt ioDisableFileAccess(void) { return allowFileAccess = 0; } sqInt ioHasFileAccess(void) { return allowFileAccess; } diff --git a/platforms/unix/vm/Makefile.in b/platforms/unix/vm/Makefile.in index 0fbfff091..a94637cd6 100644 --- a/platforms/unix/vm/Makefile.in +++ b/platforms/unix/vm/Makefile.in @@ -65,7 +65,7 @@ $(TARGET) : $(OBJS) Makefile $(RANLIB) $(TARGET) $(blddir)/sqNamedPrims.h: $(vmmcfg)/plugins.int - $(blddir)/../../mkNamedPrims.sh $(vmmcfg)/plugins.int >$(blddir)/sqNamedPrims.h + $(topdir)/mkNamedPrims.sh $(vmmcfg)/plugins.int >$(blddir)/sqNamedPrims.h # rebuild sqNamedPrims.o if sqNamedPrims.h changes diff --git a/platforms/unix/vm/sqUnixHeartbeat.c b/platforms/unix/vm/sqUnixHeartbeat.c index b65d28832..4ac1d2797 100644 --- a/platforms/unix/vm/sqUnixHeartbeat.c +++ b/platforms/unix/vm/sqUnixHeartbeat.c @@ -313,8 +313,22 @@ beatStateMachine(void *careLess) extern char *revisionAsString(); errno = er; perror("pthread_setschedparam failed"); - fprintf(stderr, - "Read e.g. https://github.com/OpenSmalltalk/opensmalltalk-vm/releases/tag/r3732#linux\n"); +#if PharoVM +# define VMNAME "pharo" +#elif NewspeakVM +# define VMNAME "nsvm" +#else +# define VMNAME "squeak" +#endif + fprintf(stderr, "This VM uses a thread heartbeat who requires a special configuration to work.\n"); + fprintf(stderr, "You need to allow it to run higher priority threads (real time), to allow clock to work properly\n"); + fprintf(stderr, "You need to add a conf file to /etc/security/limits.d, executing this:\n\n"); + fprintf(stderr, "sudo cat >/etc/security/limits.d/%s.conf <