From: Michael Olbrich <m.olbrich@pengutronix.de>
To: ptxdist@pengutronix.de
Subject: Re: [ptxdist] [PATCH] libmodbus3: add patch for fixing alignment problem on arm
Date: Tue, 19 Mar 2013 16:32:56 +0100 [thread overview]
Message-ID: <20130319153256.GC30288@pengutronix.de> (raw)
In-Reply-To: <1363263396-10029-1-git-send-email-post@lespocky.de>
On Thu, Mar 14, 2013 at 01:16:36PM +0100, Alexander Dahl wrote:
> We use -Wcast-align on ARMv5 platform and libmodbus3 sets -Werror
> which leads to a failing build in one case. This patch fixes the
> alignment problem. Upstream pull requested.
Hmm, this is just unit test stuff, right? We don't actually need this.
Maybe we should do this instead:
LIBMODBUS3_MAKE_OPT := -C src
LIBMODBUS3_INSTALL_OPT := -C src install
Michael
> Signed-off-by: Alexander Dahl <post@lespocky.de>
> ---
> ...nt-problem-build-fails-with-Werror-and-Wc.patch | 33 ++++++++++++++++++++
> patches/libmodbus-3.0.3/series | 4 ++
> 2 files changed, 37 insertions(+), 0 deletions(-)
> create mode 100644 patches/libmodbus-3.0.3/0001-fix-alignment-problem-build-fails-with-Werror-and-Wc.patch
> create mode 100644 patches/libmodbus-3.0.3/series
>
> diff --git a/patches/libmodbus-3.0.3/0001-fix-alignment-problem-build-fails-with-Werror-and-Wc.patch b/patches/libmodbus-3.0.3/0001-fix-alignment-problem-build-fails-with-Werror-and-Wc.patch
> new file mode 100644
> index 0000000..88db0df
> --- /dev/null
> +++ b/patches/libmodbus-3.0.3/0001-fix-alignment-problem-build-fails-with-Werror-and-Wc.patch
> @@ -0,0 +1,33 @@
> +From: Alexander Dahl <ada@ifak-system.com>
> +Date: Wed, 13 Mar 2013 16:45:04 +0100
> +Subject: [PATCH] fix alignment problem (build fails with -Werror and
> + -Wcast-align on ARMv5 platform)
> +
> +---
> + tests/unit-test-client.c | 6 ++++--
> + 1 file changed, 4 insertions(+), 2 deletions(-)
> +
> +diff --git a/tests/unit-test-client.c b/tests/unit-test-client.c
> +index 533e6a7..7c3c64d 100644
> +--- a/tests/unit-test-client.c
> ++++ b/tests/unit-test-client.c
> +@@ -41,6 +41,7 @@ int main(int argc, char *argv[])
> + int nb_points;
> + int rc;
> + float real;
> ++ uint32_t ireal;
> + struct timeval old_response_timeout;
> + struct timeval response_timeout;
> + int use_backend;
> +@@ -325,8 +326,9 @@ int main(int argc, char *argv[])
> + tab_rp_registers[0] == (UT_IREAL & 0xFFFF)) {
> + printf("OK\n");
> + } else {
> +- printf("FAILED (%x != %x)\n",
> +- *((uint32_t *)tab_rp_registers), UT_IREAL);
> ++ ireal = (uint32_t) tab_rp_registers[0] & 0xFFFF;
> ++ ireal |= (uint32_t) tab_rp_registers[1] << 16;
> ++ printf("FAILED (%x != %x)\n", ireal, UT_IREAL);
> + goto close;
> + }
> +
> diff --git a/patches/libmodbus-3.0.3/series b/patches/libmodbus-3.0.3/series
> new file mode 100644
> index 0000000..9d8674a
> --- /dev/null
> +++ b/patches/libmodbus-3.0.3/series
> @@ -0,0 +1,4 @@
> +# generated by git-ptx-patches
> +#tag:base --start-number 1
> +0001-fix-alignment-problem-build-fails-with-Werror-and-Wc.patch
> +# d7fc60de785d0108680a1d6983f01a48 - git-ptx-patches magic
> --
> 1.7.2.5
>
>
> --
> ptxdist mailing list
> ptxdist@pengutronix.de
>
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
--
ptxdist mailing list
ptxdist@pengutronix.de
next prev parent reply other threads:[~2013-03-19 15:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-14 12:16 Alexander Dahl
2013-03-19 15:32 ` Michael Olbrich [this message]
2013-03-19 15:55 ` Alexander Dahl
2013-03-19 16:27 ` Michael Olbrich
2013-03-26 9:04 ` Alexander Dahl
2013-03-27 17:57 ` Michael Olbrich
2013-03-28 7:46 ` Alexander Dahl
2013-03-28 9:27 ` Michael Olbrich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130319153256.GC30288@pengutronix.de \
--to=m.olbrich@pengutronix.de \
--cc=ptxdist@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox