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

Caddy compilation on ARM-based Mac fails at link references (libkvmplat) #1360

Open
d8vjork opened this issue Mar 16, 2024 · 1 comment
Open
Labels
kind/bug Something isn't working

Comments

@d8vjork
Copy link

d8vjork commented Mar 16, 2024

Describe the bug

image

Steps to reproduce

Copy files from the following place and follow the instructions:

https://github.com/unikraft/catalog/tree/main/library/caddy/2.7#building-from-source

Then you'll have this error on a ARM-based Macbook Pro, even using its native arch (arm64)

Expected behavior

To build the image successfully

Which architectures were you using or does this bug affect?

x86_64, arm64

Which platforms were you using or does this bug affect?

kvm

Relevant log output

[+] updating index... done!                                                                                                                                                 [2.8s]
[+] building rootfs... done!                                                                                                                                        x86_64 [54.5s]
 W  /opt/homebrew/opt/x86_64-elf-binutils/bin/x86_64-elf-ld: /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/build/libkvmplat.o: in function `asm_trap_ove
 W  /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/x86/cpu_vectors_x86_64.S:166:(.text+0xa166): undefined reference to `do_overflow'   
 W  /opt/homebrew/opt/x86_64-elf-binutils/bin/x86_64-elf-ld: /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/build/libkvmplat.o: in function `asm_trap_bou
 W  /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/x86/cpu_vectors_x86_64.S:167:(.text+0xa1b5): undefined reference to `do_bounds'     
 W  /opt/homebrew/opt/x86_64-elf-binutils/bin/x86_64-elf-ld: /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/build/libkvmplat.o: in function `asm_trap_inv
 W  /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/x86/cpu_vectors_x86_64.S:168:(.text+0xa204): undefined reference to `do_invalid_op' 
 W  /opt/homebrew/opt/x86_64-elf-binutils/bin/x86_64-elf-ld: /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/build/libkvmplat.o: in function `asm_trap_no_
 W  /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/x86/cpu_vectors_x86_64.S:169:(.text+0xa253): undefined reference to `do_no_device'  
 W  /opt/homebrew/opt/x86_64-elf-binutils/bin/x86_64-elf-ld: /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/build/libkvmplat.o: in function `asm_trap_dou
 W  /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/x86/cpu_vectors_x86_64.S:170:(.text+0xa2a0): undefined reference to `do_double_fault
 W  /opt/homebrew/opt/x86_64-elf-binutils/bin/x86_64-elf-ld: /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/build/libkvmplat.o: in function `asm_trap_inv
 W  /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/x86/cpu_vectors_x86_64.S:171:(.text+0xa2ed): undefined reference to `do_invalid_tss'
 W  /opt/homebrew/opt/x86_64-elf-binutils/bin/x86_64-elf-ld: /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/build/libkvmplat.o: in function `asm_trap_no_
 W  /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/x86/cpu_vectors_x86_64.S:172:(.text+0xa33a): undefined reference to `do_no_segment' 
 W  /opt/homebrew/opt/x86_64-elf-binutils/bin/x86_64-elf-ld: /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/build/libkvmplat.o: in function `asm_trap_sta
 W  /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/x86/cpu_vectors_x86_64.S:173:(.text+0xa387): undefined reference to `do_stack_error'
 W  /opt/homebrew/opt/x86_64-elf-binutils/bin/x86_64-elf-ld: /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/build/libkvmplat.o: in function `asm_trap_gp_
 W  /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/x86/cpu_vectors_x86_64.S:174:(.text+0xa3d4): undefined reference to `do_gp_fault'   
 W  /opt/homebrew/opt/x86_64-elf-binutils/bin/x86_64-elf-ld: /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/build/libkvmplat.o: in function `asm_trap_pag
 W  /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/x86/cpu_vectors_x86_64.S:175:(.text+0xa421): undefined reference to `do_page_fault' 
 W  /opt/homebrew/opt/x86_64-elf-binutils/bin/x86_64-elf-ld: /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/build/libkvmplat.o: in function `asm_trap_cop
 W  /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/x86/cpu_vectors_x86_64.S:176:(.text+0xa470): undefined reference to `do_coproc_error
 W  /opt/homebrew/opt/x86_64-elf-binutils/bin/x86_64-elf-ld: /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/build/libkvmplat.o: in function `asm_trap_ali
 W  /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/x86/cpu_vectors_x86_64.S:177:(.text+0xa4bd): undefined reference to `do_alignment_ch
 W  /opt/homebrew/opt/x86_64-elf-binutils/bin/x86_64-elf-ld: /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/build/libkvmplat.o: in function `asm_trap_mac
 W  /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/x86/cpu_vectors_x86_64.S:178:(.text+0xa50c): undefined reference to `do_machine_chec
 W  /opt/homebrew/opt/x86_64-elf-binutils/bin/x86_64-elf-ld: /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/build/libkvmplat.o: in function `asm_trap_sim
 W  /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/x86/cpu_vectors_x86_64.S:179:(.text+0xa55b): undefined reference to `do_simd_error' 
 W  /opt/homebrew/opt/x86_64-elf-binutils/bin/x86_64-elf-ld: /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/build/libkvmplat.o: in function `asm_trap_vir
 W  /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/x86/cpu_vectors_x86_64.S:180:(.text+0xa5aa): undefined reference to `do_virt_error' 
 W  /opt/homebrew/opt/x86_64-elf-binutils/bin/x86_64-elf-ld: /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/build/libkvmplat.o: in function `cpu_irq_0': 
 W  /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/x86/cpu_vectors_x86_64.S:184:(.text+0xa5f8): undefined reference to `uk_intctlr_xpic
 W  /opt/homebrew/opt/x86_64-elf-binutils/bin/x86_64-elf-ld: /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/build/libkvmplat.o: in function `cpu_irq_1': 
 W  /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/x86/cpu_vectors_x86_64.S:184:(.text+0xa646): undefined reference to `uk_intctlr_xpic
 W  /opt/homebrew/opt/x86_64-elf-binutils/bin/x86_64-elf-ld: /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/build/libkvmplat.o: in function `cpu_irq_2': 
 W  /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/x86/cpu_vectors_x86_64.S:184:(.text+0xa694): undefined reference to `uk_intctlr_xpic
 W  /opt/homebrew/opt/x86_64-elf-binutils/bin/x86_64-elf-ld: /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/build/libkvmplat.o: in function `cpu_irq_3': 
 W  /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/x86/cpu_vectors_x86_64.S:184:(.text+0xa6e2): undefined reference to `uk_intctlr_xpic
 W  /opt/homebrew/opt/x86_64-elf-binutils/bin/x86_64-elf-ld: /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/build/libkvmplat.o: in function `cpu_irq_4': 
 W  /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/x86/cpu_vectors_x86_64.S:184:(.text+0xa730): undefined reference to `uk_intctlr_xpic
 W  /opt/homebrew/opt/x86_64-elf-binutils/bin/x86_64-elf-ld: /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/build/libkvmplat.o:/Users/d8vjork/Projects/Te
 W  /opt/homebrew/opt/x86_64-elf-binutils/bin/x86_64-elf-ld: /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/build/libkvmplat.o: in function `lcpu_start64
 W  /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/x86/lcpu_start.S:314:(.text.boot.64+0x18): undefined reference to `lcpus'           
 W  /opt/homebrew/opt/x86_64-elf-binutils/bin/x86_64-elf-ld: /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/build/libkvmplat.o: in function `lcpu_boot_st
 W  multiboot.x86.o:(.rodata+0x0): undefined reference to `multiboot_entry'                                                                                                       
 W  collect2: error: ld returned 1 exit status                                                                                                                                    
 W  gmake[1]: *** [/Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/Linker.uk:54: /Users/d8vjork/Projects/Testing/unikia-testpilot/testin
 W  gmake: *** [Makefile:1170: sub-make] Error 2                                                                                                                                  
                                                                                                                                                                                  
 E  could not complete build: build failed: exit status 2
@d8vjork d8vjork added the kind/bug Something isn't working label Mar 16, 2024
@d8vjork
Copy link
Author

d8vjork commented Mar 16, 2024

Building on its own native platform (using qemu/arm64) does output a different error tho:

[+] updating index... done!                                                                                                                                                 [2.7s]
[+] building rootfs... done!                                                                                                                                         arm64 [28.5s]
 W  /opt/homebrew/opt/aarch64-elf-binutils/bin/aarch64-elf-ld: /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/build/libkvmplat.o: in function `_libkvmpla
 W  /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/arm/entry64.S:137:(.text+0x1e8): undefined reference to `ukplat_bootinfo_fdt_setup' 
 W  /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/arm/entry64.S:137:(.text+0x1e8): relocation truncated to fit: R_AARCH64_CALL26 again
 W  /opt/homebrew/opt/aarch64-elf-binutils/bin/aarch64-elf-ld: /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/arm/entry64.S:139:(.text+
 W  /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/arm/entry64.S:139:(.text+0x1ec): relocation truncated to fit: R_AARCH64_CALL26 again
 W  /opt/homebrew/opt/aarch64-elf-binutils/bin/aarch64-elf-ld: /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/arm/entry64.S:140:(.text+
 W  /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/arm/entry64.S:140:(.text+0x1f0): relocation truncated to fit: R_AARCH64_JUMP26 again
 W  /opt/homebrew/opt/aarch64-elf-binutils/bin/aarch64-elf-ld: /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/build/libkvmplat.o: in function `el1_sync':
 W  /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/arm/exceptions.S:215:(.text+0x8f0): undefined reference to `trap_el1_sync'          
 W  /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/arm/exceptions.S:215:(.text+0x8f0): relocation truncated to fit: R_AARCH64_CALL26 ag
 W  /opt/homebrew/opt/aarch64-elf-binutils/bin/aarch64-elf-ld: /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/build/libkvmplat.o: in function `el1_irq': 
 W  /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/arm/exceptions.S:223:(.text+0xa34): undefined reference to `trap_el1_irq'           
 W  /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/arm/exceptions.S:223:(.text+0xa34): relocation truncated to fit: R_AARCH64_CALL26 ag
 W  /opt/homebrew/opt/aarch64-elf-binutils/bin/aarch64-elf-ld: /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/build/libkvmplat.o: in function `el1_sync_i
 W  /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/arm/exceptions.S:243:(.text+0xb78): undefined reference to `invalid_trap_handler'   
 W  /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/arm/exceptions.S:243:(.text+0xb78): relocation truncated to fit: R_AARCH64_JUMP26 ag
 W  /opt/homebrew/opt/aarch64-elf-binutils/bin/aarch64-elf-ld: /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/build/libkvmplat.o: in function `el0_sync_i
 W  /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/arm/exceptions.S:244:(.text+0xc38): undefined reference to `invalid_trap_handler'   
 W  /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/arm/exceptions.S:244:(.text+0xc38): relocation truncated to fit: R_AARCH64_JUMP26 ag
 W  /opt/homebrew/opt/aarch64-elf-binutils/bin/aarch64-elf-ld: /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/build/libkvmplat.o: in function `el1_irq_in
 W  /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/arm/exceptions.S:245:(.text+0xcf8): undefined reference to `invalid_trap_handler'   
 W  /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/arm/exceptions.S:245:(.text+0xcf8): relocation truncated to fit: R_AARCH64_JUMP26 ag
 W  /opt/homebrew/opt/aarch64-elf-binutils/bin/aarch64-elf-ld: /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/build/libkvmplat.o: in function `el0_irq_in
 W  /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/arm/exceptions.S:246:(.text+0xdb8): undefined reference to `invalid_trap_handler'   
 W  /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/arm/exceptions.S:246:(.text+0xdb8): relocation truncated to fit: R_AARCH64_JUMP26 ag
 i    LD      caddy_qemu-arm64.dbg                                                                                                                                                
 W  /opt/homebrew/opt/aarch64-elf-binutils/bin/aarch64-elf-ld: /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/build/libkvmplat.o: in function `el1_fiq_in
 W  /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/arm/exceptions.S:247:(.text+0xe78): undefined reference to `invalid_trap_handler'   
 W  /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/arm/exceptions.S:247:(.text+0xe78): relocation truncated to fit: R_AARCH64_JUMP26 ag
 W  /opt/homebrew/opt/aarch64-elf-binutils/bin/aarch64-elf-ld: /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/build/libkvmplat.o:/Users/d8vjork/Projects/
 W  /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/build/libkvmplat.o: in function `el0_fiq_invalid':                                                    
 W  /Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/arm/exceptions.S:248:(.text+0xf38): additional relocation overflows omitted from the
 W  collect2: error: ld returned 1 exit status                                                                                                                                    
 W  gmake[1]: *** [/Users/d8vjork/Projects/Testing/unikia-testpilot/testing_base/.unikraft/unikraft/plat/kvm/Linker.uk:54: /Users/d8vjork/Projects/Testing/unikia-testpilot/testin
 W  gmake: *** [Makefile:1170: sub-make] Error 2                                                                                                                                  
                                                                                                                                                                                  
 E  could not complete build: build failed: exit status 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant