Historical EuphoriaAndRaspberryPi, Revision 1

The following is an introduction to building Euphoria (and other software) for your Raspberry Pi. The steps used here should work for other ARM devices as well, including the Nokia N900, B&N Nook Color, etc. This wiki page will not detail how to get started using your Pi, since there are already some excellent tutorials out there. Check out the official Raspberry Pi wiki at http://elinux.org/RPi_Hub and also the forums at http://www.raspberrypi.org/phpBB3/index.php for some good guides. I will try to give explicit details and examples for all aspects concerning Euphoria.


Thanks,
Ira


Getting Started


To get started, we first need to choose a specific distribution to use on the Pi since they have some key differences. This tutorial is based on the Raspbian distribution, since it is currently the officially recommended distribution. Other options include Debian Wheezy, Arch Linux, Fedora, QTonPi, and several more; a complete list is given here. Whichever your preference, it is important to note if the distribution uses the hard-float (-mfloat-abi=hard) or soft (-mfloat-abi=soft) ABI (Application Binary Interface). The hard-float distributions take advantage of the FPU hardware on the Pi for floating point calculations, making software that use extensive floating point calculations significantly faster. Soft float distributions perform these calculations in software, as the name implies. There is also the soft-fp (-mfloat-abi=softfp) convention, which uses FPU hardware but remains compatible with the soft ABI. A decent explanation is given here and here.

Now the easiest way to get Euphoria is to take pre-built binaries which are targeted for your distribution choice, either hard or soft. Currently, soft-float compatible Euphoria binaries are available here. Hard float may be available in the future (will check with Admins). It is recommended to not mix the binaries (things will usually just break), but the exception is that some soft-float binaries may work fine on a hard-float distribution if the binaries are self-contained and do not depend on any external libraries. I have not done extensive testing, but it appears that the current soft-float version of Euphoria works on Raspbian for most of the demos.

Cross-compiling Euphoria


Before we set up our cross-compiler, now would be a good time to mention how to check binaries for either hard, soft, or soft-fp using the readelf command:

readelf -a A_Soft_Program 
Attribute Section: aeabi 
File Attributes 
  Tag_CPU_name: "6" 
  Tag_CPU_arch: v6 
  Tag_ARM_ISA_use: Yes 
  Tag_THUMB_ISA_use: Thumb-1 
  Tag_ABI_PCS_wchar_t: 4 
  Tag_ABI_FP_denormal: Needed 
  Tag_ABI_FP_exceptions: Needed 
  Tag_ABI_FP_number_model: IEEE 754 
  Tag_ABI_align_needed: 8-byte 
  Tag_ABI_align_preserved: 8-byte, except leaf SP 
  Tag_ABI_enum_size: int 
  Tag_CPU_unaligned_access: v6 
  Tag_DIV_use: Not allowed 
readelf -A A_SoftFP_Program 
Attribute Section: aeabi 
File Attributes 
  Tag_CPU_name: "6" 
  Tag_CPU_arch: v6 
  Tag_ARM_ISA_use: Yes 
  Tag_THUMB_ISA_use: Thumb-1 
  Tag_FP_arch: VFPv2 
  Tag_ABI_PCS_wchar_t: 4 
  Tag_ABI_FP_denormal: Needed 
  Tag_ABI_FP_exceptions: Needed 
  Tag_ABI_FP_number_model: IEEE 754 
  Tag_ABI_align_needed: 8-byte 
  Tag_ABI_align_preserved: 8-byte, except leaf SP 
  Tag_ABI_enum_size: int 
  Tag_ABI_HardFP_use: SP and DP 
  Tag_CPU_unaligned_access: v6 
  Tag_DIV_use: Not allowed 
readelf -A A_Hard_Program 
Attribute Section: aeabi 
File Attributes 
  Tag_CPU_name: "6" 
  Tag_CPU_arch: v6 
  Tag_ARM_ISA_use: Yes 
  Tag_THUMB_ISA_use: Thumb-1 
  Tag_FP_arch: VFPv2 
  Tag_ABI_PCS_wchar_t: 4 
  Tag_ABI_FP_denormal: Needed 
  Tag_ABI_FP_exceptions: Needed 
  Tag_ABI_FP_number_model: IEEE 754 
  Tag_ABI_align_needed: 8-byte 
  Tag_ABI_align_preserved: 8-byte, except leaf SP 
  Tag_ABI_enum_size: int 
  Tag_ABI_HardFP_use: SP and DP 
  Tag_ABI_VFP_args: VFP registers 
  Tag_CPU_unaligned_access: v6 
  Tag_DIV_use: Not allowed 

The important lines are the "Tag_ABI_HardFP_use" and "Tag_ABI_VFP_args" which denote -mfloat-abi=soft-fp and -mfloat-abi=hard, respectively.

To be continued...

Search



Quick Links

User menu

Not signed in.

Misc Menu