---
extends: base

variables:
  asflags: [ "-I${source_root}/src/kernel/" ]

  ccflags: [
    "--target=x86_64-jsix-elf",
    "-fno-omit-frame-pointer",
    "-fno-stack-protector",

    "-g3",
    "-ggdb",

    "-fno-plt",
    "-fvisibility=hidden",
    "-fvisibility-inlines-hidden",

    "-D__ELF__",
    "-D__jsix__",
    "-U__linux",
    "-U__linux__",

    "-isystem${source_root}/sysroot/include",
    "-isystem${build_root}/include/libc",
    "--sysroot='${source_root}/sysroot'" ]


  cxxflags: [
    "-fno-exceptions",
    "-fno-rtti",
    "-isystem${source_root}/sysroot/include/c++/v1" ]

  ldflags: [
    "-g",
    "-m", "elf_x86_64",
    "-Bstatic",
    "--sysroot='${source_root}/sysroot'",
    "--no-eh-frame-hdr",
    "-L", "${source_root}/sysroot/lib",
    "-z", "separate-code",
    "-lc++", "-lc++abi", "-lunwind",
    "--no-dependent-libraries",
  ]

