* Re: [PATCH 1/2][RESEND] Prevent zconf.gperf from throwing an error on OSX @ 2014-10-16 16:52 Jason T. Masker 2014-12-05 11:26 ` Bryan Hundven 0 siblings, 1 reply; 4+ messages in thread From: Jason T. Masker @ 2014-10-16 16:52 UTC (permalink / raw) To: Bryan Hundven; +Cc: crossgcc Updated zconf.gperf patch to be conditional. The problem is when compiling with clang/LLVM, so not necessarily specific to OS X. Offsetof is part of C99 and defined in stddef.h, but is builtin with gcc. This code will check for a definition and try including stddef.h if it is not found. As a last resort, offsetof will be defined. Apologies for the resend. I did not sign off. Signed-off-by: Jason Masker <jason@masker.net> diff --git a/kconfig/zconf.gperf b/kconfig/zconf.gperf index c9e690e..d758a2a 100644 --- a/kconfig/zconf.gperf +++ b/kconfig/zconf.gperf @@ -7,6 +7,15 @@ %pic %struct-type +%{ +# ifndef offsetof +# include <stddef.h> +# ifndef offsetof +# define offsetof(st, m) ((size_t)(&((st *)0)->m)) +# endif +# endif +%} + struct kconf_id; static struct kconf_id *kconf_id_lookup(register const char *str, register unsigned int len); -- For unsubscribe information see http://sourceware.org/lists.html#faq ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2][RESEND] Prevent zconf.gperf from throwing an error on OSX 2014-10-16 16:52 [PATCH 1/2][RESEND] Prevent zconf.gperf from throwing an error on OSX Jason T. Masker @ 2014-12-05 11:26 ` Bryan Hundven 2014-12-15 2:17 ` Jason T. Masker 0 siblings, 1 reply; 4+ messages in thread From: Bryan Hundven @ 2014-12-05 11:26 UTC (permalink / raw) To: Jason T. Masker; +Cc: crossgcc Jason, On Thu, Oct 16, 2014 at 9:51 AM, Jason T. Masker <jason@masker.net> wrote: > Updated zconf.gperf patch to be conditional. > > The problem is when compiling with clang/LLVM, so not necessarily > specific to OS X. Offsetof is part of C99 and defined in stddef.h, but > is builtin with gcc. This code will check for a definition and try > including stddef.h if it is not found. As a last resort, offsetof will > be defined. Apologies for the resend. I did not sign off. > > Signed-off-by: Jason Masker <jason@masker.net> > > > diff --git a/kconfig/zconf.gperf b/kconfig/zconf.gperf > index c9e690e..d758a2a 100644 > --- a/kconfig/zconf.gperf > +++ b/kconfig/zconf.gperf > @@ -7,6 +7,15 @@ > %pic > %struct-type > > +%{ > +# ifndef offsetof > +# include <stddef.h> > +# ifndef offsetof > +# define offsetof(st, m) ((size_t)(&((st *)0)->m)) > +# endif > +# endif > +%} > + > struct kconf_id; > > static struct kconf_id *kconf_id_lookup(register const char *str, > register unsigned int len); Dang, I wanted to apply this but the patch did not apply cleanly. Would you mind rebasing this patch with latest head and resending? Then I'll finally get this bad boy applied. Thanks, -Bryan -- For unsubscribe information see http://sourceware.org/lists.html#faq ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2][RESEND] Prevent zconf.gperf from throwing an error on OSX 2014-12-05 11:26 ` Bryan Hundven @ 2014-12-15 2:17 ` Jason T. Masker 2015-01-09 3:25 ` Bryan Hundven 0 siblings, 1 reply; 4+ messages in thread From: Jason T. Masker @ 2014-12-15 2:17 UTC (permalink / raw) To: Bryan Hundven; +Cc: crossgcc [-- Attachment #1: Type: text/plain, Size: 1327 bytes --] On Fri, Dec 5, 2014 at 6:25 AM, Bryan Hundven <bryanhundven@gmail.com> wrote: > Jason, > > On Thu, Oct 16, 2014 at 9:51 AM, Jason T. Masker <jason@masker.net> wrote: >> Updated zconf.gperf patch to be conditional. >> >> The problem is when compiling with clang/LLVM, so not necessarily >> specific to OS X. Offsetof is part of C99 and defined in stddef.h, but >> is builtin with gcc. This code will check for a definition and try >> including stddef.h if it is not found. As a last resort, offsetof will >> be defined. Apologies for the resend. I did not sign off. >> >> Signed-off-by: Jason Masker <jason@masker.net> >> >> >> diff --git a/kconfig/zconf.gperf b/kconfig/zconf.gperf >> index c9e690e..d758a2a 100644 >> --- a/kconfig/zconf.gperf >> +++ b/kconfig/zconf.gperf >> @@ -7,6 +7,15 @@ >> %pic >> %struct-type >> >> +%{ >> +# ifndef offsetof >> +# include <stddef.h> >> +# ifndef offsetof >> +# define offsetof(st, m) ((size_t)(&((st *)0)->m)) >> +# endif >> +# endif >> +%} >> + >> struct kconf_id; >> >> static struct kconf_id *kconf_id_lookup(register const char *str, >> register unsigned int len); > > Dang, I wanted to apply this but the patch did not apply cleanly. > Would you mind rebasing this patch with latest head and resending? > Then I'll finally get this bad boy applied. > > Thanks, > > -Bryan [-- Attachment #2: 0001-update-zconf.gperf-to-conditionally-define-offsetof.patch --] [-- Type: application/octet-stream, Size: 784 bytes --] From e743814bcbe3bce10e559d13f21b0be91e298813 Mon Sep 17 00:00:00 2001 From: Jason Masker <jason@masker.net> Date: Sun, 14 Dec 2014 20:53:35 -0500 Subject: [PATCH] update zconf.gperf to conditionally define offsetof Signed-off-by: Jason Masker <jason@masker.net> --- kconfig/zconf.gperf | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/kconfig/zconf.gperf b/kconfig/zconf.gperf index c9e690e..d758a2a 100644 --- a/kconfig/zconf.gperf +++ b/kconfig/zconf.gperf @@ -7,6 +7,15 @@ %pic %struct-type +%{ +# ifndef offsetof +# include <stddef.h> +# ifndef offsetof +# define offsetof(st, m) ((size_t)(&((st *)0)->m)) +# endif +# endif +%} + struct kconf_id; static struct kconf_id *kconf_id_lookup(register const char *str, register unsigned int len); -- 2.2.0 [-- Attachment #3: Type: text/plain, Size: 71 bytes --] -- For unsubscribe information see http://sourceware.org/lists.html#faq ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2][RESEND] Prevent zconf.gperf from throwing an error on OSX 2014-12-15 2:17 ` Jason T. Masker @ 2015-01-09 3:25 ` Bryan Hundven 0 siblings, 0 replies; 4+ messages in thread From: Bryan Hundven @ 2015-01-09 3:25 UTC (permalink / raw) To: Jason T. Masker; +Cc: crossgcc Jason, On Sun, Dec 14, 2014 at 6:16 PM, Jason T. Masker <jason@masker.net> wrote: > On Fri, Dec 5, 2014 at 6:25 AM, Bryan Hundven <bryanhundven@gmail.com> wrote: >> Jason, >> >> On Thu, Oct 16, 2014 at 9:51 AM, Jason T. Masker <jason@masker.net> wrote: >>> Updated zconf.gperf patch to be conditional. >>> >>> The problem is when compiling with clang/LLVM, so not necessarily >>> specific to OS X. Offsetof is part of C99 and defined in stddef.h, but >>> is builtin with gcc. This code will check for a definition and try >>> including stddef.h if it is not found. As a last resort, offsetof will >>> be defined. Apologies for the resend. I did not sign off. >>> >>> Signed-off-by: Jason Masker <jason@masker.net> >>> >>> >>> diff --git a/kconfig/zconf.gperf b/kconfig/zconf.gperf >>> index c9e690e..d758a2a 100644 >>> --- a/kconfig/zconf.gperf >>> +++ b/kconfig/zconf.gperf >>> @@ -7,6 +7,15 @@ >>> %pic >>> %struct-type >>> >>> +%{ >>> +# ifndef offsetof >>> +# include <stddef.h> >>> +# ifndef offsetof >>> +# define offsetof(st, m) ((size_t)(&((st *)0)->m)) >>> +# endif >>> +# endif >>> +%} >>> + >>> struct kconf_id; >>> >>> static struct kconf_id *kconf_id_lookup(register const char *str, >>> register unsigned int len); >> >> Dang, I wanted to apply this but the patch did not apply cleanly. >> Would you mind rebasing this patch with latest head and resending? >> Then I'll finally get this bad boy applied. >> >> Thanks, >> >> -Bryan Sorry it's taken me so long to get back to this. I still have issues applying: bryan@fuzzy:~/crosstool-ng$ pwclient git-am 400328 Applying patch #400328 using 'git am' Description: [1/2,RESEND] Prevent zconf.gperf from throwing an error on OSX Applying: Prevent zconf.gperf from throwing an error on OSX error: patch failed: kconfig/zconf.gperf:7 error: kconfig/zconf.gperf: patch does not apply Patch failed at 0001 Prevent zconf.gperf from throwing an error on OSX The copy of the patch that failed is found in: /home/bryan/crosstool-ng/.git/rebase-apply/patch When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". If you want to verify the patch applies to a clean checkout of crosstool-NG and resend again? Thanks, -Bryan -- For unsubscribe information see http://sourceware.org/lists.html#faq ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-01-09 3:25 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2014-10-16 16:52 [PATCH 1/2][RESEND] Prevent zconf.gperf from throwing an error on OSX Jason T. Masker 2014-12-05 11:26 ` Bryan Hundven 2014-12-15 2:17 ` Jason T. Masker 2015-01-09 3:25 ` Bryan Hundven
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).