[Vm-dev] [OpenSmalltalk/opensmalltalk-vm] POWER (ppc64le) port. (#493)
kgardas
notifications at github.com
Wed Apr 29 09:48:05 UTC 2020
Thanks for the patch and for the hint. I used that and after some more or less horrible hacks I've got to compiling platform specific IA32abi plugin which is a mark that time for ppc64le specific build infrastructure is here. :-) My hacks so far including your advice is:
```
$ cat /tmp/ppc64.diff
diff --git a/platforms/unix/vm/include_ucontext.h b/platforms/unix/vm/include_ucontext.h
index 7dc8d92d0..48d27e6b1 100644
--- a/platforms/unix/vm/include_ucontext.h
+++ b/platforms/unix/vm/include_ucontext.h
@@ -46,6 +46,9 @@
# define _PC_IN_UCONTEXT uc_mcontext.pc
#elif __linux__ && __arm__
# define _PC_IN_UCONTEXT uc_mcontext.arm_pc
+#elif __linux__ && __ppc64__
+/* 33th reg in the gp_regs should be NIP */
+# define _PC_IN_UCONTEXT uc_mcontext.gp_regs[32]
#elif __FreeBSD__ && __i386__
# define _PC_IN_UCONTEXT uc_mcontext.mc_eip
#elif __FreeBSD__ && __amd64__
diff --git a/platforms/unix/vm/sqPlatformSpecific.h b/platforms/unix/vm/sqPlatformSpecific.h
index d760ba24b..2694caa18 100644
--- a/platforms/unix/vm/sqPlatformSpecific.h
+++ b/platforms/unix/vm/sqPlatformSpecific.h
@@ -107,7 +107,7 @@ extern void sqFilenameFromString(char *uxName, sqInt stNameIndex, int sqNameLeng
#if defined(__GNUC__)
# if !defined(VM_LABEL)
-# define VM_LABEL(foo) asm("\n.globl L" #foo "\nL" #foo ":")
+# define VM_LABEL(foo) ((void)0)
# endif
#else
# if HAVE_ALLOCA_H
diff --git a/platforms/unix/vm/sqUnixHeartbeat.c b/platforms/unix/vm/sqUnixHeartbeat.c
index 90d023db5..adb4a0494 100644
--- a/platforms/unix/vm/sqUnixHeartbeat.c
+++ b/platforms/unix/vm/sqUnixHeartbeat.c
@@ -188,6 +188,8 @@ ioHighResClock(void)
/* Tim, not sure I have input beyond:
Is there a 64-bit clock on ARM? If so, access it here :-)
*/
+#elif defined(__ppc64__) && defined(__linux__)
+ /* for now do nothing */
#else
# error "no high res clock defined"
#endif
diff --git a/platforms/unix/vm/sqUnixMain.c b/platforms/unix/vm/sqUnixMain.c
index 2d2196f31..d23c0f0da 100644
--- a/platforms/unix/vm/sqUnixMain.c
+++ b/platforms/unix/vm/sqUnixMain.c
@@ -2007,7 +2007,8 @@ void imgInit(void)
#endif
#if defined(__GNUC__) && ( defined(ppc) || defined(__ppc) || defined(__ppc__) \
- || defined(POWERPC) || defined(__POWERPC) || defined (__POWERPC__) )
+ || defined(POWERPC) || defined(__POWERPC) || defined (__POWERPC__) ) \
+ && !defined(__ppc64__)
void mtfsfi(unsigned long long fpscr)
{
__asm__("lfd f0, %0" :: "m"(fpscr));
```
and the compile failure is:
```
clang -g -O1 -DNDEBUG -DDEBUGVM=0 -msse2 -Wall -Qunused-arguments -pthread -DLSB_FIRST=1 -m64 -Wno-missing-braces -Wno-unknown-pragmas -Wno-unused-value -Wno-unused-label -Wno-unused-function -Wno-unused-variable -DHAVE_CONFIG_H -DSQUEAK_BUILTIN_PLUGIN -I/home/karel/vcs/OpenSmalltalk/opensmalltalk-vm/build.linux64x64/squeak.stack.spur/build -I/home/karel/vcs/OpenSmalltalk/opensmalltalk-vm/build.linux64x64/squeak.stack.spur/build -I/home/karel/vcs/OpenSmalltalk/opensmalltalk-vm/platforms/unix/vm -I/home/karel/vcs/OpenSmalltalk/opensmalltalk-vm/platforms/Cross/vm -I/home/karel/vcs/OpenSmalltalk/opensmalltalk-vm/spurstack64src/vm -I/usr/local/include -I/home/karel/vcs/OpenSmalltalk/opensmalltalk-vm/platforms/Cross/plugins/IA32ABI -m64 -Wno-missing-braces -Wno-unknown-pragmas -Wno-unused-value -Wno-unused-label -Wno-unused-function -Wno-unused-variable -c -o xabicc.o /home/karel/vcs/OpenSmalltalk/opensmalltalk-vm/platforms/Cross/plugins/IA32ABI/xabicc.c
/home/karel/vcs/OpenSmalltalk/opensmalltalk-vm/platforms/Cross/plugins/IA32ABI/xabicc.c:23:2: error: "Unsupported architecture"
#error "Unsupported architecture"
^
1 error generated.
Makefile:193: recipe for target 'xabicc.o' failed
```
--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/493#issuecomment-621098822
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20200429/a436f64f/attachment-0001.html>
More information about the Vm-dev
mailing list