bamarni / pi64

A 64-bit OS for the Raspberry Pi 3
712 stars 126 forks source link

Cross-compiling apps #20

Open ronaaron opened 7 years ago

ronaaron commented 7 years ago

I'm interested in cross-compiling on my main Linux box. What I need is the appropriate sysroot to use (system-specific headers).

What is the best way to get a set of such headers for cross-compiling?

bamarni commented 7 years ago

Do you mean linux kernel headers? Starting from the latest release (2017-07-31), they should be available in /usr/include (cf. #10).

ronaaron commented 7 years ago
body p { margin-bottom: 0cm; margin-top: 0pt; } 

You mean in the running image?  Because I don't see them in the
  source tar.gz etc...

On 07/31/17 05:38, Bilal Amarni wrote:

  Do you mean linux kernel headers? Starting from the latest
    release (2017-07-31), they should be available in /usr/include
    (cf. #10).
  —
    You are receiving this because you authored the thread.
    Reply to this email directly, view it on GitHub, or mute the thread.

  {"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/bamarni/pi64","title":"bamarni/pi64","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/bamarni/pi64"}},"updates":{"snippets":[{"icon":"PERSON","message":"@bamarni in #20: Do you mean linux kernel headers? Starting from the latest release (2017-07-31), they should be available in /usr/include (cf. #10)."}],"action":{"name":"View Issue","url":"https://github.com/bamarni/pi64/issues/20#issuecomment-318953296"}}}

      Ron Aaron | 
       CTO  Aaron High-Tech, Ltd |
      +1 425.296.0766 / +972 52.652.5543 |

        GnuPG Key: 91F92EB8
farfeduc commented 7 years ago

Maybe you can apply the principles explained here : https://community.arm.com/iot/embedded/b/embedded-blog/posts/cross-compilation-for-arm and https://resin.io/blog/building-arm-containers-on-any-x86-machine-even-dockerhub/ to cross compile programs for aarch64 on x86 machines ?

You can find statically compiled qemu binaries here : https://github.com/multiarch/qemu-user-static

bamarni commented 7 years ago

Yes in the running image, starting from 2017-07-31, or you can just grab them manually form here https://github.com/bamarni/pi64-kernel/releases (there is just the kernel / modules).

However I'm not sure if you need those or just cross compiling standard programs as shown by @farfeduc?