iPXE discussion forum

Full Version: Build issues with ipxe.efi for arm64 architecture
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm trying to build ipxe.efi for arm64 architecture and get some linker errors:

rm -f  bin-arm64-efi/*.*  bin-arm64-efi/.certificate.* bin-arm64-efi/.certificates.* bin-arm64-efi/.private_key.* bin-arm64-efi/errors   bin-arm64-efi/NIC       ./util/zbin ./util/elf2efi32 ./util/elf2efi64 ./util/efirom ./util/efifatbin ./util/iccfix ./util/einfo TAGS bin-arm64-efi/symtab
  [DEPS] arch/arm64/core/setjmp.S
  [DEPS] arch/arm/interface/efi/efiarm_nap.c
  [DEPS] arch/arm64/core/arm64_tcpip.c
  [DEPS] arch/arm64/core/arm64_string.c
  [DEPS] arch/arm64/core/arm64_bigint.c
  [DEPS] config/config_usb.c
  [DEPS] config/config_timer.c
  [DEPS] config/config_route.c
  [BUILD] bin-arm64-efi/qib7322.ids.o
  [BUILD] bin-arm64-efi/ehci.ids.o
  [BUILD] bin-arm64-efi/uhci.ids.o
  [BUILD] bin-arm64-efi/xhci.ids.o
  [HOSTCC] util/elf2efi64
  [VERSION] bin-arm64-efi/version.ipxe.efi.o
  [AR] bin-arm64-efi/blib.a
aarch64-linux-gnu-ar: creating bin-arm64-efi/blib.a
  [LD] bin-arm64-efi/ipxe.efi.tmp
bin-arm64-efi/blib.a(3c509.o): In function `t509_select_tag':
/home/andre/Software/ipxe/src/drivers/net/3c509.c:101: undefined reference to `outb'
bin-arm64-efi/blib.a(3c509.o): In function `t509_wait_for_id_sequence':
/home/andre/Software/ipxe/src/drivers/net/3c509.c:85: undefined reference to `outb'
bin-arm64-efi/blib.a(w89c840.o): In function `w89c840_probe':
/home/andre/Software/ipxe/src/drivers/net/w89c840.c:690: undefined reference to `outl'
aarch64-linux-gnu-ld: bin-arm64-efi/ipxe.efi.tmp: hidden symbol `insw' isn't defined
aarch64-linux-gnu-ld: final link failed: Bad value
make: *** [bin-arm64-efi/ipxe.efi.tmp] Error 1
rm bin-arm64-efi/version.ipxe.efi.o

It seems that there are some header files missing or not included correctly.

I start the build with "make CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64 bin-arm64-efi/ipxe.efi -j8".
My host system is an Ubuntu 14.04 LTS.
ARM builds does not yet support direct I/O or port calls which makes ipxe.efi invalid for ARM builds since it pulls in drivers which needs this.

Instead of ipxe.efi build the it with the specific driver, or combination of them, for example in your case
make CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64 bin-arm64-efi/intel--snp.efi -j8

or whichever driver it is you need
Ok, I understand.

So I would need a special driver for the SoC NIC.
I'm using an X-Gene 1 SoC from Applied Micro, but I think there is no driver in ipxe like it is for the Cavium ThunderX SoC.
Or is the snp-driver sufficent enough?
If there is no specific driver for that nic in ipxe then snp is the only one, or maybe snponly, the best will be to just test if possible, let us know how it turns out.
The build for target bin-arm64-efi/snp.efi was successful and also the initial chainload via the UEFI-Firmware.
So that looks good so far.

iPXE 1.0.0+ (d9886) -- Open Source Network Boot Firmware -- http://ipxe.org
Features: DNS HTTP iSCSI TFTP AoE EFI Menu                                                                                                                                                                        

net0: fc:aa:14:e4:98:38 using SNP on SNP-0x807e894618 (open)                                                                                                                                                      
  [Link:up, TX:0 TXE:0 RX:0 RXE:0]                                                                                                                                                                                
Configuring (net0 fc:aa:14:e4:98:38)..... ok                                                                                                                                                                      
Next server:                                                                                                                                                                                          
Filename: efi/boot/ipxe/snp.efi                                                                                                                                                                                    
tftp:// ok                                                                                                                                                                    
add-symbol-file snp.efi 0x807CB0B2C0                                                                                                                                                                              
remove-symbol-file snp.efi 0x7CB0B2C0                                                                                                                                                                              
snp.efi : 159872 bytes [EFI]                                                                                                                                                                                      
add-symbol-file snp.efi 0x807CB0B2C0                                                                                                                                                                              
iPXE initialising devices...ok

But the USB keyboard isn't working and PS2 is not possible Sad
Happy it works so far..
Have you modified the configuration anything? I see that menu is missing from the features.
iPXE has some usb support, but that takes over from firmware, and by default the EFI input system should be work just fine with iPXE.
If you want to try the iPXE native USB you could build snp--ecm.efi which should pull it in, but really my guess is that you have some configuration change that is causing this issue.

The build for "snp.efi" indeed brings in support for a USB keyboard under an EFI environment, but after some more investigation I found out that instead of CTRL+B you have to press ESC+B to get to the iPXE prompt - weird behaviour.

And after you get to the prompt you can use the keyboard in a normal way. So now I can proceed with my other tests.

Thanks for your help.
Glad it works, and thanks for reporting back!

(2017-03-10 10:39)tiger276 Wrote: [ -> ]instead of CTRL+B you have to press ESC+B to get to the iPXE prompt - weird behaviour.

The explanation to that is this: Your EFI implementation is broken (aka does not support ctrl)
For that reason the esc key was added as a workaround:

Sorry for my incorrect assumption of config issue.
Reference URL's