From: Baruch Siach <baruch@tkos.co.il>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] cryptsetup: fix build with pre C11 toolchains
Date: Thu, 16 Aug 2018 08:19:16 +0300 [thread overview]
Message-ID: <87k1oqopm3.fsf@tkos.co.il> (raw)
In-Reply-To: <bae2ff1f-ee13-489e-ba77-fedfbb023d54@mentor.com>
Hi Hollis,
Hollis Blanchard writes:
> Worked for me.
>
> Tested-by: Hollis Blanchard <hollis_blanchard@mentor.com>
Thanks for the confirmation. I sent the patch upstream:
https://gitlab.com/cryptsetup/cryptsetup/merge_requests/49
I'm not sure upstream would like the namespace pollution in this patch.
baruch
> On 08/15/2018 05:14 AM, Baruch Siach wrote:
>> Add a patch removing a redefined typedef. Redefinition of typedef, even
>> to the same type, used to be illegal before C11.
>>
>> Fixes:
>> http://autobuild.buildroot.net/results/93b/93b300a62f2ddbad66eab08e25fc3225969f224b/
>> http://autobuild.buildroot.net/results/6c6/6c6092d633400498ee5b8090733a949a9632e473/
>> http://autobuild.buildroot.net/results/f46/f46ef6123b5fa92753ff534b4ef7bea3f53ac388/
>>
>> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
>> ---
>> Hi Hollis,
>>
>> Can you git this a run on your autobuilder? I would like to verify that
>> it actually fixes the problem before I send the patch upstream.
>>
>> Thanks,
>> baruch
>> ---
>> .../0001-Remove-json_object-typedef.patch | 46 +++++++++++++++++++
>> 1 file changed, 46 insertions(+)
>> create mode 100644 package/cryptsetup/0001-Remove-json_object-typedef.patch
>>
>> diff --git a/package/cryptsetup/0001-Remove-json_object-typedef.patch b/package/cryptsetup/0001-Remove-json_object-typedef.patch
>> new file mode 100644
>> index 000000000000..fa865314a7da
>> --- /dev/null
>> +++ b/package/cryptsetup/0001-Remove-json_object-typedef.patch
>> @@ -0,0 +1,46 @@
>> +From 567e7f8664c621f8aeaa95d9f4ab4b590574f572 Mon Sep 17 00:00:00 2001
>> +From: Baruch Siach <baruch@tkos.co.il>
>> +Date: Wed, 15 Aug 2018 14:13:46 +0300
>> +Subject: [PATCH] Remove json_object typedef
>> +
>> +The json-c header already defines the same typedef. While C11 allows
>> +typedef redefinition to the same type, older versions of gcc disallow
>> +that.
>> +
>> +In file included from lib/luks2/luks2_internal.h:32,
>> + from lib/luks2/luks2_disk_metadata.c:24:
>> +lib/luks2/luks2.h:86: error: redefinition of typedef 'json_object'
>> +
>> +Signed-off-by: Baruch Siach <baruch@tkos.co.il>
>> +---
>> + lib/luks2/luks2.h | 1 -
>> + lib/setup.c | 1 +
>> + 2 files changed, 1 insertion(+), 1 deletion(-)
>> +
>> +diff --git a/lib/luks2/luks2.h b/lib/luks2/luks2.h
>> +index ee57b41ba974..25e36190da45 100644
>> +--- a/lib/luks2/luks2.h
>> ++++ b/lib/luks2/luks2.h
>> +@@ -83,7 +83,6 @@ struct luks2_hdr_disk {
>> + /*
>> + * LUKS2 header in-memory.
>> + */
>> +-typedef struct json_object json_object;
>> + struct luks2_hdr {
>> + size_t hdr_size;
>> + uint64_t seqid;
>> +diff --git a/lib/setup.c b/lib/setup.c
>> +index fddbe7ef7897..856f6e80f465 100644
>> +--- a/lib/setup.c
>> ++++ b/lib/setup.c
>> +@@ -28,6 +28,7 @@
>> + #include <sys/utsname.h>
>> + #include <fcntl.h>
>> + #include <errno.h>
>> ++#include <json-c/json.h>
>> +
>> + #include "libcryptsetup.h"
>> + #include "luks.h"
>> +--
>> +2.18.0
>> +
--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
next prev parent reply other threads:[~2018-08-16 5:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-15 12:14 [Buildroot] [PATCH] cryptsetup: fix build with pre C11 toolchains Baruch Siach
2018-08-15 15:10 ` Hollis Blanchard
2018-08-15 15:12 ` Matthew Weber
2018-08-15 17:09 ` Baruch Siach
2018-08-15 20:24 ` Hollis Blanchard
2018-08-16 5:19 ` Baruch Siach [this message]
2018-08-20 4:22 ` Baruch Siach
2018-08-20 21:05 ` Hollis Blanchard
2018-08-17 15:01 ` Peter Korsgaard
2018-08-23 19:13 ` Peter Korsgaard
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=87k1oqopm3.fsf@tkos.co.il \
--to=baruch@tkos.co.il \
--cc=buildroot@busybox.net \
/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