uland_c_flags = [ "-Werror", "-Wno-address-of-packed-member", ] if (userland_symbols) { uland_c_flags += [ "-ggdb" ] } if (optimize) { uland_c_flags += [ "-Os" ] } uland_cc_flags = [ "-std=c++2a", "-fno-sized-deallocation", "-fno-exceptions", "-D_LIBCXX_BUILD_XOS_EXTENSIONS", ] uland_objcc_flags = uland_cc_flags + [ "-fno-objc-exceptions", "-fno-objc-arc", ] uland_asm_flags = [] uland_ld_flags = [] if (device_type == "desktop") { uland_c_flags += [ "-DTARGET_DESKTOP" ] } if (device_type == "mobile") { uland_c_flags += [ "-DTARGET_MOBILE" ] } if (target_arch == "x86") { uland_asm_flags += [ "-f", "elf", ] } if (target_arch == "x86_64") { uland_asm_flags += [ "-f", "elf64", ] } if (target_arch == "arm32") { uland_c_flags += [ "-fno-builtin", "-march=armv7-a", "-mfpu=neon-vfpv4", "-mfloat-abi=softfp", "-fno-pie", ] uland_asm_flags += [ "-march=armv7-a", "-mfpu=neon-vfpv4", "-mfloat-abi=softfp", "-mcpu=cortex-a15", ] uland_ld_flags += [ "-nostdlib" ] if (host == "gnu") { uland_ld_flags += [ "-nostdinc", "-nodefaultlibs", "-nostartfiles", "-lgcc", ] } if (host == "llvm") { uland_ld_flags += [ "--oformat", "elf32-littlearm", "/usr/lib/llvm-18/lib/clang/18/lib/linux/libclang_rt.builtins-arm.a", ] } } if (target_arch == "arm64") { uland_c_flags += [ "-fno-builtin", "-mcpu=cortex-a53+nocrypto+nocrc", "-fno-pie", ] uland_asm_flags += [ "-mcpu=cortex-a53+nocrypto+nocrc" ] uland_ld_flags += [ "-nostdlib" ] if (host == "gnu") { uland_ld_flags += [ "-nostdinc", "-nodefaultlibs", "-nostartfiles", "-lgcc", ] } if (host == "llvm") { uland_ld_flags += [ "--oformat", "elf64-littlearm", ] } } if (target_arch == "riscv64") { uland_c_flags += [ "-fno-builtin", "-march=rv64ima", "-mabi=lp64", ] uland_asm_flags += [ "-march=rv64ima", "-mabi=lp64", ] uland_ld_flags += [ "-nostdlib" ] if (host == "gnu") { uland_ld_flags += [ "-nostdinc", "-nodefaultlibs", "-nostartfiles", rebase_path("//toolchains/gcc_runtime/10.2.1/riscv64-libgcc.a", root_build_dir), ] } if (host == "llvm") { uland_ld_flags += [ "--oformat", "elf64", rebase_path("//toolchains/gcc_runtime/10.2.1/riscv64-libgcc.a", root_build_dir), ] } }