aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2025-03-14Use __ASSEMBLER__ instead of __ASSEMBLY__HEADmastermainThomas Huth4-7/+7
Both, Clang and GCC define __ASSEMBLER__ automatically when compiling .S files, so this macro is a much better fit for fdt.h - programs that want to use it from .S files don't have to manually #define __ASSEMBLY__ that way. While we're at it, also change it in testdata.h, then we don't have to define __ASSEMBLY__ in the Makefile / meson.build file anymore. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-ID: <20250313192718.1561683-1-thuth@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2025-03-14Fix some typosThomas Huth11-14/+14
Discovered with the "codespell" utility. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-ID: <20250313191607.1556384-1-thuth@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2025-03-14Remove duplicated words in documentation and commentsThomas Huth3-3/+3
Let's avoid repeating single words here! Signed-off-by: Thomas Huth <thuth@redhat.com> Message-ID: <20250313190527.1556019-1-thuth@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2025-03-13meson: support building libfdt without static libraryBrandon Maier4-29/+9
Some packaging systems like NixOS don't support compiling static libraries. However libfdt's meson.build uses `both_library()` which forces the build to always compile shared and static libraries. Removing `both_library()` will make packaging easier. libfdt uses `both_libraries()` to support the 'static-build' option. But we do not need the 'static-build' option as Meson can natively build static using > meson setup builddir/ -Dc_link_args='-static' --prefer-static --default-library=static So drop 'static-build' and then replace `both_libraries()` with `library()`. Signed-off-by: Brandon Maier <brandon.maier@gmail.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2025-03-03meson: don't build test programs by defaultEli Schwartz1-1/+3
They are only used when running tests, and are included as depedencies of the test cases themselves already. Marking them to not build by default, means that 291 compile edges can be skipped when only running ``` meson setup builddir/ ninja -C builddir/ meson install -C builddir/ ``` resulting in an overall much faster build. Instead they will be compiled on-demand by `meson test`, only for users that actually run the tests. Signed-off-by: Eli Schwartz <eschwartz@gentoo.org> Message-ID: <20250302222839.2256985-1-eschwartz@gentoo.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2025-02-05tests: When building .so from -O asm output mark as non-executable stackDavid Gibson1-1/+1
For certain tests, we take the output from dtc -O asm and build it into a .so shared library which we then dlopen() for further tests. Because we don't mark it otherwise, it's treated as requiring an executable stack, which dlopen() refuses to open as of glibc-2.41. Of course, the library is pure data, no code, so it certainly doesn't need an executable stack. Add the -znoexecstack linker option to avoid the error. Fixes: https://github.com/dgibson/dtc/issues/163 Reported-by: Xi Ruoyao <xry111@xry111.site> Signed-off-by: David Gibson <david@gibson.dropbear.id.a>
2025-01-24Start with empty __local_fixups__ and __fixups__ nodesUwe Kleine-König1-2/+15
When the meta nodes __local_fixups__ and __fixups__ are generated, and one of these (or both) already exist, the information contained there is duplicated at best and stale otherwise. So remove the nodes before starting to fill them. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2025-01-24Let get_subnode() not return deleted nodesUwe Kleine-König1-1/+1
Both current callers actually don't want deleted nodes returned by get_subnode(). So change semantics of this function to only return "live" nodes. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2025-01-24Use build_root_node() instead of open-coding itUwe Kleine-König1-3/+1
build_root_node() does error checking (which is good!) but otherwise behaves exactly as the code replaced here. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-12-18build: fix -Dtools=false buildMarc-André Lureau1-6/+6
When configuring the project, meson fails with: tests/meson.build:107:27: ERROR: Unknown variable "util_dep" Declare the util_dep dependency regardless if 'tools' are enabled, so tests can be built with it. Fixes: bdc5c8793a1 ("meson: allow disabling tests") Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-12-18checks: Warn about missing #address-cells for interrupt parentsThierry Reding1-0/+4
The device tree specification (v0.4) suggests that #address-cells is mandatory for interrupt parent nodes. If this property is missing, Linux will default to the value of 0. A number of device tree files rely on Linux' fallback and don't specify an explicit #address-cells as suggested by the specification. This can cause issues when these device trees are passed to software with a more pedantic interpretation of the DT spec. Add a warning when this case is detected so that device tree files can be fixed. Reported-by: Brad Griffis <bgriffis@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com> Reviewed-by: Rob Herring (Arm) <robh@kernel.org> Message-ID: <20241213141438.3616902-1-thierry.reding@gmail.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-12-06libfdt: Add fdt_setprop_namelen_string()Ayush Singh1-0/+32
Macro using fdt_setprop_namelen() internally similar to `fdt_setprop_string()`. Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Ayush Singh <ayush@beagleboard.org> Message-ID: <20241205-setprop-namelen-v2-4-0d85a3d2e7b1@beagleboard.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-12-06libfdt: Add fdt_setprop_namelen()Ayush Singh3-21/+103
Allow specifying name length in setprop similar to `fdt_get_property_namelen` functions. Signed-off-by: Ayush Singh <ayush@beagleboard.org> Message-ID: <20241205-setprop-namelen-v2-3-0d85a3d2e7b1@beagleboard.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-12-06libfdt_internal: fdt_find_string_len_()Ayush Singh2-5/+14
Allow specifying string length to `fdt_find_string_`. fdt_find_string_() now internally uses this function. Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Ayush Singh <ayush@beagleboard.org> Message-ID: <20241205-setprop-namelen-v2-2-0d85a3d2e7b1@beagleboard.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-12-06libfdt: add fdt_get_property_namelen_w()Ayush Singh1-0/+7
Similar to the non-namelen variant, it is implemented in terms of fdt_get_property_namelen() Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Ayush Singh <ayush@beagleboard.org> Message-ID: <20241205-setprop-namelen-v2-1-0d85a3d2e7b1@beagleboard.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-12-06Add clang-format configAyush Singh1-0/+135
Add clang-format config based on Linux kernel clang-format config. Allows for consistent formatting rules for all future contributions. Signed-off-by: Ayush Singh <ayush@beagleboard.org> Message-ID: <20241205-clang-format-v2-1-07d21007bdab@beagleboard.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-11-27checks: Relax avoid_unnecessary_addr_size check to allow child ranges propertiesPhilipp Zabel1-7/+10
Do not fail the unnecessary #address-cells/#size-cells check if any children of the node have a "ranges" property. Suggested-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/all/CAL_JsqKebRL454poAYZ9i=sCsHqGzmocLy0psQcng-79UWJB-A@mail.gmail.com/ Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Message-ID: <20241106130108.852323-1-p.zabel@pengutronix.de> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-11-25tests/sw_tree1.c: fix unitialized saveptrBrandon Maier1-1/+1
Building the dtc tests on the Conda build system results in the following error. > In function '__strtok_r_1c', 2024-11-23T19:17:20.7930512Z inlined from 'main' at ../tests/sw_tree1.c:140:17: > $BUILD_PREFIX/x86_64-conda-linux-gnu/sysroot/usr/include/bits/string2.h:1177:10: error: 'saveptr' may be used uninitialized [-Werror=maybe-uninitialized] > 1177 | while (*__s == __sep) > | ^~~~ > ../tests/sw_tree1.c: In function 'main': > ../tests/sw_tree1.c:137:39: note: 'saveptr' was declared here > 137 | char *str = argv[2], *saveptr, *tok; > | ^~~~~~~ > cc1: all warnings being treated as errors The manpage `strtok(3)` says the following. > VERSIONS > On some implementations, *saveptr is required to be NULL on the first call to strtok_r() that is being used to parse str. So set it to NULL. Signed-off-by: Brandon Maier <brandon.maier@gmail.com>
2024-11-25pylibfdt/libfdt.i: fix backwards compatibility of return valuesBrandon Maier1-11/+14
When our Python functions wrap `fdt_getprop()` they return a list containing `[*data, length]`. In SWIG v4.2 and earlier SWIG would discard `*data` if it is NULL/None. Causing the return value to just be `length`. But starting in SWIG v4.3 it no longer discards `*data`. So the return value is now `[None, length]`. Handle this compatibility issue in libfdt.i by checking if the return value looks like the older 4.2 return value, and casting it to the newer style. See https://github.com/swig/swig/pull/2907 Signed-off-by: Brandon Maier <brandon.maier@gmail.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-11-25.github/workflows: update ubuntu runner to supported versionBrandon Maier1-2/+2
The Ubuntu runner fails with the following message > E: The repository 'http://security.ubuntu.com/ubuntu mantic-security Release' does not have a Release file. Ubuntu 23.10 is end-of-life as of July 2024 anyway. So switch to the latest Ubuntu tag, which is currently 24.04. See https://discourse.ubuntu.com/t/edubuntu-23-10-has-reached-end-of-life-eol/46325 Signed-off-by: Brandon Maier <brandon.maier@gmail.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-11-25libfdt: Remove fdt parameter from overlay_fixup_one_phandleBingwu Zhang1-4/+2
When compiling with -Wall -Wextra, the unused fdt parameter becomes a warning. With -Werror, it becomes an error and fails the build. As the parameter is not used in the function, let's remove it. Signed-off-by: Bingwu Zhang <xtexchooser@duck.com> Message-ID: <20241123094814.15504-2-xtex@envs.net> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-11-20libfdt: Move the SBOM authors sectionRichard Hughes1-5/+7
I was mistaken, and another maintainer pointed out the author-of-this-file metadata needs to be in a different place. Apologies for the churn. Signed-off-by: Richard Hughes <richard@hughsie.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-11-18Add a SBOM file in CycloneDX formatRichard Hughes1-0/+41
Improve supply chain security by including a SBOM file with substituted values. This will be used to construct a composite platform SBOM. Signed-off-by: Richard Hughes <richard@hughsie.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-11-18libfdt: Remove extra semi-colons outside functionsBingwu Zhang2-11/+11
When compiling with -Werror -Wpedantic, both GCC and Clang fails, saying that these semi-colons are redundant, so remove them. Signed-off-by: Bingwu Zhang <xtexchooser@duck.com> Message-ID: <20241116101228.164707-6-xtex@envs.net> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-11-06Bump version to v1.7.2v1.7.2David Gibson1-1/+1
Prepare for a new release. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-11-06pylibfdt: Don't emit warnings from swig generate C codeDavid Gibson1-0/+1
The swig generated code has a heap of warnings with the flags we usually use. These aren't helpful, since there's nothing we can do about them from the dtc side. So, just disable the warnings flags when compiling the Python module. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-10-30fdtoverlay: provide better error message for missing `/__symbols__`Amjad Alsharafi1-0/+8
This was added because trying to apply overlay on dtb without knowing a lot about the subject can be frustrating with strange error messages. Before this, it will tell you: `Failed to apply 'overlay.dtbo': FDT_ERR_BADOFFSET` This message is similar to what's shown in `u-boot` when trying to apply overlay Signed-off-by: Amjad Alsharafi <amjadsharafi10@gmail.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-10-30pylibfdt/libfdt.i: Use SWIG_AppendOutputMarkus Volk1-3/+3
Swig has changed language specific AppendOutput functions. The helper macro SWIG_AppendOutput remains unchanged. Use that instead of SWIG_Python_AppendOutput, which would require an extra parameter since swig 4.3.0. | /home/flk/poky/build-hypr/tmp/work/x86_64-linux/python3-dtc-native/1.7.0/git/pylibfdt/libfdt_wrap.c: In function ‘_wrap_fdt_next_node’: | /home/flk/poky/build-hypr/tmp/work/x86_64-linux/python3-dtc-native/1.7.0/git/pylibfdt/libfdt_wrap.c:5598:17: error: too few arguments to function ‘SWIG_Python_AppendOutput’ | 5598 | resultobj = SWIG_Python_AppendOutput(resultobj, val); Signed-off-by: Markus Volk <f_l_k@t-online.de> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-10-24Escape spaces in depfile with backslashes.Colin Finck4-3/+28
This matches how Linux escapes spaces in paths. The same syntax is also used by other build tools that output depfiles, e.g. https://github.com/rust-lang/cargo/blob/edd36eba5e0d6e0cfcb84bd0cc651ba8bf5e7f83/src/cargo/core/compiler/output_depinfo.rs#L19 Signed-off-by: Colin Finck <mail@colinfinck.de> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-10-07libfdt.h: whitespace consistency fixupsRasmus Villemoes1-9/+9
In these cases, spaces are used for indentation/alignment while the surrounding lines use tab. Fix it up for consistency. Signed-off-by: Rasmus Villemoes <ravi@prevas.dk> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-10-07libfdt.h: typo and consistency fixesRasmus Villemoes1-10/+9
Most of these are plain typos. Exceptions: - "devicetree" is only used in that form in the grammar and in mailing list references; all other instances, in particular all in prose, use "device tree". - I don't know what "nodeequested" was supposed to be, the sentence reads just fine without it. - "inexistant" is a rare form of nonexistent. Signed-off-by: Rasmus Villemoes <ravi@prevas.dk> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-08-17Bump version to v1.7.1v1.7.1David Gibson1-1/+1
Prepare for a new release. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-08-12setup: Move setting of srcdir down to the bottomSimon Glass1-5/+6
Put this variable assignment next to the others. Pass it to get_top_builddir() instead of relying on the global variable. Signed-off-by: Simon Glass <sjg@chromium.org> Message-ID: <20240811150248.7537-5-sjg@chromium.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-08-12setup: Collect top-level code togetherSimon Glass1-8/+9
Move most of the top-level code together, with the classes and functions above, for easier reading. The srcdir is left where it is for now. Signed-off-by: Simon Glass <sjg@chromium.org> Message-ID: <20240811150248.7537-4-sjg@chromium.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-08-12setup: Move version and full_description into a functionSimon Glass1-4/+18
Do this processing in a function and return the result, to reduce the amount of code at the top level. Signed-off-by: Simon Glass <sjg@chromium.org> Message-ID: <20240811150248.7537-3-sjg@chromium.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-08-12Tidy up some pylint warningsSimon Glass1-9/+16
Resolve all the pylint warnings currently in setup.py Signed-off-by: Simon Glass <sjg@chromium.org> Message-ID: <20240811150248.7537-2-sjg@chromium.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-08-12Require Python 3Simon Glass1-3/+1
We don't need to support Python 2 anymore, so drop the comment and add the minimum required version. Use version 3.8 since I am not sure that it works on older versions and 3.7 has reached end-of-life. Signed-off-by: Simon Glass <sjg@chromium.org> Message-ID: <20240811150248.7537-1-sjg@chromium.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-08-11fdtoverlay: remove wrong singular article in a commentMarkus Heidelberg1-1/+1
Signed-off-by: Markus Heidelberg <m.heidelberg@cab.de> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-08-01checks: relax graph checks for overlaysMichael Riesch1-4/+12
In device tree overlays, the following patterns occur frequently: board.dts: /dts-v1/; / { display-controller { ports { #address-cells = <1>; #size-cells = <0>; vp0: port@0 { reg = <0>; vp0_out: endpoint { }; }; vp1: port@1 { reg = <1>; }; }; }; }; overlay-endpoint.dtso: /dts-v1/; /plugin/; &{/} { hdmi-tx-connector { port { hdmi_tx_in: endpoint { remote-endpoint = <&vp0_out>; }; }; }; }; &vp0_out { remote-endpoint = <&hdmi_tx_in>; }; In this case, dtc expects that the node referenced by &vp0_out is named "endpoint", but the name cannot be inferred. Also, dtc complains about the connections between the endpoints not being bidirectional. Similarly, for a different overlay overlay-port.dtso: /dts-v1/; /plugin/; &{/} { panel { port { panel_in: endpoint { remote-endpoint = <&vp1_out>; }; }; }; }; &vp1 { vp1_out: endpoint { remote-endpoint = <&panel_in>; }; }; dtc expects that the node referenced by &vp1 is named "port", but the name cannot be inferred. Relax the corresponding checks and skip the parts that are not reasonable for device tree overlays. Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-07-06pylibfdt/Makefile.pylibfdt: use project's flags to compile the extensionDan Horák1-1/+1
Seems the project's CFLAGS are not used when compiling the python extension's C code via the setup.py script. Some default flags are used instead. Thus pass the CFLAGS explicitly. Unfortunately the SWIG generated code is not clean and requires -Wno-error override to compile successfully, because -Werror is used in the project's flags. Signed-off-by: Dan Horák <dan@danny.cz> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-07-05libfdt: overlay: Fix phandle overwrite check for new subtreesUwe Kleine-König3-1/+19
If the overlay's target is only created in a previous fragment, it doesn't exist in the unmodified base device tree. For the phandle overwrite check this can be ignored because in this case the base tree doesn't contain a phandle that could be overwritten. Adapt the corresponding check to not error out if that happens but just continue with the next fragment. This is currently triggered by arch/arm64/boot/dts/renesas/salvator-panel-aa104xd12.dtso in the kernel repository which creates /panel in its first fragment and modifies it in its second. Reported-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/all/CAL_JsqL9MPycDjqQfPNAuGfC6EMrdzUivr+fuOS7YgU3biGd4A@mail.gmail.com/ Fixes: 1fad065080e6 ("libfdt: overlay: ensure that existing phandles are not overwritten") Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com> Message-ID: <20240626075551.2493048-2-u.kleine-koenig@baylibre.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-07-01meson: fix installation with meson-pythonBrandon Maier1-1/+1
The meson-python backend fails to map 'dtdiff' install into Python wheels. Removing the prefix from the install_dir path allows meson-python to map dtdiff. The install_data(install_dir) documentation says "If this is a relative path, it is assumed to be relative to the prefix"[1]. So removing the prefix does not change the installation behaviour. [1] https://mesonbuild.com/Reference-manual_functions.html#install_data Signed-off-by: Brandon Maier <brandon.maier@collins.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-07-01pylibfdt: clean up python build directoryBrandon Maier2-2/+3
In commit "pylibfdt/Makefile.pylibfdt: fix Python library being rebuild during install" the build directory moved to the top level of the repo. Signed-off-by: Brandon Maier <brandon.maier@gmail.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-07-01pylibfdt: add VERSION.txt to Python sdistBrandon Maier1-0/+1
The VERSION.txt file tells setup.py what library version to use, so we must include it in the source distrbution. Signed-off-by: Brandon Maier <brandon.maier@collins.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-07-01pylibfdt: fix Python versionBrandon Maier1-1/+1
In commit "pylibfdt: Remove some apparently deprecated options from setup.py" the scm version tracking was removed. But it was not replaced with the fixed version. This causes the Python modules to be installed as version '0.0.0'. Signed-off-by: Brandon Maier <brandon.maier@collins.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-06-26pylibfdt/Makefile.pylibfdt: fix Python library being rebuild during installBrandon Maier1-1/+1
The Python module gets built during the 'make install' command even if 'make all' was run prior for build. This is the same issue as described in the previous commit "pylibfdt/meson.build: fix Python library being rebuilt during install". Remove the '--build-lib' flag so setuptools can find the build module. Signed-off-by: Brandon Maier <brandon.maier@gmail.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-06-26pylibfdt/meson.build: fix Python library being rebuilt during installBrandon Maier2-2/+14
User @sharkcz noted that when the '--quiet' flag is removed from ./setup.py, the following can be seen from the `./setup.py install` stage. Running custom install script 'dtc/g/pylibfdt/../setup.py --top-builddir \ dtc/g/redhat-linux-build install --prefix=/usr/local --root=$DESTDIR' running install ... building '_libfdt' extension swigging dtc/g/pylibfdt/../pylibfdt/libfdt.i to \ dtc/g/pylibfdt/../pylibfdt/libfdt_wrap.c swig -python -Idtc/g/pylibfdt/../libfdt -o \ dtc/g/pylibfdt/../pylibfdt/libfdt_wrap.c dtc/g/pylibfdt/../pylibfdt/libfdt.i gcc -fno-strict-overflow -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 \ -DNDEBUG -fexceptions -fexceptions -fexceptions -fPIC -DPY_SSIZE_T_CLEAN \ -Idtc/g/pylibfdt/../libfdt -I/usr/include/python3.12 -c \ dtc/g/pylibfdt/../pylibfdt/libfdt_wrap.c -o \ build/temp.linux-ppc64le-cpython-312dtc/g/pylibfdt/../pylibfdt/libfdt_wrap.o creating build/lib.linux-ppc64le-cpython-312 gcc -shared build/temp.linux-ppc64le-cpython-312dtc/g/pylibfdt/../pylibfdt/libfdt_wrap.o \ -Ldtc/g/redhat-linux-build/libfdt -L/usr/lib64 -lfdt -o \ build/lib.linux-ppc64le-cpython-312/_libfdt.cpython-312-powerpc64le-linux-gnu.so copying dtc/g/pylibfdt/../pylibfdt/libfdt.py -> build/lib.linux-ppc64le-cpython-312 Meaning the python library is getting recompiled during the `meson install` phase. This causes build issues as Meson does not set the compiler and linker flags during the install phase. The reason the library is getting rebuilt is during the normal build with "build_ext", the `--build-lib` flag gets passed which changes the default output build directory. But there is no equivalent option for the "install" command. Install instead looks in the default directory "./build" and so does not find the previously built library. Since we can't fix the "install" command, drop the --build-lib flag. This causes setup.py to compile the libraries at `<meson-build>/build/lib.linux-x86_64-cpython-312/`. We must also then fix run_tests.sh to find the library build directory as it's machine-dependent. Fixes: #135 Signed-off-by: Brandon Maier <brandon.maier@gmail.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-06-26tests/run_tests.sh: fix Meson library path being droppedBrandon Maier1-1/+5
Meson automatically passes in LD_LIBRARY_PATH pointing at the correct build directory for libfdt.so. So preserve LD_LIBRARY_PATH if it's already set. Signed-off-by: Brandon Maier <brandon.maier@gmail.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-06-24tests/meson.build: fix python and yaml tests not runningBrandon Maier1-0/+3
The run-tests.sh script attempts to detect if Python and Yaml support is enabled in the build. This has caused false-negatives where it fails to find the Python library even though it was compiled into the build. Avoid this problem altogether and always set the NO_PYTHON and NO_YAML to match if the features are enabled in Meson. Signed-off-by: Brandon Maier <brandon.maier@gmail.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-06-01checks: Check the overall length of "interrupt-map"Rob Herring (Arm)1-0/+4
It is possible the overall length of "interrupt-map" is shorter than expected. A likely scenario is if "#address-cells" in the interrupt parent is not accounted for and there is only a single map entry. With multiple entries, one of the other tests would likely fail. Signed-off-by: Rob Herring (Arm) <robh@kernel.org> Message-ID: <20240531133149.1498139-1-robh@kernel.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>