[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.

Welcome to the Slackware Documentation Project

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
howtos:hardware:arm:gcc-9.x_aarch64_cross-compiler [2019/07/25 19:32 (UTC)] – [Downloading required source and configuration] added tip exagahowtos:hardware:arm:gcc-9.x_aarch64_cross-compiler [2019/08/03 12:38 (UTC)] – [Building the arm64 kernel, modules, and device tree blob (DTB)] rewording exaga
Line 3: Line 3:
 === Preface === === Preface ===
  
-With the recent congruous updates to [[http://arm.slackware.com|Slackware ARM]] [~24 June 2019 - "A MILLION THANKS to MoZes!"] and the surprise arrival of the Raspberry Pi 4, this just had to be done. Creating a gcc-9.1.0 armv8 arm64 aarch64 cross-compiler with the intention of building aarch64-linux binaries from source code and turning them into Slackware packages. +With the recent congruous updates to [[http://arm.slackware.com|Slackware ARM]] [~24 June 2019 - "A MILLION THANKS to MoZes!"] and the surprise arrival of the Raspberry Pi 4, this just had to be done. Creating a 64-bit gcc-9.1.0 arm64 aarch64 cross-compiler with the intention of building aarch64-linux binaries from source code and turning them into Slackware packages. 
  
-Previous [[howtos:hardware:arm:gcc_aarch64_cross-compiler|work in this area]] had already been done in 2016/2017. However, this time we'll be compiling with gcc-9.1.0 and not gcc-5.4.0 and we'll be using a Raspberry Pi 4 Model B and not a Mk3 version. The old build scripts weren't totally useless and some of the code was reused for this project, to save time.+Previous [[howtos:hardware:arm:gcc_aarch64_cross-compiler|work in this area]] had already been done since 2016/2017. However, this time we'll be compiling with gcc-9.1.0 and not gcc-5.4.0 and we'll be using a Raspberry Pi 4 Model B and not a Mk3 version. The old build scripts weren't totally useless and some of the code was reused for this project, to save time.
  
 === Notes === === Notes ===
Line 61: Line 61:
 When that's done you should see a message that 'origin/rpi-5.2.y' is the current branch. When that's done you should see a message that 'origin/rpi-5.2.y' is the current branch.
  
-<note tip>You can select which kernel source you would like to build instead of rpi-5.2.y branch. Just substitute it in the 'git checkout -f rpi-5.2.y' command for your chosen branch. To see a list of available branches use this command:+<note tip>You can select which kernel source you would like to build instead of rpi-5.2.y branch. Just substitute it in the 'git checkout -f rpi-5.2.y' command for your chosen branch. To see a list of available branches use this command while in your Linux source directory:
  
 <code> <code>
Line 325: Line 325:
 </code> </code>
  
-<note important>Make a note here of the CFLAGS which have been specified. They should be self-explanatory by now. Pay special attention to the trailing '-' of 'CROSS_COMPILE=aarch64-linux-' because that's **NOT** a typo. __It needs to be like that!__</note>+<note important>Make a note here of the build options [ARCH=arm64 CROSS_COMPILE=aarch64-linux-] which have been specified. They should be self-explanatory by now. Pay special attention to the trailing '-' of 'CROSS_COMPILE=aarch64-linux-' because that's **NOT** a typo. __It needs to be like that!__</note>
  
 Now that you've created a kernel .config which contains the default settings for your hardware, some settings within need to be checked and possibly modified. The Raspberry Pi 4's "VideoCore VI" GPU is not //64-bit compatible// and the build process will crash each time you attempt to compile the module's source code for ARMv8 architecture. Now that you've created a kernel .config which contains the default settings for your hardware, some settings within need to be checked and possibly modified. The Raspberry Pi 4's "VideoCore VI" GPU is not //64-bit compatible// and the build process will crash each time you attempt to compile the module's source code for ARMv8 architecture.
Line 406: Line 406:
 === Installing the arm64 modules === === Installing the arm64 modules ===
  
-Once the modules have been built, you have to 'make modules_install' The process will install your kernel modules to '/tmp/lib/modules/5.2.1-v8-aarch64'+Once the modules have been built, you have to 'make modules_install' The process will install your kernel modules to '/lib/modules/5.2.1-v8-aarch64'
  
 You could build  //out-of-tree// kernel modules but, to keep things simple, you're going to install them to the usual location. Again, you will use the same CFLAGS as before but without any 'LOCALVERSION' set. You could build  //out-of-tree// kernel modules but, to keep things simple, you're going to install them to the usual location. Again, you will use the same CFLAGS as before but without any 'LOCALVERSION' set.
Line 492: Line 492:
 <code> <code>
 ls -lah rpi-boot/boot/kernel* ls -lah rpi-boot/boot/kernel*
-ls -lah rpi-boot/boot/bcm*-rpi-3-b.dtb +ls -lah rpi-boot/boot/bcm*-rpi-4-b.dtb 
 ls -lah rpi-root/lib/modules/5.2.1-v8* ls -lah rpi-root/lib/modules/5.2.1-v8*
 </code> </code>
Line 552: Line 552:
  
 ====== Sources ====== ====== Sources ======
-# If you need to install any of the packages above [* check for updates!]:+# If you need to install any of the software above [* check for updates!]:
  
 [[ftp://ftp.arm.slackware.com/slackwarearm/slackwarearm-current/slackware/a/gawk-5.0.1-arm-1.txz]]  # Slackware ARM current - gawk package. \\ [[ftp://ftp.arm.slackware.com/slackwarearm/slackwarearm-current/slackware/a/gawk-5.0.1-arm-1.txz]]  # Slackware ARM current - gawk package. \\
Line 566: Line 566:
 [[slackwarearm:faq|http://arm.slackware.com/FAQs]] # Slackware ARM Linux Project Frequently Asked Questions. \\  [[slackwarearm:faq|http://arm.slackware.com/FAQs]] # Slackware ARM Linux Project Frequently Asked Questions. \\ 
 [[http://wiki.osdev.org/GCC_Cross-Compiler]] # gcc cross-compiler documentation. \\  [[http://wiki.osdev.org/GCC_Cross-Compiler]] # gcc cross-compiler documentation. \\ 
 +[[howtos:hardware:arm:gcc_aarch64_cross-compiler|Slackware ARM GCC aarch64-linux cross-compiler]] for the Raspberry Pi. \\
 [[https://www.raspberrypi.org/documentation/linux/kernel]] # Raspberry Pi Linux kernel documentation. \\  [[https://www.raspberrypi.org/documentation/linux/kernel]] # Raspberry Pi Linux kernel documentation. \\ 
  
Line 578: Line 579:
 <!-- You must remove the tag-word "template" below before saving your new page --> <!-- You must remove the tag-word "template" below before saving your new page -->
 {{tag>howtos slackware raspberry pi arm aarch64 arm64 armv8 cross-compile author_exaga}} {{tag>howtos slackware raspberry pi arm aarch64 arm64 armv8 cross-compile author_exaga}}
 +
  
 howtos:hardware:arm:gcc-9.x_aarch64_cross-compiler ()