* [PATCH] cgcc: teach cgcc about GNU/kFreeBSD
@ 2017-09-14 20:03 Uwe Kleine-König
2017-09-14 20:17 ` Uwe Kleine-König
` (4 more replies)
0 siblings, 5 replies; 13+ messages in thread
From: Uwe Kleine-König @ 2017-09-14 20:03 UTC (permalink / raw)
To: linux-sparse
---
cgcc | 3 +++
1 file changed, 3 insertions(+)
diff --git a/cgcc b/cgcc
index a8d7b4f217fe..0ab54f943578 100755
--- a/cgcc
+++ b/cgcc
@@ -235,6 +235,9 @@ sub add_specs {
} elsif ($spec eq 'linux') {
return &add_specs ('unix') .
' -D__linux__=1 -D__linux=1 -Dlinux=linux';
+ } elsif ($spec eq 'gnu/kfreebsd') {
+ return &add_specs ('unix') .
+ ' -D__FreeBSD_kernel__=1'
} elsif ($spec eq 'openbsd') {
return &add_specs ('unix') .
' -D__OpenBSD__=1';
--
2.14.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH] cgcc: teach cgcc about GNU/kFreeBSD
2017-09-14 20:03 [PATCH] cgcc: teach cgcc about GNU/kFreeBSD Uwe Kleine-König
@ 2017-09-14 20:17 ` Uwe Kleine-König
2017-09-15 5:09 ` Luc Van Oostenryck
2017-09-15 4:50 ` Luc Van Oostenryck
` (3 subsequent siblings)
4 siblings, 1 reply; 13+ messages in thread
From: Uwe Kleine-König @ 2017-09-14 20:17 UTC (permalink / raw)
To: linux-sparse
[-- Attachment #1: Type: text/plain, Size: 990 bytes --]
On Thu, Sep 14, 2017 at 10:03:27PM +0200, Uwe Kleine-König wrote:
> ---
> cgcc | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/cgcc b/cgcc
> index a8d7b4f217fe..0ab54f943578 100755
> --- a/cgcc
> +++ b/cgcc
> @@ -235,6 +235,9 @@ sub add_specs {
> } elsif ($spec eq 'linux') {
> return &add_specs ('unix') .
> ' -D__linux__=1 -D__linux=1 -Dlinux=linux';
> + } elsif ($spec eq 'gnu/kfreebsd') {
> + return &add_specs ('unix') .
> + ' -D__FreeBSD_kernel__=1'
> } elsif ($spec eq 'openbsd') {
> return &add_specs ('unix') .
> ' -D__OpenBSD__=1';
Alternatively to adding support for all platforms by hand, why not
use the output of
cpp -dM < /dev/null
to get the predefined macros? On my Linux amd64 box it gives quite a
list, but I think this doesn't hurt, does it?
Even
cpp -m32 -dM < /dev/null
works to give the i368 predefined macros (though I didn't find that in
the cpp manual).
Best regards
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] cgcc: teach cgcc about GNU/kFreeBSD
2017-09-14 20:03 [PATCH] cgcc: teach cgcc about GNU/kFreeBSD Uwe Kleine-König
2017-09-14 20:17 ` Uwe Kleine-König
@ 2017-09-15 4:50 ` Luc Van Oostenryck
2017-09-15 16:56 ` Chris Li
` (2 subsequent siblings)
4 siblings, 0 replies; 13+ messages in thread
From: Luc Van Oostenryck @ 2017-09-15 4:50 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: linux-sparse
On Thu, Sep 14, 2017 at 10:03:27PM +0200, Uwe Kleine-König wrote:
> ---
> cgcc | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/cgcc b/cgcc
> index a8d7b4f217fe..0ab54f943578 100755
> --- a/cgcc
> +++ b/cgcc
> @@ -235,6 +235,9 @@ sub add_specs {
> } elsif ($spec eq 'linux') {
> return &add_specs ('unix') .
> ' -D__linux__=1 -D__linux=1 -Dlinux=linux';
> + } elsif ($spec eq 'gnu/kfreebsd') {
> + return &add_specs ('unix') .
> + ' -D__FreeBSD_kernel__=1'
> } elsif ($spec eq 'openbsd') {
> return &add_specs ('unix') .
> ' -D__OpenBSD__=1';
Acked-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] cgcc: teach cgcc about GNU/kFreeBSD
2017-09-14 20:17 ` Uwe Kleine-König
@ 2017-09-15 5:09 ` Luc Van Oostenryck
0 siblings, 0 replies; 13+ messages in thread
From: Luc Van Oostenryck @ 2017-09-15 5:09 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: linux-sparse
On Thu, Sep 14, 2017 at 10:17:42PM +0200, Uwe Kleine-König wrote:
> On Thu, Sep 14, 2017 at 10:03:27PM +0200, Uwe Kleine-König wrote:
> > ---
> > cgcc | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/cgcc b/cgcc
> > index a8d7b4f217fe..0ab54f943578 100755
> > --- a/cgcc
> > +++ b/cgcc
> > @@ -235,6 +235,9 @@ sub add_specs {
> > } elsif ($spec eq 'linux') {
> > return &add_specs ('unix') .
> > ' -D__linux__=1 -D__linux=1 -Dlinux=linux';
> > + } elsif ($spec eq 'gnu/kfreebsd') {
> > + return &add_specs ('unix') .
> > + ' -D__FreeBSD_kernel__=1'
> > } elsif ($spec eq 'openbsd') {
> > return &add_specs ('unix') .
> > ' -D__OpenBSD__=1';
>
> Alternatively to adding support for all platforms by hand, why not
> use the output of
>
> cpp -dM < /dev/null
>
> to get the predefined macros? On my Linux amd64 box it gives quite a
> list, but I think this doesn't hurt, does it?
The problem I see by doing this is that some or lots of these
predefined macros mean, directly or not, "we support this feature"
while sparse in fact doesn't support it.
It already can create problems of defining the __GCC__/__GCC_MINOR__,
thus pretending to be this GCC version.
OTOH, I already begun to extend sparse's own predefined macros.
You can check it by looking at the output of:
sparse -E -dD - < /dev/null
So, I think it's best to:
- not adding the output of cpp -dM to cgcc
- continue to add to sparse itself any predefined macro
that would be needed
- for the moment, keep cgcc for dealing with arch specificities
- later we can add something like a '-m<arch>' flag to sparse itself
(but most probably we'll need to ue the full triplet, or use a config
file or ...)
Best regards,
-- Luc Van Oostenryck
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] cgcc: teach cgcc about GNU/kFreeBSD
2017-09-14 20:03 [PATCH] cgcc: teach cgcc about GNU/kFreeBSD Uwe Kleine-König
2017-09-14 20:17 ` Uwe Kleine-König
2017-09-15 4:50 ` Luc Van Oostenryck
@ 2017-09-15 16:56 ` Chris Li
2017-09-16 7:50 ` Luc Van Oostenryck
2017-09-19 12:25 ` Chris Li
2017-09-20 15:10 ` [PATCH v2] " Uwe Kleine-König
4 siblings, 1 reply; 13+ messages in thread
From: Chris Li @ 2017-09-15 16:56 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: Linux-Sparse
On Thu, Sep 14, 2017 at 4:03 PM, Uwe Kleine-König <uwe@kleine-koenig.org> wrote:
> + } elsif ($spec eq 'gnu/kfreebsd') {
> + return &add_specs ('unix') .
> + ' -D__FreeBSD_kernel__=1'
This looks good. I will apply it.
I don't have FreeBSD to test it though. I assume you do
the sufficient testing on it already. It can't be any worse any way.
Thanks for the patch.
Chris
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] cgcc: teach cgcc about GNU/kFreeBSD
2017-09-15 16:56 ` Chris Li
@ 2017-09-16 7:50 ` Luc Van Oostenryck
2017-09-16 13:57 ` Uwe Kleine-König
0 siblings, 1 reply; 13+ messages in thread
From: Luc Van Oostenryck @ 2017-09-16 7:50 UTC (permalink / raw)
To: Chris Li; +Cc: Uwe Kleine-König, Linux-Sparse
On Fri, Sep 15, 2017 at 6:56 PM, Chris Li <christ.li@gmail.com> wrote:
> On Thu, Sep 14, 2017 at 4:03 PM, Uwe Kleine-König <uwe@kleine-koenig.org> wrote:
>> + } elsif ($spec eq 'gnu/kfreebsd') {
>> + return &add_specs ('unix') .
>> + ' -D__FreeBSD_kernel__=1'
>
> This looks good. I will apply it.
> I don't have FreeBSD to test it though.
FYI, this is not really FreeBSD, it's Debian's GNU/kFreeBSD:
GNU for userland with a FreeBSD kernel.
> I assume you do
> the sufficient testing on it already.
Yes, my point of view too.
-- Luc
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] cgcc: teach cgcc about GNU/kFreeBSD
2017-09-16 7:50 ` Luc Van Oostenryck
@ 2017-09-16 13:57 ` Uwe Kleine-König
0 siblings, 0 replies; 13+ messages in thread
From: Uwe Kleine-König @ 2017-09-16 13:57 UTC (permalink / raw)
To: Luc Van Oostenryck; +Cc: Chris Li, Linux-Sparse
[-- Attachment #1: Type: text/plain, Size: 1052 bytes --]
On Sat, Sep 16, 2017 at 09:50:07AM +0200, Luc Van Oostenryck wrote:
> On Fri, Sep 15, 2017 at 6:56 PM, Chris Li <christ.li@gmail.com> wrote:
> > On Thu, Sep 14, 2017 at 4:03 PM, Uwe Kleine-König <uwe@kleine-koenig.org> wrote:
> >> + } elsif ($spec eq 'gnu/kfreebsd') {
> >> + return &add_specs ('unix') .
> >> + ' -D__FreeBSD_kernel__=1'
> >
> > This looks good. I will apply it.
> > I don't have FreeBSD to test it though.
>
> FYI, this is not really FreeBSD, it's Debian's GNU/kFreeBSD:
> GNU for userland with a FreeBSD kernel.
ack
> > I assume you do
> > the sufficient testing on it already.
>
> Yes, my point of view too.
FTR: The difference is:
(sid_k-a-dchroot)ukleinek@falla:~/sparse$ PATH=.:$PATH ./cgcc -c flow.c
(sid_k-a-dchroot)ukleinek@falla:~/sparse$
with the patch applied vs
(sid_k-a-dchroot)ukleinek@falla:~/sparse$ PATH=.:$PATH ./cgcc -c flow.c
./cgcc: invalid specs: gnu/kfreebsd
(sid_k-a-dchroot)ukleinek@falla:~/sparse$
in the current state.
Best regards
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] cgcc: teach cgcc about GNU/kFreeBSD
2017-09-14 20:03 [PATCH] cgcc: teach cgcc about GNU/kFreeBSD Uwe Kleine-König
` (2 preceding siblings ...)
2017-09-15 16:56 ` Chris Li
@ 2017-09-19 12:25 ` Chris Li
2017-09-19 14:41 ` Uwe Kleine-König
2017-09-20 15:10 ` [PATCH v2] " Uwe Kleine-König
4 siblings, 1 reply; 13+ messages in thread
From: Chris Li @ 2017-09-19 12:25 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: Linux-Sparse
On Thu, Sep 14, 2017 at 4:03 PM, Uwe Kleine-König <uwe@kleine-koenig.org> wrote:
> ---
> cgcc | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/cgcc b/cgcc
> index a8d7b4f217fe..0ab54f943578 100755
> --- a/cgcc
> +++ b/cgcc
> @@ -235,6 +235,9 @@ sub add_specs {
> } elsif ($spec eq 'linux') {
> return &add_specs ('unix') .
> ' -D__linux__=1 -D__linux=1 -Dlinux=linux';
> + } elsif ($spec eq 'gnu/kfreebsd') {
> + return &add_specs ('unix') .
> + ' -D__FreeBSD_kernel__=1'
Catching up my back logs. I just find out that this patch
is missing a SOB. Send you send one to the mailing list?
Thanks
Chris
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] cgcc: teach cgcc about GNU/kFreeBSD
2017-09-19 12:25 ` Chris Li
@ 2017-09-19 14:41 ` Uwe Kleine-König
2017-09-19 15:15 ` Chris Li
0 siblings, 1 reply; 13+ messages in thread
From: Uwe Kleine-König @ 2017-09-19 14:41 UTC (permalink / raw)
To: Chris Li; +Cc: Linux-Sparse
[-- Attachment #1.1: Type: text/plain, Size: 973 bytes --]
Hello Chris,
On 09/19/2017 02:25 PM, Chris Li wrote:
> On Thu, Sep 14, 2017 at 4:03 PM, Uwe Kleine-König <uwe@kleine-koenig.org> wrote:
>> ---
>> cgcc | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/cgcc b/cgcc
>> index a8d7b4f217fe..0ab54f943578 100755
>> --- a/cgcc
>> +++ b/cgcc
>> @@ -235,6 +235,9 @@ sub add_specs {
>> } elsif ($spec eq 'linux') {
>> return &add_specs ('unix') .
>> ' -D__linux__=1 -D__linux=1 -Dlinux=linux';
>> + } elsif ($spec eq 'gnu/kfreebsd') {
>> + return &add_specs ('unix') .
>> + ' -D__FreeBSD_kernel__=1'
>
> Catching up my back logs. I just find out that this patch
> is missing a SOB. Send you send one to the mailing list?
I didn't add a Sob on purpose. It is not specified what this means and I
refuse follow an unformalized formalism. Without a respective document
in sparse I really doubt it has any significance anyhow.
Best regards
Uwe
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] cgcc: teach cgcc about GNU/kFreeBSD
2017-09-19 14:41 ` Uwe Kleine-König
@ 2017-09-19 15:15 ` Chris Li
2017-09-19 17:33 ` Uwe Kleine-König
0 siblings, 1 reply; 13+ messages in thread
From: Chris Li @ 2017-09-19 15:15 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: Linux-Sparse
On Tue, Sep 19, 2017 at 10:41 AM, Uwe Kleine-König
<uwe@kleine-koenig.org> wrote:
> I didn't add a Sob on purpose. It is not specified what this means and I
> refuse follow an unformalized formalism. Without a respective document
> in sparse I really doubt it has any significance anyhow.
It did in sparse Documentation/submitting-patches.md.
Chris
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] cgcc: teach cgcc about GNU/kFreeBSD
2017-09-19 15:15 ` Chris Li
@ 2017-09-19 17:33 ` Uwe Kleine-König
2017-09-20 4:45 ` Chris Li
0 siblings, 1 reply; 13+ messages in thread
From: Uwe Kleine-König @ 2017-09-19 17:33 UTC (permalink / raw)
To: Chris Li; +Cc: Linux-Sparse
[-- Attachment #1.1: Type: text/plain, Size: 609 bytes --]
On 09/19/2017 05:15 PM, Chris Li wrote:
> On Tue, Sep 19, 2017 at 10:41 AM, Uwe Kleine-König
> <uwe@kleine-koenig.org> wrote:
>> I didn't add a Sob on purpose. It is not specified what this means and I
>> refuse follow an unformalized formalism. Without a respective document
>> in sparse I really doubt it has any significance anyhow.
>
> It did in sparse Documentation/submitting-patches.md.
ah, I missed that. (I wonder if it is sensible to just link to the
respective kernel stuff instead of copying that verbatim into sparse,
but I don't really care.)
I can resend accordingly
Uwe
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] cgcc: teach cgcc about GNU/kFreeBSD
2017-09-19 17:33 ` Uwe Kleine-König
@ 2017-09-20 4:45 ` Chris Li
0 siblings, 0 replies; 13+ messages in thread
From: Chris Li @ 2017-09-20 4:45 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: Linux-Sparse
On Tue, Sep 19, 2017 at 1:33 PM, Uwe Kleine-König <uwe@kleine-koenig.org> wrote:
>> It did in sparse Documentation/submitting-patches.md.
>
> ah, I missed that. (I wonder if it is sensible to just link to the
> respective kernel stuff instead of copying that verbatim into sparse,
> but I don't really care.)
Maybe. The kernel is GPL and sparse is MIT licensed.
If I copy the text, I need to make special case for the license of
that document under GPL. It is doable that way as well.
I just take the lazy route link to the kernel documents.
> I can resend accordingly
Send just the SOB line is good enough. You don't have to
re-create the patch.
Chris
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v2] cgcc: teach cgcc about GNU/kFreeBSD
2017-09-14 20:03 [PATCH] cgcc: teach cgcc about GNU/kFreeBSD Uwe Kleine-König
` (3 preceding siblings ...)
2017-09-19 12:25 ` Chris Li
@ 2017-09-20 15:10 ` Uwe Kleine-König
4 siblings, 0 replies; 13+ messages in thread
From: Uwe Kleine-König @ 2017-09-20 15:10 UTC (permalink / raw)
To: linux-sparse
Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
---
Changes in v2:
- add a Sob line
- add a missing ;
cgcc | 3 +++
1 file changed, 3 insertions(+)
diff --git a/cgcc b/cgcc
index a8d7b4f217fe..95d70efc11c5 100755
--- a/cgcc
+++ b/cgcc
@@ -235,6 +235,9 @@ sub add_specs {
} elsif ($spec eq 'linux') {
return &add_specs ('unix') .
' -D__linux__=1 -D__linux=1 -Dlinux=linux';
+ } elsif ($spec eq 'gnu/kfreebsd') {
+ return &add_specs ('unix') .
+ ' -D__FreeBSD_kernel__=1';
} elsif ($spec eq 'openbsd') {
return &add_specs ('unix') .
' -D__OpenBSD__=1';
--
2.14.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
end of thread, other threads:[~2017-09-20 15:10 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-14 20:03 [PATCH] cgcc: teach cgcc about GNU/kFreeBSD Uwe Kleine-König
2017-09-14 20:17 ` Uwe Kleine-König
2017-09-15 5:09 ` Luc Van Oostenryck
2017-09-15 4:50 ` Luc Van Oostenryck
2017-09-15 16:56 ` Chris Li
2017-09-16 7:50 ` Luc Van Oostenryck
2017-09-16 13:57 ` Uwe Kleine-König
2017-09-19 12:25 ` Chris Li
2017-09-19 14:41 ` Uwe Kleine-König
2017-09-19 15:15 ` Chris Li
2017-09-19 17:33 ` Uwe Kleine-König
2017-09-20 4:45 ` Chris Li
2017-09-20 15:10 ` [PATCH v2] " Uwe Kleine-König
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).