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

Compiling for arm64/aarch64 #932

Closed
sandeep-gh opened this issue Sep 5, 2020 · 13 comments
Closed

Compiling for arm64/aarch64 #932

sandeep-gh opened this issue Sep 5, 2020 · 13 comments
Labels
build ffi Renderer-specific quirks.

Comments

@sandeep-gh
Copy link

I tried compiling this on arm64 but failed here:

; compiling file "/home/ubuntu/common-lisp/nyxt/quicklisp-client/dists/quicklisp/software/cl-cffi-gtk-20200427-git/glib/glib.misc.lisp" (written 05 SEP 2020 08:04:22 PM):
; compiling (IN-PACKAGE :GLIB)
; compiling (COND (# #) ...)Unhandled SIMPLE-ERROR in thread #<SB-THREAD:THREAD "main thread" RUNNING
                                    {1002827E03}>:
  Can not define 'g-size', unknown CPU architecture (known are x86 and x86-64)

Not sure if there is a simple fix.

@aartaka
Copy link
Contributor

aartaka commented Sep 6, 2020

cl-cffi-glib has this cond in its toplevel (it's the one the error comes from):

(eval-when (:compile-toplevel :load-toplevel :execute)
  (cond ((cffi-features:cffi-feature-p :x86-64) (defctype g-size :uint64))
        ((cffi-features:cffi-feature-p :x86)    (defctype g-size :ulong))
        ((cffi-features:cffi-feature-p :ppc32)  (defctype g-size :uint32))
        ((cffi-features:cffi-feature-p :ppc64)  (defctype g-size :uint64))
        (t
         (error "Can not define 'g-size', unknown CPU architecture ~
                (known are x86 and x86-64)"))))

cffi-features have no features related to ARM (the full list of architectures is #:ppc32 #:x86 #:x86-64 #:sparc #:sparc64 #:hppa #:hppa64). It doesn't mean that ARM is impossible to work with, just that there're no CFFI binding for it yet.

We'd need to make something with ARM support in cffi and cl-cffi-glib to even try compiling Nyxt for ARM. It's not impossible though, because GLib seems to be at least compilable for ARM and has ARM Debian package, for example. It's just about writing proper bindings in Lisp :)

@Ambrevar
Copy link
Member

Ambrevar commented Sep 7, 2020 via email

@aartaka
Copy link
Contributor

aartaka commented Jan 2, 2021

@aartaka Any idea if upstream has a discussion about ARM support?
The bug tracker does not seem to have much

I was wondering about that too. It seems ARM support it's not on a tracker :(

@Ambrevar
Copy link
Member

Ambrevar commented Jan 4, 2021 via email

@Ambrevar
Copy link
Member

Ambrevar commented Jan 4, 2021

Answer from Luis:

CFFI contains virtually no architecture-specific code, so there's no need to add ARM support. The cl-cffi-gtk code mention in nyxt issue 932 uses cffi-features which has been deprecated in favor of trivial-features almost 15 years ago. Please use trivial-features instead. However, trivial-features doesn't mention ARM. I'm not familiar with all the ARM variants, but the first step to specify ARM features in trivial-features would be to survey what CL implementations currently push to features on that platform. HTH.

@Ambrevar
Copy link
Member

Ambrevar commented Jul 1, 2022

Update: Trivial-features now supports ARM.

trivial-features/trivial-features#13 (comment)

CL-CFFI-GTK could be updated as per this comment. We could fork it if upstream does not do it.

But we could also switch to cl-gobject-introspection entirely.

@Thovthe
Copy link

Thovthe commented Sep 19, 2022

Would getting a PineBook Pro for one of the core devs maybe lead to some further progress in this area?

@jmercouris
Copy link
Member

Maybe. Our issue is primarily one of time, not hardware. The proposal is however, welcome. Thank you for your consideration!

@aadcg
Copy link
Member

aadcg commented Nov 21, 2022

The issue reported in the original post no longer exists.

@Ambrevar
Copy link
Member

Does Nyxt compile on ARM now?

@aadcg
Copy link
Member

aadcg commented Nov 22, 2022

I was able to load both cl-webkit2 and cl-cffi-gtk and generate all .fas (similar to .fasl in SBCL) and .o files with ECL on an ARM device.

From there, it would be need to be further tested.

@aadcg
Copy link
Member

aadcg commented Jan 9, 2023

Nyxt runs on ARM.

@aadcg aadcg closed this as completed Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build ffi Renderer-specific quirks.
Development

No branches or pull requests

6 participants