Skip to contentSkip to conversation

package/collectd: Specify FP layout based on endianness

PATCH New Andrey Smirnov 3 participants 4 messages Nov 7, 2017 – Nov 26, 2017

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 package/collectd: Specify FP layout based on endianness

Big-endian CPUs store floating point as big endian (at lest majority of them do), so, in order for 'network' plugin to work correctly (and potentially any user of htond() in collectd's codebase), --with-fp-layout=endianflip as opposed to --with-fp-layout=nothing needs to be specified during configuration phase.

Cc Thomas Petazzoni <[email protected]>
Cc Arnout Vandecappelle <[email protected]>
Cc Gustavo Zacarias <[email protected]>

---

Changes in [v2]:

- Patch converted to use target's endianness as opposed to CPU architecture

- Added a notes about the discussion around "intswap"

[v2] http://lists.busybox.net/pipermail/buildroot/2017-October/205773.html

 package/collectd/collectd.mk | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
package/collectd/collectd.mk +15 -1
index 626fba81bf..6c987b2e36 100644
@@ -24,9 +24,23 @@ COLLECTD_PLUGINS_DISABLE = \
 
 COLLECTD_CONF_ENV += LIBS="-lm"
 
+#
+# NOTE: There's also a third availible setting "intswap", which might
+# be needed on some old ARM hardware (see [2]), but is not being
+# accounted for as per discussion [1]
+#
+# [1] http://lists.busybox.net/pipermail/buildroot/2017-November/206100.html
+# [2] http://lists.busybox.net/pipermail/buildroot/2017-November/206251.html
+#
+ifeq ($(BR2_ENDIAN),"BIG")
+COLLECTD_FP_LAYOUT=endianflip
+else
+COLLECTD_FP_LAYOUT=nothing
+endif
+
 COLLECTD_CONF_OPTS += \
 	--with-nan-emulation \
-	--with-fp-layout=nothing \
+	--with-fp-layout=$(COLLECTD_FP_LAYOUT) \
 	--with-perl-bindings=no \
 	$(foreach p, $(COLLECTD_PLUGINS_DISABLE), --disable-$(p)) \
 	$(if $(BR2_PACKAGE_COLLECTD_AGGREGATION),--enable-aggregation,--disable-aggregation) \
Signature · 1 line
2.13.6
#1 lore raw

PATCH v2 1/1 package/collectd: Specify FP layout based on endianness

Hello,

Quoted 10 lines · Andrey Smirnov

Big-endian CPUs store floating point as big endian (at lest majority of them do), so, in order for 'network' plugin to work correctly (and potentially any user of htond() in collectd's codebase), --with-fp-layout=endianflip as opposed to --with-fp-layout=nothing needs to be specified during configuration phase.

Cc Thomas Petazzoni <[email protected]>
Cc Arnout Vandecappelle <[email protected]>
Cc Gustavo Zacarias <[email protected]>

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#2 lore raw

PATCH v2 1/1 package/collectd: Specify FP layout based on endianness

In reply to Andrey Smirnov

Hello,

Quoted 11 lines · Andrey Smirnov

Big-endian CPUs store floating point as big endian (at lest majority of them do), so, in order for 'network' plugin to work correctly (and potentially any user of htond() in collectd's codebase), --with-fp-layout=endianflip as opposed to --with-fp-layout=nothing needs to be specified during configuration phase.

Cc Thomas Petazzoni <[email protected]>
Cc Arnout Vandecappelle <[email protected]>
Cc Gustavo Zacarias <[email protected]>

---

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH v2 1/1 package/collectd: Specify FP layout based on endianness

In reply to Andrey Smirnov
Quoted 14 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Andrey" == Andrey Smirnov <[email protected]> writes:

Big-endian CPUs store floating point as big endian (at lest majority of them do), so, in order for 'network' plugin to work correctly (and potentially any user of htond() in collectd's codebase), --with-fp-layout=endianflip as opposed to --with-fp-layout=nothing needs to be specified during configuration phase.

Cc Thomas Petazzoni <[email protected]>
Cc Arnout Vandecappelle <[email protected]>
Cc Gustavo Zacarias <[email protected]>

---

Quoted 8 lines

Changes in [v2]:

- Patch converted to use target's endianness as opposed to CPU architecture

- Added a notes about the discussion around "intswap"

[v2] http://lists.busybox.net/pipermail/buildroot/2017-October/205773.html

Committed to 2017.02.x and 2017.08.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard