Skip to content

Be able to build from aarch64 #10

@brandonros

Description

@brandonros
$ cargo build
   Compiling macros v0.1.0 (/Users/brandon/Desktop/maestro/macros)
   Compiling maestro v0.1.0 (/Users/brandon/Desktop/maestro)
error: failed to run custom build command for `maestro v0.1.0 (/Users/brandon/Desktop/maestro)`

Caused by:
  process didn't exit successfully: `/Users/brandon/.cargo/target/debug/build/maestro-7fa53f85575e3aad/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-changed=config.toml

  --- stderr
  Configuration file not found

  Please make sure the configuration file at `config.toml` exists`
  An example configuration file can be found in `default.config.toml`
MacBook-Air:maestro brandon 2024-01-07 11:54:32 $ 

Kind of a confusing error because there is a .cargo/config.toml:

 $ ls .cargo/config.toml
.cargo/config.toml

but I'm guessing it expects something different

Doing this:

$ cp default.config.toml config.toml
$ cargo build

gets me further. not sure if this could be documented somewhere more clear

but then I get a whole bunch of weird cc/clang errors:

warning: src/boot/remap.s:44:6: error: malformed expression
warning: unexpected token in operand mov $0x088888, %esisrc/util/libc/memset.s
warning:  : 22unexpected token in operand:2
warning: :  or $1, %alerror: 
warning: invalid instruction, did you mean: b? 
warning:     mov $(0xc0000000 + boot_stack_begin), %esp 
warning:       
warning:   shl %cl, %ebx  src/memory/vmem/paging.s :   jbe 1f 
warning:  45 : 2^
warning:  : error: invalid instruction
warning:  ret
warning:   ^   
warning:  ^
warning:  src/util/libc/memset.s:24:   src/boot/gdt.s :673  :   error: :  ^

It's probably because I'm on aarch64 and it's trying to use $CC without realizing it needs to "cross-compile" I guess?

  exit status: 1
  cargo:warning=ToolExecError: Command "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-g" "-fno-omit-frame-pointer" "-m32" "-Wall" "-Wextra" "-nostdlib" "-ffreestanding" "-fno-stack-protector" "-mno-red-zone" "-Wall" "-Wextra" "-Tarch/x86/linker.ld" "-o" "/Users/brandon/.cargo/target/x86/debug/build/maestro-5b5a8234f3b77c53/out/src/idt/idt.o" "-c" "src/idt/idt.s" with args "cc" did not execute successfully (status code exit status: 1).
  exit status: 1
  cargo:warning=ToolExecError: Command "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-g" "-fno-omit-frame-pointer" "-m32" "-Wall" "-Wextra" "-nostdlib" "-ffreestanding" "-fno-stack-protector" "-mno-red-zone" "-Wall" "-Wextra" "-Tarch/x86/linker.ld" "-o" "/Users/brandon/.cargo/target/x86/debug/build/maestro-5b5a8234f3b77c53/out/src/idt/syscall.o" "-c" "src/idt/syscall.s" with args "cc" did not execute successfully (status code exit status: 1).
  exit status: 1
  cargo:warning=ToolExecError: Command "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-g" "-fno-omit-frame-pointer" "-m32" "-Wall" "-Wextra" "-nostdlib" "-ffreestanding" "-fno-stack-protector" "-mno-red-zone" "-Wall" "-Wextra" "-Tarch/x86/linker.ld" "-o" "/Users/brandon/.cargo/target/x86/debug/build/maestro-5b5a8234f3b77c53/out/src/kernel.o" "-c" "src/kernel.s" with args "cc" did not execute successfully (status code exit status: 1).
  exit status: 1
  cargo:warning=ToolExecError: Command "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-g" "-fno-omit-frame-pointer" "-m32" "-Wall" "-Wextra" "-nostdlib" "-ffreestanding" "-fno-stack-protector" "-mno-red-zone" "-Wall" "-Wextra" "-Tarch/x86/linker.ld" "-o" "/Users/brandon/.cargo/target/x86/debug/build/maestro-5b5a8234f3b77c53/out/src/process/regs/context_switch.o" "-c" "src/process/regs/context_switch.s" with args "cc" did not execute successfully (status code exit status: 1).
  exit status: 0

  --- stderr


  error occurred: Command "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-g" "-fno-omit-frame-pointer" "-m32" "-Wall" "-Wextra" "-nostdlib" "-ffreestanding" "-fno-stack-protector" "-mno-red-zone" "-Wall" "-Wextra" "-Tarch/x86/linker.ld" "-o" "/Users/brandon/.cargo/target/x86/debug/build/maestro-5b5a8234f3b77c53/out/src/process/regs/context_switch.o" "-c" "src/process/regs/context_switch.s" with args "cc" did not execute successfully (status code exit status: 1).

Not sure if the build.rs script or whatever can detect it needs to find x86/x86_64 compiler if one isn't available natively. I would have guessed changing the build target in .cargo/config.toml was enough

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions