Skip to contentSkip to conversation

ppc: Require libfdt 1.4.0 as minimum version

PATCH Applied Thomas Huth 2 participants 4 messages May 18, 2015

lore
Share & tools
lore
#0 lore raw

v2 cover ppc: Require libfdt 1.4.0 as minimum version

The patch "spapr_drc: initial implementation of sPAPRDRConnector device" requires the function fdt_get_property_by_offset() from libfdt, which is only properly exported there since version 1.4.0. So let's make sure that we require at least version 1.4.0 of libfdt nowadays.

Thomas Huth (2):
dtc: Update dtc / libfdt submodule to version 1.4.0
configure: Check for libfdt version 1.4.0

 configure | 6 ++++--
 dtc       | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH v2 1/2 dtc: Update dtc / libfdt submodule to version 1.4.0

Since some recent patches require libfdt version 1.4.0, let's update the dtc submodule to this version.

---
 dtc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
dtc +1 -1
index bc895d6..65cc4d2 160000
@@ -1 +1 @@
-Subproject commit bc895d6d09695d05ceb8b52486ffe861d6cfbdde
+Subproject commit 65cc4d2748a2c2e6f27f1cf39e07a5dbabd80ebf
Signature · 1 line
1.8.3.1
#2 lore raw

PATCH v2 2/2 configure: Check for libfdt version 1.4.0

In reply to Thomas Huth

Some recent patches require a function from libfdt version 1.4.0, so we should check for this version during the configure step already. Unfortunately, there does not seem to be a proper #define for the version number in the libfdt headers. So alternatively, we check for the availability of the required function fdt_get_property_by_offset() instead instead.

---
 configure | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
configure +4 -2
index 1f0f485..cee997f 100755
@@ -3102,9 +3102,11 @@ fi
 if test "$fdt" != "no" ; then
   fdt_libs="-lfdt"
   # explicitly check for libfdt_env.h as it is missing in some stable installs
+  # and test for required functions to make sure we are on a version >= 1.4.0
   cat > $TMPC << EOF
+#include <libfdt.h>
 #include <libfdt_env.h>
-int main(void) { return 0; }
+int main(void) { fdt_get_property_by_offset(0, 0, 0); return 0; }
 EOF
   if compile_prog "" "$fdt_libs" ; then
     # system DTC is good - use it
@@ -3122,7 +3124,7 @@ EOF
     fdt_libs="-L\$(BUILD_DIR)/dtc/libfdt $fdt_libs"
   elif test "$fdt" = "yes" ; then
     # have neither and want - prompt for system/submodule install
-    error_exit "DTC (libfdt) not present. Your options:" \
+    error_exit "DTC (libfdt) version >= 1.4.0 not present. Your options:" \
         "  (1) Preferred: Install the DTC (libfdt) devel package" \
         "  (2) Fetch the DTC submodule, using:" \
         "      git submodule update --init dtc"
Signature · 1 line
1.8.3.1
#3 lore raw
In reply to Thomas Huth
Quoted 4 lines · Thomas Huth

The patch "spapr_drc: initial implementation of sPAPRDRConnector device" requires the function fdt_get_property_by_offset() from libfdt, which is only properly exported there since version 1.4.0. So let's make sure that we require at least version 1.4.0 of libfdt nowadays.

Thanks, applied to ppc-next (before the spapr merge).

Alex