Upstream provides a DTC_VERSION preprocessor macro to its C code by
generating a version_gen.h header from either of its supported build
systems: Make formats the header from its internal variables (VERSION,
PATCHLEVEL, SUBLEVEL, ...) while Meson uses its vcs_tag() function on
a template, version_gen.h.in.
As AOSP doesn't make use of these build systems, aosp/204511 decided to
hardcode a version_non_gen.h file and patch the corresponding #include.
This unsurprisingly ended up bitrotting as the repo was being upgraded.
Instead, replicate the version_gen.h.in patching in our build systems,
extracting the version number from the METADATA file, which
external_updater.sh will keep up-to-date. Note that this introduces a
dependency on sed in the genrule(), the impact of which is minimized by
making METADATA_version.sed POSIX-compliant.
Keep appending the suffix '-Android-build' to the upstream version.
Test: m dtc && ${ANDROID_HOST_OUT}/bin/dtc --version
Test: bazel build //:dtc && bazel-bin/dtc --version
Change-Id: I6b780c1dbe14d415891defeb652f0692988ed0b1
Simplify the build file as
- dtc_gen creates an unnecessarily broad (and confusing) dependency list
by using glob([".h"]) as its header list. Instead, dtc now lists
explicitly the few headers it actually needs;
- generating dtc-lexer.lex.c does not require dtc-parser.{c,h};
- Bison can be told to directly create dtc-parser.{c,h} so no need for
an unnecessarily broad copying of *.[ch] to move some intermediate
results.
As a result, we get two genrule() wrapping the source files respectively
generated through lex and bison, which can be listed as srcs of dtc.
Test: bazel build //:all
Change-Id: I238d963af8a338c46f39c8ba9e4314fe536948cf
As dtc compiles util.c, which includes util.h and version_non_gen.h
(or version_gen.h upstream), the cc_binary should list those
dependencies explicitly so that a change in them triggers a rebuild.
Furthermore, dtc also depends on dtc.h and srcpos.h, which are only
found as dependencies by Bazel through the overkill glob(["*.h"]) header
list of dtc_gen so list them explicitly here so that that cc_library can
be dropped.
Introduce the UTILS list to DRY the build file.
Test: bazel build //:dtc
Change-Id: I32076c65b60820dc91f6dc84c3ee3cad310c1db5
Build libfdt with the same warnings as the DTC tools. This effectively
starts using -Wno-missing-field-initializers, -Wno-unused-parameter, and
-Wall.
Test: m libfdt
Test: bazel build //:libfdt
Change-Id: I5a2ae1ee86b4613d0aa7a0174d235976d7be45cc
As we use the flag when building libfdt, also enable it for the tools.
Test: m dtc fdtget fdtoverlay
Test: bazel build //:all
Change-Id: I3c0775436bb9be1367e1937e99a6e87d1dce664c
Due to a missing "Merged-In" tag, automerger got confused and AOSP ended
up with "libfdt: fdt_path_offset_namelen: Reject empty paths" being
applied twice:
commit d10c84c4bc
commit a6ac6d916d
so remove the duplicated code.
Test: N/A
Change-Id: I3684b3d6af1be02a96ffa04f98c15297f890cc74
Currently, the dtc project builds with Make.
As some consumers of this project use Bazel, and eventually all of
AOSP will need to move to Bazel anyway, add a a Bazel build
definition.
Bug: 251879933
Change-Id: I62ea59ee306eda58b764df2a9e5f2f33778e4b5c
Signed-off-by: John Moon <quic_johmoo@quicinc.com>
am skip reason: Merged-In I14ab0a074ab994c1f598243d2d5795d2cd9a853a with SHA-1 d10c84c4bc is already in history
Original change: https://android-review.googlesource.com/c/platform/external/dtc/+/2338092
Change-Id: Ia0fef412e1e2a44c261687b8969e66dc4b85b197
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
am skip reason: Merged-In I14ab0a074ab994c1f598243d2d5795d2cd9a853a with SHA-1 d10c84c4bc is already in history
Original change: https://android-review.googlesource.com/c/platform/external/dtc/+/2338092
Change-Id: I51fe1fa75cccd10bf671781bdc7eaf6f96b2b565
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
am skip reason: Merged-In I14ab0a074ab994c1f598243d2d5795d2cd9a853a with SHA-1 d10c84c4bc is already in history
Original change: https://android-review.googlesource.com/c/platform/external/dtc/+/2338092
Change-Id: I7982e0854ec2093c6c45bf20a838fc0df4a30f06
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
am skip reason: Merged-In I14ab0a074ab994c1f598243d2d5795d2cd9a853a with SHA-1 d10c84c4bc is already in history
Original change: https://android-review.googlesource.com/c/platform/external/dtc/+/2338092
Change-Id: I9c649cf7d8231031f8fc7be5b09a8f9834d85a74
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
am skip reason: Merged-In I14ab0a074ab994c1f598243d2d5795d2cd9a853a with SHA-1 d10c84c4bc is already in history
Original change: https://android-review.googlesource.com/c/platform/external/dtc/+/2338092
Change-Id: Idf1afb85fe7dc7c311919754606e85311cdb8b74
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
am skip reason: Merged-In I14ab0a074ab994c1f598243d2d5795d2cd9a853a with SHA-1 d10c84c4bc is already in history
Original change: https://android-review.googlesource.com/c/platform/external/dtc/+/2338092
Change-Id: I914e85afa788c459472db84f2f15227a76a42f0d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
am skip reason: Merged-In I14ab0a074ab994c1f598243d2d5795d2cd9a853a with SHA-1 d10c84c4bc is already in history
Original change: https://android-review.googlesource.com/c/platform/external/dtc/+/2338092
Change-Id: I929b412dc440ae00f823a01c91f92c16666f5332
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
am skip reason: Merged-In I14ab0a074ab994c1f598243d2d5795d2cd9a853a with SHA-1 d10c84c4bc is already in history
Original change: https://android-review.googlesource.com/c/platform/external/dtc/+/2338092
Change-Id: I5afda515c392e7e3364514988e8ccb1d4e0075f9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
am skip reason: Merged-In I200e94ae7c45f0c474c449c3808766932f62d23f with SHA-1 9fb2d8a4f4 is already in history
Original change: https://android-review.googlesource.com/c/platform/external/dtc/+/2294418
Change-Id: Iab93f9aac58a735ffbd99cc7219bb8857fa0ac27
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
am skip reason: Merged-In I200e94ae7c45f0c474c449c3808766932f62d23f with SHA-1 9fb2d8a4f4 is already in history
Original change: https://android-review.googlesource.com/c/platform/external/dtc/+/2294418
Change-Id: Ib66741e72e32412c574d869c713649de4fc885f0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
am skip reason: Merged-In If2ae7bf5758338e71c69067b371e6a0bfe83048f with SHA-1 7992e4aeb9 is already in history
Original change: https://android-review.googlesource.com/c/platform/external/dtc/+/2239917
Change-Id: I9d91743590db68d7b6e010cdfcf011abc4e514b9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
am skip reason: Merged-In If2ae7bf5758338e71c69067b371e6a0bfe83048f with SHA-1 7992e4aeb9 is already in history
Original change: https://android-review.googlesource.com/c/platform/external/dtc/+/2239917
Change-Id: I40b8e46b120fed1ba8bf03cb5976c832c19eb26c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>