On Sun, 29 Nov 2020 17:18:14 +0100
Charlene Wendling <julianaito@posteo.jp> wrote:
> I've built and run squeak on macppc and amd64 without issues. '-O3'
> optimisation should be removed, but maybe it has not been removed in
> the past for a reason. The below diff also moves HOMEPAGE to https.
>
> It's OK cwen@, even though if '-O3' should be removed we're better
> off testing again.
I took cwen's diff, deleted -O3 -funroll-loops -mcpu=750, and changed
one patch comment (to "fix build on alpha, powerpc") to make the diff
below. ok gkoehler@ for my diff below, or for cwen's diff if we
decide to keep the flags.
-O3 -funroll-loops -mcpu=750 were only for powerpc (not powerpc64).
My diff and cwen's diff should behave the same on any other arch.
The flags might have been for gcc<=4.2.1 on Mac OS X:
-O3 overrides our -O2
-funroll-loops is the default in clang -O2
-mcpu=750 targets G3, oldest cpu for both Mac OS X and OpenBSD
-mno-fused-add existed in gcc but not in clang
clang -ffp-contract=on enables the fused multiply-add on powerpc (and
maybe arm64), but it is off by default in clang 10.
I built squeak/vm on macppc both with and without the flags (always
without -mno-fused-add), and observed no effect when I started squeak
with squeak/image and evaluated a few integer expressions.
I also want to comment on the mtfsf fix, which affects both powerpc
and powerpc64. "f0" in "mtfsf 0xff, f0" is Apple syntax. We use ELF
syntax, which is either "0" or "%%f0". The asm statement fails to
tell the compiler that f0 is clobbered, but luckily, I see no nearby
C code that might use f0. I would suggest something like,
__asm__ volatile("mtfsf 0xff, %0" : "f"(a_union.its_double));
but this old squeak 3.10.2 isn't worth the effort (current version
is squeak 5.3), so the simple "0" fix is ok with me. --George
Index: Makefile.inc
===================================================================
RCS file: /cvs/ports/lang/squeak/Makefile.inc,v
retrieving revision 1.7
diff -u -p -r1.7 Makefile.inc
--- Makefile.inc 12 Jul 2019 20:47:23 -0000 1.7
+++ Makefile.inc 30 Nov 2020 00:48:23 -0000
@@ -8,7 +8,7 @@ MAINTAINER = Marc Espie <espie@openbsd.o
# Large explanation on http://minnow.cc.gatech.edu/squeak/159
PERMIT_PACKAGE = Yes
-HOMEPAGE = http://squeak.org/
+HOMEPAGE = https://squeak.org/
SQUEAK_SITE= http://ftp.squeak.org/${MAJOR}.${MINOR}/
MAJOR = 3
Index: funsqueak/Makefile
===================================================================
RCS file: /cvs/ports/lang/squeak/funsqueak/Makefile,v
retrieving revision 1.4
diff -u -p -r1.4 Makefile
--- funsqueak/Makefile 26 Mar 2020 19:55:08 -0000 1.4
+++ funsqueak/Makefile 30 Nov 2020 00:48:23 -0000
@@ -7,6 +7,7 @@ PKG_ARCH = *
DISTFILES = FunSqueak3.10alpha.7.zip
DISTNAME = squeak-funsqueak-3.10alpha7
+REVISION= 0
EPOCH = 0
MASTER_SITES = ${SQUEAK_SITE}../various_images/FunSqueak/
RUN_DEPENDS = lang/squeak/vm>=3.10
Index: image/Makefile
===================================================================
RCS file: /cvs/ports/lang/squeak/image/Makefile,v
retrieving revision 1.7
diff -u -p -r1.7 Makefile
--- image/Makefile 17 Nov 2010 08:05:18 -0000 1.7
+++ image/Makefile 30 Nov 2020 00:48:23 -0000
@@ -9,7 +9,7 @@ DOTV = 2
IMAGE_V = 7179
DISTFILES = Squeak$V.${DOTV}-${IMAGE_V}-basic.zip
DISTNAME = squeak-image-$V.${DOTV}.${IMAGE_V}
-REVISION = 0
+REVISION = 1
RUN_DEPENDS = lang/squeak/vm>=3.10
MASTER_SITES = ${SQUEAK_SITE}
EXTRACT_ONLY =
Index: sources/Makefile
===================================================================
RCS file: /cvs/ports/lang/squeak/sources/Makefile,v
retrieving revision 1.5
diff -u -p -r1.5 Makefile
--- sources/Makefile 23 Jul 2008 11:17:22 -0000 1.5
+++ sources/Makefile 30 Nov 2020 00:48:23 -0000
@@ -9,6 +9,7 @@ NO_BUILD = Yes
DISTNAME = squeak-sources-${SOURCEV}
PKG_ARCH = *
MASTER_SITES = ${SQUEAK_SITE}
+REVISION= 0
do-install:
${INSTALL_DATA_DIR} ${SQUEAK_DIR}
Index: vm/Makefile
===================================================================
RCS file: /cvs/ports/lang/squeak/vm/Makefile,v
retrieving revision 1.30
diff -u -p -r1.30 Makefile
--- vm/Makefile 11 Feb 2020 13:44:10 -0000 1.30
+++ vm/Makefile 30 Nov 2020 00:48:23 -0000
@@ -8,7 +8,7 @@ SRCV = 1
DISTFILES = Squeak-$V-${SRCV}.src.tar.gz
PKGNAME = squeak-vm-$V.${SRCV}
-REVISION = 10
+REVISION = 11
WRKDIST = ${WRKDIR}/Squeak-$V-${SRCV}
WRKSRC = ${WRKDIST}/platforms/unix/config
Index: vm/patches/patch-platforms_unix_config_Makefile_in
===================================================================
RCS file: vm/patches/patch-platforms_unix_config_Makefile_in
diff -N vm/patches/patch-platforms_unix_config_Makefile_in
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ vm/patches/patch-platforms_unix_config_Makefile_in 30 Nov 2020 00:48:23 -0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+
+Index: platforms/unix/config/Makefile.in
+--- platforms/unix/config/Makefile.in.orig
++++ platforms/unix/config/Makefile.in
+@@ -43,7 +43,7 @@ all : $(squeak) plugins squeak.1 $(npsqueak)
+ # VM
+
+ $(squeak) : config.sh $(SQLIBS) version.o
+- $(LINK) $(squeak) $(SQLIBS) version.o $(LIBS) [plibs] vm/vm.a
++ $(LINK) $(squeak) vm/vm.a $(SQLIBS) version.o $(LIBS) [plibs]
+ @echo
+ @size $(squeak)
+ @echo
Index: vm/patches/patch-platforms_unix_config_acinclude_m4
===================================================================
RCS file: /cvs/ports/lang/squeak/vm/patches/patch-platforms_unix_config_acinclude_m4,v
retrieving revision 1.1
diff -u -p -r1.1 patch-platforms_unix_config_acinclude_m4
--- vm/patches/patch-platforms_unix_config_acinclude_m4 14 Jan 2020 22:20:29 -0000 1.1
+++ vm/patches/patch-platforms_unix_config_acinclude_m4 30 Nov 2020 00:48:23 -0000
@@ -1,14 +1,25 @@
$OpenBSD: patch-platforms_unix_config_acinclude_m4,v 1.1 2020/01/14 22:20:29 sthen Exp $
-fix build on alpha
+fix build on alpha, powerpc
Index: platforms/unix/config/acinclude.m4
--- platforms/unix/config/acinclude.m4.orig
+++ platforms/unix/config/acinclude.m4
-@@ -255,16 +255,6 @@ fi)
+@@ -114,9 +114,6 @@ if test "$GCC" = yes; then
+ i?86)
+ ac_optflags="-fomit-frame-pointer"
+ ;;
+- powerpc|ppc)
+- ac_optflags="-O3 -funroll-loops -mcpu=750 -mno-fused-madd"
+- ;;
+ esac
+ AC_DEFINE(VM_BUILD_STRING, ["Unix built on "__DATE__ " "__TIME__" Compiler: "__VERSION__])
+ else
+@@ -254,16 +251,6 @@ else ac_cv_module_prefix="lib"
+ fi)
AC_DEFINE_UNQUOTED(VM_MODULE_PREFIX,"$mkfrags_lib_prefix")
test "$ac_cv_module_prefix" = lib && mkfrags_lib_prefix=lib])
-
+-
-AC_DEFUN([AC_64BIT_ARCH],
-[AC_MSG_CHECKING(for compiler flags to force 32-bit addresses)
-case $host in
@@ -18,7 +29,6 @@ Index: platforms/unix/config/acinclude.m
- ;;
-esac
-AC_MSG_RESULT($CFLAGS_32)])
--
- ### plugin support
+ ### plugin support
Index: vm/patches/patch-platforms_unix_plugins_FloatMathPlugin_acinclude_m4
===================================================================
RCS file: vm/patches/patch-platforms_unix_plugins_FloatMathPlugin_acinclude_m4
diff -N vm/patches/patch-platforms_unix_plugins_FloatMathPlugin_acinclude_m4
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ vm/patches/patch-platforms_unix_plugins_FloatMathPlugin_acinclude_m4 30 Nov 2020 00:48:23 -0000
@@ -0,0 +1,15 @@
+$OpenBSD$
+
+Index: platforms/unix/plugins/FloatMathPlugin/acinclude.m4
+--- platforms/unix/plugins/FloatMathPlugin/acinclude.m4.orig
++++ platforms/unix/plugins/FloatMathPlugin/acinclude.m4
+@@ -5,9 +5,6 @@ if test "$GCC" = yes; then
+ i?86)
+ libm_cflags="-O -fomit-frame-pointer"
+ ;;
+- powerpc|ppc)
+- libm_cflags="-O3 -funroll-loops -mcpu=750 -mno-fused-madd"
+- ;;
+ esac
+ fi
+
Index: vm/patches/patch-platforms_unix_vm_sqUnixMain_c
===================================================================
RCS file: /cvs/ports/lang/squeak/vm/patches/patch-platforms_unix_vm_sqUnixMain_c,v
retrieving revision 1.7
diff -u -p -r1.7 patch-platforms_unix_vm_sqUnixMain_c
--- vm/patches/patch-platforms_unix_vm_sqUnixMain_c 14 Jan 2020 22:20:29 -0000 1.7
+++ vm/patches/patch-platforms_unix_vm_sqUnixMain_c 30 Nov 2020 00:48:23 -0000
@@ -25,6 +25,17 @@ Index: platforms/unix/vm/sqUnixMain.c
{ &soundModule, "sound", "custom" }, /*** NO DEFAULT ***/
/* defaults */
{ &displayModule, "display", "Quartz" },
+@@ -1292,8 +1289,8 @@ void imgInit(void)
+ || defined(POWERPC) || defined(__POWERPC) || defined (__POWERPC__) )
+ void mtfsfi(unsigned long long fpscr)
+ {
+- __asm__("lfd f0, %0" :: "m"(fpscr));
+- __asm__("mtfsf 0xff, f0");
++ __asm__("lfd 0, %0" :: "m"(fpscr));
++ __asm__("mtfsf 0xff, 0");
+ }
+ #else
+ # define mtfsfi(fpscr)
@@ -1329,17 +1326,6 @@ int main(int argc, char **argv, char **envp)
outOfMemory();
No comments:
Post a Comment