From 0d3933f9e473c594dd792532fc5806a34aa8c583 Mon Sep 17 00:00:00 2001 From: John Moon Date: Tue, 29 Aug 2023 10:39:29 -0700 Subject: [PATCH] ANDROID: build: Switch to hermetic tools for DTC build Currently, the DTC build will use host tools for lex and bison runs. With the hermetic_genrule from Kleaf, it's easy to use the hermetic tools instead which obviates the need for lex and bison on the host. Switch to hermetic_genrule. Change-Id: Ib505cf3833c8ecec275c50f9c44ff74efe39b649 Signed-off-by: John Moon --- BUILD.dtc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/BUILD.dtc b/BUILD.dtc index 6c50a3001ade..ee5fbe812ef6 100644 --- a/BUILD.dtc +++ b/BUILD.dtc @@ -1,3 +1,5 @@ +load("@//build/kernel/kleaf:hermetic_tools.bzl", "hermetic_genrule") + cc_library( name = "libfdt", copts = [ @@ -22,14 +24,14 @@ copts = [ "-Wno-unused-parameter", ] -genrule( +hermetic_genrule( name = "lexer", srcs = ["dtc-lexer.l"], outs = ["dtc-lexer.lex.c"], - cmd = "lex -o$@ $(location dtc-lexer.l)" + cmd = "flex -o$@ $(location dtc-lexer.l)" ) -genrule( +hermetic_genrule( name = "parser", srcs = ["dtc-parser.y"], outs = ["dtc-parser.tab.c", "dtc-parser.tab.h"],