* [PATCH] parser: add Blackfin gcc info
@ 2010-10-05 8:34 Mike Frysinger
2010-10-05 16:18 ` Josh Triplett
0 siblings, 1 reply; 11+ messages in thread
From: Mike Frysinger @ 2010-10-05 8:34 UTC (permalink / raw)
To: linux-sparse; +Cc: michael.hennerich
The Blackfin port uses some custom attributes to control memory placement,
and it has some custom builtins. So add the ones that the kernel actually
utilizes to avoid massive build errors with sparse.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
lib.c | 3 +++
parse.c | 6 ++++++
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/lib.c b/lib.c
index ae6a20c..24176d8 100644
--- a/lib.c
+++ b/lib.c
@@ -716,6 +716,9 @@ void declare_builtin_functions(void)
add_pre_buffer("extern long __builtin_alpha_inslh(long, long);\n");
add_pre_buffer("extern long __builtin_alpha_cmpbge(long, long);\n");
add_pre_buffer("extern long __builtin_labs(long);\n");
+ add_pre_buffer("extern void __builtin_bfin_csync(void);\n");
+ add_pre_buffer("extern void __builtin_bfin_ssync(void);\n");
+ add_pre_buffer("extern int __builtin_bfin_norm_fr1x32(int);\n");
/* And some floating point stuff.. */
add_pre_buffer("extern int __builtin_isgreater(float, float);\n");
diff --git a/parse.c b/parse.c
index 9074b1d..32d2d0a 100644
--- a/parse.c
+++ b/parse.c
@@ -515,6 +515,12 @@ const char *ignored_attributes[] = {
"__format_arg__",
"hot",
"__hot__",
+ "l1_text",
+ "__l1_text__",
+ "l1_data",
+ "__l1_data__",
+ "l2",
+ "__l2__",
"malloc",
"__malloc__",
"may_alias",
--
1.7.3.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] parser: add Blackfin gcc info
2010-10-05 8:34 [PATCH] parser: add Blackfin gcc info Mike Frysinger
@ 2010-10-05 16:18 ` Josh Triplett
2010-10-06 1:34 ` Mike Frysinger
0 siblings, 1 reply; 11+ messages in thread
From: Josh Triplett @ 2010-10-05 16:18 UTC (permalink / raw)
To: Mike Frysinger; +Cc: linux-sparse, michael.hennerich
On Tue, Oct 05, 2010 at 04:34:30AM -0400, Mike Frysinger wrote:
> The Blackfin port uses some custom attributes to control memory placement,
> and it has some custom builtins. So add the ones that the kernel actually
> utilizes to avoid massive build errors with sparse.
>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
I wonder, does it make sense to support these kinds of
architecture-specific builtins on all architectures, rather than
limiting them based on some specified target architecture?
Since Sparse doesn't generate code, it can easily target all
architectures simultaneously, but that doesn't mean we couldn't tell it
what architecture to target. Sparse could default to targeting the
host architecture, which would avoid the need to pass extra flags in the
common case.
- Josh Triplett
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] parser: add Blackfin gcc info
2010-10-05 16:18 ` Josh Triplett
@ 2010-10-06 1:34 ` Mike Frysinger
2010-10-06 2:33 ` Christopher Li
2010-10-06 7:05 ` Josh Triplett
0 siblings, 2 replies; 11+ messages in thread
From: Mike Frysinger @ 2010-10-06 1:34 UTC (permalink / raw)
To: Josh Triplett; +Cc: linux-sparse, michael.hennerich
[-- Attachment #1: Type: Text/Plain, Size: 1037 bytes --]
On Tuesday, October 05, 2010 12:18:30 Josh Triplett wrote:
> On Tue, Oct 05, 2010 at 04:34:30AM -0400, Mike Frysinger wrote:
> > The Blackfin port uses some custom attributes to control memory
> > placement, and it has some custom builtins. So add the ones that the
> > kernel actually utilizes to avoid massive build errors with sparse.
>
> I wonder, does it make sense to support these kinds of
> architecture-specific builtins on all architectures, rather than
> limiting them based on some specified target architecture?
>
> Since Sparse doesn't generate code, it can easily target all
> architectures simultaneously, but that doesn't mean we couldn't tell it
> what architecture to target. Sparse could default to targeting the
> host architecture, which would avoid the need to pass extra flags in the
> common case.
it does sound like it'd be useful to add an arch command line option. but i
hoped we could sneak in the Blackfin stuff first since other arches (like
alpha) have been whitelisted.
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] parser: add Blackfin gcc info
2010-10-06 1:34 ` Mike Frysinger
@ 2010-10-06 2:33 ` Christopher Li
2010-10-06 5:38 ` Mike Frysinger
2010-10-06 7:05 ` Josh Triplett
1 sibling, 1 reply; 11+ messages in thread
From: Christopher Li @ 2010-10-06 2:33 UTC (permalink / raw)
To: Mike Frysinger; +Cc: Josh Triplett, linux-sparse, michael.hennerich
On Tue, Oct 5, 2010 at 6:34 PM, Mike Frysinger <vapier@gentoo.org> wrote:
>> I wonder, does it make sense to support these kinds of
>> architecture-specific builtins on all architectures, rather than
>> limiting them based on some specified target architecture?
>>
>> Since Sparse doesn't generate code, it can easily target all
>> architectures simultaneously, but that doesn't mean we couldn't tell it
>> what architecture to target. Sparse could default to targeting the
>> host architecture, which would avoid the need to pass extra flags in the
>> common case.
>
> it does sound like it'd be useful to add an arch command line option. but i
> hoped we could sneak in the Blackfin stuff first since other arches (like
> alpha) have been whitelisted.
Can we have some "ifdef" for the blackfin architecture in the pre buffer?
I agree with Josh, that do look like very much blackfin specific. We can leave
the ignore attribute alone for now.
Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] parser: add Blackfin gcc info
2010-10-06 2:33 ` Christopher Li
@ 2010-10-06 5:38 ` Mike Frysinger
2010-10-06 7:10 ` Josh Triplett
0 siblings, 1 reply; 11+ messages in thread
From: Mike Frysinger @ 2010-10-06 5:38 UTC (permalink / raw)
To: Christopher Li; +Cc: Josh Triplett, linux-sparse, michael.hennerich
[-- Attachment #1: Type: Text/Plain, Size: 1618 bytes --]
On Tuesday, October 05, 2010 22:33:21 Christopher Li wrote:
> On Tue, Oct 5, 2010 at 6:34 PM, Mike Frysinger wrote:
> >> I wonder, does it make sense to support these kinds of
> >> architecture-specific builtins on all architectures, rather than
> >> limiting them based on some specified target architecture?
> >>
> >> Since Sparse doesn't generate code, it can easily target all
> >> architectures simultaneously, but that doesn't mean we couldn't tell it
> >> what architecture to target. Sparse could default to targeting the
> >> host architecture, which would avoid the need to pass extra flags in the
> >> common case.
> >
> > it does sound like it'd be useful to add an arch command line option.
> > but i hoped we could sneak in the Blackfin stuff first since other
> > arches (like alpha) have been whitelisted.
>
> Can we have some "ifdef" for the blackfin architecture in the pre buffer?
> I agree with Josh, that do look like very much blackfin specific. We can
> leave the ignore attribute alone for now.
how would #ifdefs help ? i'm not building sparse for a Blackfin arch, host or
target wise. if there's something more, you'd have to be specific as to what
you mean, otherwise i wont be able to send an updated patch.
yes, these things are completely Blackfin specific, but i dont see how that's
a barrier for entry when both attributes and the builtin ignore lists contain
completely architecture specific stuff without any #ifdef logic. using sparse
on the Linux kernel for the Blackfin port is pretty useless atm because of
these missing pieces.
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] parser: add Blackfin gcc info
2010-10-06 5:38 ` Mike Frysinger
@ 2010-10-06 7:10 ` Josh Triplett
2010-10-06 8:40 ` Christopher Li
2010-10-06 16:32 ` Mike Frysinger
0 siblings, 2 replies; 11+ messages in thread
From: Josh Triplett @ 2010-10-06 7:10 UTC (permalink / raw)
To: Mike Frysinger; +Cc: Christopher Li, linux-sparse, michael.hennerich
On Wed, Oct 06, 2010 at 01:38:02AM -0400, Mike Frysinger wrote:
> On Tuesday, October 05, 2010 22:33:21 Christopher Li wrote:
> > On Tue, Oct 5, 2010 at 6:34 PM, Mike Frysinger wrote:
> > >> I wonder, does it make sense to support these kinds of
> > >> architecture-specific builtins on all architectures, rather than
> > >> limiting them based on some specified target architecture?
> > >>
> > >> Since Sparse doesn't generate code, it can easily target all
> > >> architectures simultaneously, but that doesn't mean we couldn't tell it
> > >> what architecture to target. Sparse could default to targeting the
> > >> host architecture, which would avoid the need to pass extra flags in the
> > >> common case.
> > >
> > > it does sound like it'd be useful to add an arch command line option.
> > > but i hoped we could sneak in the Blackfin stuff first since other
> > > arches (like alpha) have been whitelisted.
> >
> > Can we have some "ifdef" for the blackfin architecture in the pre buffer?
> > I agree with Josh, that do look like very much blackfin specific. We can
> > leave the ignore attribute alone for now.
>
> how would #ifdefs help ? i'm not building sparse for a Blackfin arch, host or
> target wise. if there's something more, you'd have to be specific as to what
> you mean, otherwise i wont be able to send an updated patch.
I suspect that Chris meant that you could add_pre_buffer an #ifdef and
#endif surrounding the #define, so that the #define would only take
effect if Sparse (or the command-line options passed by cgcc or Linux)
defined some appropriate architecture-specific symbol for Blackfin.
> yes, these things are completely Blackfin specific, but i dont see how that's
> a barrier for entry when both attributes and the builtin ignore lists contain
> completely architecture specific stuff without any #ifdef logic. using sparse
> on the Linux kernel for the Blackfin port is pretty useless atm because of
> these missing pieces.
Agreed. At this point, it seems best to allow the Blackfin bits in to
fix the immediate problem, and independently fix the general problem and
apply the solution to all the arch-specific bits at once. It certainly
seems unfair to single out Blackfin here.
- Josh Triplett
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] parser: add Blackfin gcc info
2010-10-06 7:10 ` Josh Triplett
@ 2010-10-06 8:40 ` Christopher Li
2010-10-06 14:52 ` Mike Frysinger
2010-10-06 16:32 ` Mike Frysinger
1 sibling, 1 reply; 11+ messages in thread
From: Christopher Li @ 2010-10-06 8:40 UTC (permalink / raw)
To: Josh Triplett; +Cc: Mike Frysinger, linux-sparse, michael.hennerich
On Wed, Oct 6, 2010 at 12:10 AM, Josh Triplett <josh@joshtriplett.org> wrote:
>> > Can we have some "ifdef" for the blackfin architecture in the pre buffer?
>> > I agree with Josh, that do look like very much blackfin specific. We can
>> > leave the ignore attribute alone for now.
>>
>> how would #ifdefs help ? i'm not building sparse for a Blackfin arch, host or
>> target wise. if there's something more, you'd have to be specific as to what
>> you mean, otherwise i wont be able to send an updated patch.
>
> I suspect that Chris meant that you could add_pre_buffer an #ifdef and
> #endif surrounding the #define, so that the #define would only take
> effect if Sparse (or the command-line options passed by cgcc or Linux)
> defined some appropriate architecture-specific symbol for Blackfin.
Thanks for the clarification. The pre buffer is just a build in piece of the
header file. You can still use #ifdef inside the pre buffer. I just don't want
those blackfin specific declare show up in every other platform
>> yes, these things are completely Blackfin specific, but i dont see how that's
>> a barrier for entry when both attributes and the builtin ignore lists contain
>> completely architecture specific stuff without any #ifdef logic. using sparse
>> on the Linux kernel for the Blackfin port is pretty useless atm because of
>> these missing pieces.
No, I don't mean that is a deal breaker. That is some thing nice to have.
Do you know any typical architecture defined symbol to identify the blackfin
port? Some thing similar to __x86_64__. How does gcc know it is compiling
for a Blackfin port?
Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] parser: add Blackfin gcc info
2010-10-06 8:40 ` Christopher Li
@ 2010-10-06 14:52 ` Mike Frysinger
0 siblings, 0 replies; 11+ messages in thread
From: Mike Frysinger @ 2010-10-06 14:52 UTC (permalink / raw)
To: Christopher Li; +Cc: Josh Triplett, linux-sparse, michael.hennerich
[-- Attachment #1: Type: Text/Plain, Size: 1847 bytes --]
On Wednesday, October 06, 2010 04:40:09 Christopher Li wrote:
> On Wed, Oct 6, 2010 at 12:10 AM, Josh Triplett wrote:
> >> > Can we have some "ifdef" for the blackfin architecture in the pre
> >> > buffer? I agree with Josh, that do look like very much blackfin
> >> > specific. We can leave the ignore attribute alone for now.
> >>
> >> how would #ifdefs help ? i'm not building sparse for a Blackfin arch,
> >> host or target wise. if there's something more, you'd have to be
> >> specific as to what you mean, otherwise i wont be able to send an
> >> updated patch.
> >
> > I suspect that Chris meant that you could add_pre_buffer an #ifdef and
> > #endif surrounding the #define, so that the #define would only take
> > effect if Sparse (or the command-line options passed by cgcc or Linux)
> > defined some appropriate architecture-specific symbol for Blackfin.
>
> Thanks for the clarification. The pre buffer is just a build in piece of
> the header file. You can still use #ifdef inside the pre buffer. I just
> don't want those blackfin specific declare show up in every other platform
>
> >> yes, these things are completely Blackfin specific, but i dont see how
> >> that's a barrier for entry when both attributes and the builtin ignore
> >> lists contain completely architecture specific stuff without any #ifdef
> >> logic. using sparse on the Linux kernel for the Blackfin port is
> >> pretty useless atm because of these missing pieces.
>
> No, I don't mean that is a deal breaker. That is some thing nice to have.
> Do you know any typical architecture defined symbol to identify the
> blackfin port? Some thing similar to __x86_64__. How does gcc know it is
> compiling for a Blackfin port?
Blackfin's gcc always outputs __bfin__. i'll send an updated patch once i
test it out.
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] parser: add Blackfin gcc info
2010-10-06 7:10 ` Josh Triplett
2010-10-06 8:40 ` Christopher Li
@ 2010-10-06 16:32 ` Mike Frysinger
2010-10-06 21:14 ` Christopher Li
1 sibling, 1 reply; 11+ messages in thread
From: Mike Frysinger @ 2010-10-06 16:32 UTC (permalink / raw)
To: Josh Triplett; +Cc: Christopher Li, linux-sparse, michael.hennerich
[-- Attachment #1: Type: Text/Plain, Size: 1146 bytes --]
On Wednesday, October 06, 2010 03:10:19 Josh Triplett wrote:
> On Wed, Oct 06, 2010 at 01:38:02AM -0400, Mike Frysinger wrote:
> > On Tuesday, October 05, 2010 22:33:21 Christopher Li wrote:
> > > Can we have some "ifdef" for the blackfin architecture in the pre
> > > buffer? I agree with Josh, that do look like very much blackfin
> > > specific. We can leave the ignore attribute alone for now.
> >
> > how would #ifdefs help ? i'm not building sparse for a Blackfin arch,
> > host or target wise. if there's something more, you'd have to be
> > specific as to what you mean, otherwise i wont be able to send an
> > updated patch.
>
> I suspect that Chris meant that you could add_pre_buffer an #ifdef and
> #endif surrounding the #define, so that the #define would only take
> effect if Sparse (or the command-line options passed by cgcc or Linux)
> defined some appropriate architecture-specific symbol for Blackfin.
i guess sparse doesnt automatically propogate defines that gcc uses, so i'd
have to add "-D__bfin__" to CHECKFLAGS in arch/blackfin/Makefile. but that is
what people are expecting, right ?
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] parser: add Blackfin gcc info
2010-10-06 16:32 ` Mike Frysinger
@ 2010-10-06 21:14 ` Christopher Li
0 siblings, 0 replies; 11+ messages in thread
From: Christopher Li @ 2010-10-06 21:14 UTC (permalink / raw)
To: Mike Frysinger; +Cc: Josh Triplett, linux-sparse, michael.hennerich
On Wed, Oct 6, 2010 at 9:32 AM, Mike Frysinger <vapier@gentoo.org> wrote:
> i guess sparse doesnt automatically propogate defines that gcc uses, so i'd
> have to add "-D__bfin__" to CHECKFLAGS in arch/blackfin/Makefile. but that is
> what people are expecting, right ?
Right. Same for __x86_64__, you need to tell sparse about it. I think
in the future
sparse should take the architecture arguments and define it automatically.
In other words, we should move some of the cgcc logic into sparse. But that
is for later change.
Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] parser: add Blackfin gcc info
2010-10-06 1:34 ` Mike Frysinger
2010-10-06 2:33 ` Christopher Li
@ 2010-10-06 7:05 ` Josh Triplett
1 sibling, 0 replies; 11+ messages in thread
From: Josh Triplett @ 2010-10-06 7:05 UTC (permalink / raw)
To: Mike Frysinger; +Cc: linux-sparse, michael.hennerich
On Tue, Oct 05, 2010 at 09:34:41PM -0400, Mike Frysinger wrote:
> On Tuesday, October 05, 2010 12:18:30 Josh Triplett wrote:
> > On Tue, Oct 05, 2010 at 04:34:30AM -0400, Mike Frysinger wrote:
> > > The Blackfin port uses some custom attributes to control memory
> > > placement, and it has some custom builtins. So add the ones that the
> > > kernel actually utilizes to avoid massive build errors with sparse.
> >
> > I wonder, does it make sense to support these kinds of
> > architecture-specific builtins on all architectures, rather than
> > limiting them based on some specified target architecture?
> >
> > Since Sparse doesn't generate code, it can easily target all
> > architectures simultaneously, but that doesn't mean we couldn't tell it
> > what architecture to target. Sparse could default to targeting the
> > host architecture, which would avoid the need to pass extra flags in the
> > common case.
>
> it does sound like it'd be useful to add an arch command line option. but i
> hoped we could sneak in the Blackfin stuff first since other arches (like
> alpha) have been whitelisted.
Absolutely. I took the opportunity to raise the general problem, but
that doesn't mean that Blackfin should have to wait for the general
solution. :)
- Josh Triplett
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2010-10-06 21:14 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-05 8:34 [PATCH] parser: add Blackfin gcc info Mike Frysinger
2010-10-05 16:18 ` Josh Triplett
2010-10-06 1:34 ` Mike Frysinger
2010-10-06 2:33 ` Christopher Li
2010-10-06 5:38 ` Mike Frysinger
2010-10-06 7:10 ` Josh Triplett
2010-10-06 8:40 ` Christopher Li
2010-10-06 14:52 ` Mike Frysinger
2010-10-06 16:32 ` Mike Frysinger
2010-10-06 21:14 ` Christopher Li
2010-10-06 7:05 ` Josh Triplett
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 NNTP newsgroup(s).