Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Differences between Power and PowerPC assembler: how to implement Darwin PPC? #131

Open
barracuda156 opened this issue Apr 6, 2022 · 5 comments

Comments

@barracuda156
Copy link

Does anyone have an experience with PPC assembler of Apple Darwin? I want to build v8 for 10.5.8 and 10.6 for ppc arch.
Any advice will be greatly appreciated.

@kapouer
Copy link

kapouer commented Apr 6, 2022

FYI node 16 builds on ppc64 here meaning that at least v8 does build on the archs supported here: https://wiki.debian.org/PPC64.
EDIT: or a subset of them... machines used for builds are typically not the oldest ones.

@barracuda156
Copy link
Author

FYI node 16 builds on ppc64 here meaning that at least v8 does build on the archs supported here: https://wiki.debian.org/PPC64.
EDIT: or a subset of them... machines used for builds are typically not the oldest ones.

@kapouer Thank you for replying. Yes, I am aware that on Linux (and FreeBSD) PPC pretty much everything builds. Unfortunately, it does not automatically translate into support of Darwin PPC. Say, while the latest gcc builds on powerpc-apple-darwin, clang does not, and llvm remains half-broken due to ABI incompatibility.

@barracuda156
Copy link
Author

Trying to build now. At the moment it fails on a bunch of static asserts:

:info:build ../deps/v8/src/execution/isolate-data.h:224:70: error: static assertion failed: offsetof(IsolateData, virtual_call_target_register_) == kVirtualCallTargetRegisterOffset
:info:build   224 |   STATIC_ASSERT(offsetof(IsolateData, virtual_call_target_register_) ==
:info:build       |                                                                      ^
:info:build ../deps/v8/src/base/macros.h:199:43: note: in definition of macro 'STATIC_ASSERT'
:info:build   199 | #define STATIC_ASSERT(test) static_assert(test, #test)
:info:build       |                                           ^~~~
:info:build ../deps/v8/src/execution/isolate-data.h:224:70: note: the comparison reduces to '(18764 == 18760)'
:info:build   224 |   STATIC_ASSERT(offsetof(IsolateData, virtual_call_target_register_) ==
:info:build       |                                                                      ^
:info:build ../deps/v8/src/base/macros.h:199:43: note: in definition of macro 'STATIC_ASSERT'
:info:build   199 | #define STATIC_ASSERT(test) static_assert(test, #test)
:info:build       |                                           ^~~~
:info:build ../deps/v8/src/execution/isolate-data.h:232:63: error: static assertion failed: offsetof(IsolateData, fast_c_call_caller_fp_) == kFastCCallCallerFPOffset
:info:build   232 |   STATIC_ASSERT(offsetof(IsolateData, fast_c_call_caller_fp_) ==
:info:build       |                                                               ^
:info:build ../deps/v8/src/base/macros.h:199:43: note: in definition of macro 'STATIC_ASSERT'
:info:build   199 | #define STATIC_ASSERT(test) static_assert(test, #test)
:info:build       |                                           ^~~~
:info:build ../deps/v8/src/execution/isolate-data.h:232:63: note: the comparison reduces to '(18768 == 18764)'
:info:build   232 |   STATIC_ASSERT(offsetof(IsolateData, fast_c_call_caller_fp_) ==

@kapouer
Copy link

kapouer commented Sep 2, 2022

It's a lost battle, v8 dropped support for big endian ppc. Unless you're actually on a little endian ppc ?

@barracuda156
Copy link
Author

barracuda156 commented Sep 2, 2022

It's a lost battle, v8 dropped support for big endian ppc. Unless you're actually on a little endian ppc ?

@kapouer
There is a branch of nodejs12 with support of AIX and ppc32: nodejs/node#30323 (comment)
It needs additional fixes for Darwin, and this is what I am trying at the moment.

Apparently nodejs16 also has (partial?) support for PPC BE: https://github.com/jhamby/void-packages/tree/master/srcpkgs/nodejs/patches

Some extra support for G4 may be forward-ported from here: https://github.com/andrewlow/v8ppc/tree/g4compat

I mean, we will not get the bleeding edge latest v8 and nodejs, but getting relatively recent versions fixed gonna be good enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants