Bug: https://bugs.gentoo.org/587408
# Make sure the build system will use the right tools, bug #340795.
tc-export AR CC CXX NM
+ # Define a custom toolchain for GN
+ myconf_gn+=" custom_toolchain=\"${FILESDIR}/toolchain:default\""
+
# Tools for building programs to be executed on the build system, bug #410883.
if tc-is-cross-compiler; then
export AR_host=$(tc-getBUILD_AR)
--- /dev/null
+import("//build/toolchain/gcc_toolchain.gni")
+
+gcc_toolchain("default") {
+ cc = getenv("CC")
+ cxx = getenv("CXX")
+ ar = getenv("AR")
+ nm = getenv("NM")
+ ld = cxx
+
+ extra_cflags = getenv("CFLAGS")
+ extra_cppflags = getenv("CPPFLAGS")
+ extra_cxxflags = getenv("CXXFLAGS")
+ extra_ldflags = getenv("LDFLAGS")
+
+ toolchain_args = {
+ current_cpu = current_cpu
+ current_os = current_os
+ }
+}