linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Linux Kernel include files
@ 2007-06-21 22:32 Joerg Schilling
  2007-06-21 23:25 ` david
  2007-06-21 23:47 ` Arjan van de Ven
  0 siblings, 2 replies; 72+ messages in thread
From: Joerg Schilling @ 2007-06-21 22:32 UTC (permalink / raw)
  To: schilling; +Cc: linux-kernel


Hi all,

you might know that since ~ 2 years, the Sun Studio compilers
are available for Linux. Given the fact that they typically produce
faster code than GCC and that they offer more debug/optimizing features,
they are worth testing.

While it is no problem to use Sun Studio for non-Linux-specific programs,
it is impossible to compile programs using Sun Studio if these programs offer
Linux specific features.

Star ftp://ftp.berlios.de/pub/star/alpha/ offers support for archiving ext2
file flags. If star is compiled using Sun Studio, star's autoconfiguration will 
disable support for the Linux specific features because it detects "broken" 
include files.

Cdrtools ftp://ftp.berlios.de/pub/cdrecord/alpha/ offer support for an OS 
dependent SCSI transport. Cdrtools cannot be compiled wihout support for SCSI 
transport, so it is impossible to use Sun Studio to compile cdrtools.

Why does this happen?

Well, the reason is that in order to support Linux specific features, you need 
to include Linux specific include files (the Linux kernel include files). As 
these include files are currently not written in vanilla (ANSI) C but in a 
GCC-C-variant, other compilers do not like these include files.

Is there some hope that at least the Linux kernel interface definition files and
everything recursively included from these files will be rewritten in vanilla 
ANSI C?

Jörg

-- 
 EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
       js@cs.tu-berlin.de                (uni)  
       schilling@fokus.fraunhofer.de     (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-21 22:32 Linux Kernel include files Joerg Schilling
@ 2007-06-21 23:25 ` david
  2007-06-21 23:38   ` Joerg Schilling
                     ` (2 more replies)
  2007-06-21 23:47 ` Arjan van de Ven
  1 sibling, 3 replies; 72+ messages in thread
From: david @ 2007-06-21 23:25 UTC (permalink / raw)
  To: Joerg Schilling; +Cc: schilling, linux-kernel

On Fri, 22 Jun 2007, Joerg Schilling wrote:

> Is there some hope that at least the Linux kernel interface definition files and
> everything recursively included from these files will be rewritten in vanilla
> ANSI C?

this has been discussed many times and the answer is that the kernel is 
not gong to change it's side of things to ANSI C.

that doesn't mean that one of the many projects out there to create 
seperate interface headers won't do this.

however, there is another interesting thing going on at the moment. The 
standards commity is currently deciding what will be in the next rev of 
the C specs (tentitivly labels C1x for discussions, they are hopeing to 
release them in '09 or '10)

some of the things that are GCC extentions are going to be added to the 
spec (ahtough possibly with a change to the syntax)

so now is the time to talk to your local reps who go to these meetings and 
make your suggestions for what should be added to the standard and what 
should not be.

remember that anything to be added must be implemented somehwere, 
preferrably by multiple seperate compilers.

David Lang

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-21 23:25 ` david
@ 2007-06-21 23:38   ` Joerg Schilling
  2007-06-22  3:38     ` David Woodhouse
  2007-06-21 23:59   ` Arnd Bergmann
  2007-06-25 14:48   ` Joerg Schilling
  2 siblings, 1 reply; 72+ messages in thread
From: Joerg Schilling @ 2007-06-21 23:38 UTC (permalink / raw)
  To: david; +Cc: schilling, linux-kernel

david@lang.hm wrote:

> On Fri, 22 Jun 2007, Joerg Schilling wrote:
>
> > Is there some hope that at least the Linux kernel interface definition files and
> > everything recursively included from these files will be rewritten in vanilla
> > ANSI C?
>
> this has been discussed many times and the answer is that the kernel is 
> not gong to change it's side of things to ANSI C.
>
> that doesn't mean that one of the many projects out there to create 
> seperate interface headers won't do this.

The main problems are not really hard to fix......

-	Most problems eem to be related to the fact that Linux does not
	use C-99 based types in the kernel and the related type definitions 
	are not written in plain C. This is something that should be fixed
	with a source consolidation program or by defining aliases to 
	C-99 types in case the compiler is not GCC.

-	Other problems are caused by additional tag definitions that could
	be disabled in case of a non-GCC compile.

Jörg

-- 
 EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
       js@cs.tu-berlin.de                (uni)  
       schilling@fokus.fraunhofer.de     (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-21 22:32 Linux Kernel include files Joerg Schilling
  2007-06-21 23:25 ` david
@ 2007-06-21 23:47 ` Arjan van de Ven
  2007-06-25 14:53   ` Joerg Schilling
  1 sibling, 1 reply; 72+ messages in thread
From: Arjan van de Ven @ 2007-06-21 23:47 UTC (permalink / raw)
  To: Joerg Schilling; +Cc: schilling, linux-kernel


> Cdrtools ftp://ftp.berlios.de/pub/cdrecord/alpha/ offer support for an OS 
> dependent SCSI transport. Cdrtools cannot be compiled wihout support for SCSI 
> transport, so it is impossible to use Sun Studio to compile cdrtools.
> 
> Why does this happen?
> 
> Well, the reason is that in order to support Linux specific features, you need 
> to include Linux specific include files (the Linux kernel include files).


I assume you typoed and meant "cleaned up kernel include files as
installed by make headers_install" instead.

>  As 
> these include files are currently not written in vanilla (ANSI) C but in a 
> GCC-C-variant, other compilers do not like these include files.

can you give a specific example of a header installed by make
headers_install that breaks this way and is hurting you? Because it may
well be possible to fix the problems, now that we have this special
cleanup phase since several releases....



^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-21 23:25 ` david
  2007-06-21 23:38   ` Joerg Schilling
@ 2007-06-21 23:59   ` Arnd Bergmann
  2007-06-25 15:06     ` Joerg Schilling
  2007-06-25 14:48   ` Joerg Schilling
  2 siblings, 1 reply; 72+ messages in thread
From: Arnd Bergmann @ 2007-06-21 23:59 UTC (permalink / raw)
  To: david; +Cc: Joerg Schilling, schilling, linux-kernel, Mike Frysinger

On Friday 22 June 2007, david@lang.hm wrote:
> this has been discussed many times and the answer is that the kernel is 
> not gong to change it's side of things to ANSI C.

I don't think that's entirely true with regard to the include files.
We have always tried not to step on anyone's toes there, e.g. regarding
the use of __u32 vs. uint32_t style types. It's certainly desirable
to make the kernel headers that are _meant_ for inclusion compatible
with standard compilers.

Mike Frysinger has posted a few patches that make the installed headers
friendlier to strict C99 users. While there was some negative feedback
about these patches, it was not about the idea of making the installed
headers C99 clean, but rather about the question whether those non-clean
parts should be exported in the first place.

Now whether a specific header file should be installed and potentially
included in user space is certainly debatable in many cases, but at
least it's now clearly defined through the include/*/Kbuild files.
If someone has a good reason to change which files are exported, he
should simply submit a patch against the list of exported files.

> that doesn't mean that one of the many projects out there to create 
> seperate interface headers won't do this.

Those projects are all practically dead, since we have the
'make headers_install' target in the Linux source.

	Arnd <><

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-21 23:38   ` Joerg Schilling
@ 2007-06-22  3:38     ` David Woodhouse
  2007-06-22  5:18       ` H. Peter Anvin
                         ` (2 more replies)
  0 siblings, 3 replies; 72+ messages in thread
From: David Woodhouse @ 2007-06-22  3:38 UTC (permalink / raw)
  To: Joerg Schilling; +Cc: david, schilling, linux-kernel

On Fri, 2007-06-22 at 01:38 +0200, Joerg Schilling wrote:
> The main problems are not really hard to fix......
> 
> -	Most problems eem to be related to the fact that Linux does not
> 	use C-99 based types in the kernel and the related type definitions 
> 	are not written in plain C. This is something that should be fixed
> 	with a source consolidation program or by defining aliases to 
> 	C-99 types in case the compiler is not GCC.


The argument has been made that the standard C99 types are _optional_,
and anything included from a C library's headers without _explicitly_
being included by the user shouldn't define those types.

Personally, I think that's a load of bollocks. And it certainly doesn't
apply to Linux-specific files like <linux/cdrom.h>, which are perfectly
entitled to use a C standard from last millennium, regardless of
namespace 'pollution' issues. That's why we continue to use the crappy
__u32 types. Can you be more specific about why this is a problem? Don't
we mostly define those crappy types using arch-specific knowledge, as
'int', 'long', etc?

> -	Other problems are caused by additional tag definitions that could
> 	be disabled in case of a non-GCC compile.

We mostly try to remove this from user-visible parts of exported
headers. Sometimes we just remove it altogether; other bits are stripped
at export time when you run 'make headers_install'. Again, can you be
more specific about the problem?

-- 
dwmw2


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-22  3:38     ` David Woodhouse
@ 2007-06-22  5:18       ` H. Peter Anvin
  2007-06-22 15:00       ` Adrian Bunk
  2007-06-25 15:17       ` Joerg Schilling
  2 siblings, 0 replies; 72+ messages in thread
From: H. Peter Anvin @ 2007-06-22  5:18 UTC (permalink / raw)
  To: David Woodhouse; +Cc: Joerg Schilling, david, schilling, linux-kernel

David Woodhouse wrote:
>> The main problems are not really hard to fix......
>>
>> -	Most problems eem to be related to the fact that Linux does not
>> 	use C-99 based types in the kernel and the related type definitions 
>> 	are not written in plain C. This is something that should be fixed
>> 	with a source consolidation program or by defining aliases to 
>> 	C-99 types in case the compiler is not GCC.
> 
> 
> The argument has been made that the standard C99 types are _optional_,
> and anything included from a C library's headers without _explicitly_
> being included by the user shouldn't define those types.
> 
> Personally, I think that's a load of bollocks. And it certainly doesn't
> apply to Linux-specific files like <linux/cdrom.h>, which are perfectly
> entitled to use a C standard from last millennium, regardless of
> namespace 'pollution' issues. That's why we continue to use the crappy
> __u32 types. Can you be more specific about why this is a problem? Don't
> we mostly define those crappy types using arch-specific knowledge, as
> 'int', 'long', etc?
> 

It definitely does hurt when using those types in files that may want to
be used by the C library (as opposed to the end user.)

However, there is no reason why there should be anything funny about the
declaration of those types.

	-hpa

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-22  3:38     ` David Woodhouse
  2007-06-22  5:18       ` H. Peter Anvin
@ 2007-06-22 15:00       ` Adrian Bunk
  2007-06-26 15:26         ` H. Peter Anvin
  2007-06-27  1:32         ` Kyle Moffett
  2007-06-25 15:17       ` Joerg Schilling
  2 siblings, 2 replies; 72+ messages in thread
From: Adrian Bunk @ 2007-06-22 15:00 UTC (permalink / raw)
  To: David Woodhouse; +Cc: Joerg Schilling, david, schilling, linux-kernel

On Fri, Jun 22, 2007 at 11:38:47AM +0800, David Woodhouse wrote:
> On Fri, 2007-06-22 at 01:38 +0200, Joerg Schilling wrote:
> > The main problems are not really hard to fix......
> > 
> > -	Most problems eem to be related to the fact that Linux does not
> > 	use C-99 based types in the kernel and the related type definitions 
> > 	are not written in plain C. This is something that should be fixed
> > 	with a source consolidation program or by defining aliases to 
> > 	C-99 types in case the compiler is not GCC.
> 
> 
> The argument has been made that the standard C99 types are _optional_,
> and anything included from a C library's headers without _explicitly_
> being included by the user shouldn't define those types.
> 
> Personally, I think that's a load of bollocks. And it certainly doesn't
> apply to Linux-specific files like <linux/cdrom.h>, which are perfectly
> entitled to use a C standard from last millennium, regardless of
> namespace 'pollution' issues. That's why we continue to use the crappy
> __u32 types. Can you be more specific about why this is a problem? Don't
> we mostly define those crappy types using arch-specific knowledge, as
> 'int', 'long', etc?
>...

It would certainly help if Joerg would tell what exactly breaks, but I 
spot one likely problem in include/asm-i386/types.h:

#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
typedef __signed__ long long __s64;
typedef unsigned long long __u64;
#endif

It might make sense to remove the #if and simply require that
a C compiler under Linux must know about the C99 "long long"?

> dwmw2

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-21 23:25 ` david
  2007-06-21 23:38   ` Joerg Schilling
  2007-06-21 23:59   ` Arnd Bergmann
@ 2007-06-25 14:48   ` Joerg Schilling
  2 siblings, 0 replies; 72+ messages in thread
From: Joerg Schilling @ 2007-06-25 14:48 UTC (permalink / raw)
  To: david; +Cc: schilling, linux-kernel

david@lang.hm wrote:

> On Fri, 22 Jun 2007, Joerg Schilling wrote:
>
> > Is there some hope that at least the Linux kernel interface definition files and
> > everything recursively included from these files will be rewritten in vanilla
> > ANSI C?
>
> this has been discussed many times and the answer is that the kernel is 
> not gong to change it's side of things to ANSI C.

Well, there is no need to go to ANSI C as pre-ANSI would to it also.
The problem is non ANSI gcc extensions.

> that doesn't mean that one of the many projects out there to create 
> seperate interface headers won't do this.
>
> however, there is another interesting thing going on at the moment. The 
> standards commity is currently deciding what will be in the next rev of 
> the C specs (tentitivly labels C1x for discussions, they are hopeing to 
> release them in '09 or '10)
>
> some of the things that are GCC extentions are going to be added to the 
> spec (ahtough possibly with a change to the syntax)

This may make sense after it did happen, but it does not help today.

> so now is the time to talk to your local reps who go to these meetings and 
> make your suggestions for what should be added to the standard and what 
> should not be.
>
> remember that anything to be added must be implemented somehwere, 
> preferrably by multiple seperate compilers.

Using plain C in the Linux kernel include files would be sufficient for all
compilers that make sense to be supported.


Jörg

-- 
 EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
       js@cs.tu-berlin.de                (uni)  
       schilling@fokus.fraunhofer.de     (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-21 23:47 ` Arjan van de Ven
@ 2007-06-25 14:53   ` Joerg Schilling
  2007-06-25 15:26     ` Arjan van de Ven
  2007-06-25 20:18     ` Sam Ravnborg
  0 siblings, 2 replies; 72+ messages in thread
From: Joerg Schilling @ 2007-06-25 14:53 UTC (permalink / raw)
  To: arjan; +Cc: schilling, linux-kernel

Arjan van de Ven <arjan@infradead.org> wrote:

>
> > Cdrtools ftp://ftp.berlios.de/pub/cdrecord/alpha/ offer support for an OS 
> > dependent SCSI transport. Cdrtools cannot be compiled wihout support for SCSI 
> > transport, so it is impossible to use Sun Studio to compile cdrtools.
> > 
> > Why does this happen?
> > 
> > Well, the reason is that in order to support Linux specific features, you need 
> > to include Linux specific include files (the Linux kernel include files).
>
>
> I assume you typoed and meant "cleaned up kernel include files as
> installed by make headers_install" instead.

I am thinking about kernel include files that do correct preincludes for
type-cleanness and that work if you use them without #defining __KERNEL_

> >  As 
> > these include files are currently not written in vanilla (ANSI) C but in a 
> > GCC-C-variant, other compilers do not like these include files.
>
> can you give a specific example of a header installed by make
> headers_install that breaks this way and is hurting you? Because it may
> well be possible to fix the problems, now that we have this special
> cleanup phase since several releases....

star needs "ext2_fs.h". This file is not usable at all on many Linux 
distributions, even with GCC.

libscg (cdrtools) needs "scsi/sg.h" but it currently includes a lot of other
files:

scsi-linux-sg.c:#include <linux/version.h>
scsi-linux-sg.c:#include <asm/types.h>
scsi-linux-sg.c:#include <scsi/scsi.h>
scsi-linux-sg.c:#include <linux/scsi.h>
scsi-linux-sg.c:#include <linux/fs.h>           /* From ancient versions, really needed? */
scsi-linux-sg.c:#include "block/blk.h"          /* From ancient versions, really needed? */
scsi-linux-sg.c:#include "scsi/scsi.h"
scsi-linux-sg.c:#include "scsi/sg.h"
scsi-linux-sg.c:#include <linux/cdrom.h>

If there wase _one_ clean SCSI pass through interface on Linux,
things would be a lot easier.....


Jörg

-- 
 EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
       js@cs.tu-berlin.de                (uni)  
       schilling@fokus.fraunhofer.de     (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-21 23:59   ` Arnd Bergmann
@ 2007-06-25 15:06     ` Joerg Schilling
  2007-06-25 16:00       ` david
  0 siblings, 1 reply; 72+ messages in thread
From: Joerg Schilling @ 2007-06-25 15:06 UTC (permalink / raw)
  To: david, arnd; +Cc: vapier.adi, schilling, linux-kernel

Arnd Bergmann <arnd@arndb.de> wrote:

> On Friday 22 June 2007, david@lang.hm wrote:
> > this has been discussed many times and the answer is that the kernel is 
> > not gong to change it's side of things to ANSI C.
>
> I don't think that's entirely true with regard to the include files.
> We have always tried not to step on anyone's toes there, e.g. regarding
> the use of __u32 vs. uint32_t style types. It's certainly desirable
> to make the kernel headers that are _meant_ for inclusion compatible
> with standard compilers.
>
> Mike Frysinger has posted a few patches that make the installed headers
> friendlier to strict C99 users. While there was some negative feedback
> about these patches, it was not about the idea of making the installed
> headers C99 clean, but rather about the question whether those non-clean
> parts should be exported in the first place.

Wouldn't it be simpler to ask the developers to deliver their include files
in a state that is clean for user space programs?

Jörg

-- 
 EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
       js@cs.tu-berlin.de                (uni)  
       schilling@fokus.fraunhofer.de     (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-22  3:38     ` David Woodhouse
  2007-06-22  5:18       ` H. Peter Anvin
  2007-06-22 15:00       ` Adrian Bunk
@ 2007-06-25 15:17       ` Joerg Schilling
  2007-06-25 15:27         ` David Woodhouse
  2 siblings, 1 reply; 72+ messages in thread
From: Joerg Schilling @ 2007-06-25 15:17 UTC (permalink / raw)
  To: dwmw2; +Cc: schilling, linux-kernel, david

David Woodhouse <dwmw2@infradead.org> wrote:

> On Fri, 2007-06-22 at 01:38 +0200, Joerg Schilling wrote:
> > The main problems are not really hard to fix......
> > 
> > -	Most problems eem to be related to the fact that Linux does not
> > 	use C-99 based types in the kernel and the related type definitions 
> > 	are not written in plain C. This is something that should be fixed
> > 	with a source consolidation program or by defining aliases to 
> > 	C-99 types in case the compiler is not GCC.
>
>
> The argument has been made that the standard C99 types are _optional_,
> and anything included from a C library's headers without _explicitly_
> being included by the user shouldn't define those types.

????

This uses double negation and is close to unreadable.

A kernel include file that defines an interface to a user space program
should be self containing (that means that all includes for all non-standard
types should be done inside these include files). Whether or not C-99 
types are used or not is less important than to use type definitions written 
in clean C so compilers other than gcc may use them.

> Personally, I think that's a load of bollocks. And it certainly doesn't
> apply to Linux-specific files like <linux/cdrom.h>, which are perfectly
> entitled to use a C standard from last millennium, regardless of
> namespace 'pollution' issues. That's why we continue to use the crappy
> __u32 types. Can you be more specific about why this is a problem? Don't
> we mostly define those crappy types using arch-specific knowledge, as
> 'int', 'long', etc?

I recommend you to install Sun Studio and to try to compile star or cdrtools
using Sun Studio by calling "make CCOM_suncc".

ftp://ftp.berlios.de/pub/star/alpha/
ftp://ftp.berlios.de/pub/cdrecord/alpha/

You may need to hand edit the file incs/<arch-dir>/{xconfig.h!rules.conf}

in order to enable the auto-disabled features.

In any case, self reading the error messages from Sun Studio helps more than
trying to discuss it.

Jörg

-- 
 EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
       js@cs.tu-berlin.de                (uni)  
       schilling@fokus.fraunhofer.de     (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-25 14:53   ` Joerg Schilling
@ 2007-06-25 15:26     ` Arjan van de Ven
  2007-06-25 15:27       ` Robert P. J. Day
  2007-06-25 20:18     ` Sam Ravnborg
  1 sibling, 1 reply; 72+ messages in thread
From: Arjan van de Ven @ 2007-06-25 15:26 UTC (permalink / raw)
  To: Joerg Schilling; +Cc: schilling, linux-kernel


> > I assume you typoed and meant "cleaned up kernel include files as
> > installed by make headers_install" instead.
> 
> I am thinking about kernel include files that do correct preincludes for
> type-cleanness and that work if you use them without #defining __KERNEL_

there is no __KERNEL__ in the "make headers_install"'d kernel headers.
And they are more or less sanity checked (no sanity check is complete
obviously) against certain common errors already (like including headers
that aren't installed).

if sanity checks are missing (and you seem to imply they do) then I'm
sure David welcomes suggestions for new sanity checks.
> > can you give a specific example of a header installed by make
> > headers_install that breaks this way and is hurting you? Because it may
> > well be possible to fix the problems, now that we have this special
> > cleanup phase since several releases....
> 
> star needs "ext2_fs.h". This file is not usable at all on many Linux 
> distributions, even with GCC.

oh I thought we were talking about the kernel, not about distributions.
Again, did you check the output of "make headers_install" (this is what
distributions are using going forward), and if so, can you give
*specific* examples of what we should add checks and fixes for?



-- 
if you want to mail me at work (you don't), use arjan (at) linux.intel.com
Test the interaction between Linux and your BIOS via http://www.linuxfirmwarekit.org


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-25 15:26     ` Arjan van de Ven
@ 2007-06-25 15:27       ` Robert P. J. Day
  0 siblings, 0 replies; 72+ messages in thread
From: Robert P. J. Day @ 2007-06-25 15:27 UTC (permalink / raw)
  To: Arjan van de Ven; +Cc: Joerg Schilling, schilling, linux-kernel

On Mon, 25 Jun 2007, Arjan van de Ven wrote:

> there is no __KERNEL__ in the "make headers_install"'d kernel headers.

not quite technically true, as "unifdef" isn't smart enough to factor
out __KERNEL__ if it's part of a larger, logical expression involving
the "||" operator.  but that's being admittedly nitpicky.

rday

-- 
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://fsdev.net/wiki/index.php?title=Main_Page
========================================================================

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-25 15:17       ` Joerg Schilling
@ 2007-06-25 15:27         ` David Woodhouse
  2007-06-25 18:04           ` Harald Arnesen
  0 siblings, 1 reply; 72+ messages in thread
From: David Woodhouse @ 2007-06-25 15:27 UTC (permalink / raw)
  To: Joerg Schilling; +Cc: schilling, linux-kernel, david

On Mon, 2007-06-25 at 17:17 +0200, Joerg Schilling wrote:
> David Woodhouse <dwmw2@infradead.org> wrote:
> > On Fri, 2007-06-22 at 01:38 +0200, Joerg Schilling wrote:
> A kernel include file that defines an interface to a user space program
> should be self containing (that means that all includes for all non-standard
> types should be done inside these include files). Whether or not C-99 
> types are used or not is less important than to use type definitions written 
> in clean C so compilers other than gcc may use them.

Yes. In general we try to achieve this. Most header files should include
<asm/types.h>, which tends to define the types we use in terms which
should work in any compiler.

> >  Can you be more specific about why this is a problem? Don't
> > we mostly define those crappy types using arch-specific knowledge, as
> > 'int', 'long', etc?
> 
> I recommend you to install Sun Studio and to try to compile star or cdrtools
> using Sun Studio by calling "make CCOM_suncc".
>
> ftp://ftp.berlios.de/pub/star/alpha/
> ftp://ftp.berlios.de/pub/cdrecord/alpha/
> 
> You may need to hand edit the file incs/<arch-dir>/{xconfig.h!rules.conf}
> 
> in order to enable the auto-disabled features.
> 
> In any case, self reading the error messages from Sun Studio helps more than
> trying to discuss it.

I have no interest in doing this for myself, and I suspect that if I
tried it I'd find that Sun Studio doesn't exist for Linux/PowerPC
anyway. Please just show the error messages.

-- 
dwmw2


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-25 15:06     ` Joerg Schilling
@ 2007-06-25 16:00       ` david
  0 siblings, 0 replies; 72+ messages in thread
From: david @ 2007-06-25 16:00 UTC (permalink / raw)
  To: Joerg Schilling; +Cc: arnd, vapier.adi, schilling, linux-kernel

On Mon, 25 Jun 2007, Joerg Schilling wrote:

> Arnd Bergmann <arnd@arndb.de> wrote:
>
>> On Friday 22 June 2007, david@lang.hm wrote:
>>> this has been discussed many times and the answer is that the kernel is
>>> not gong to change it's side of things to ANSI C.
>>
>> I don't think that's entirely true with regard to the include files.
>> We have always tried not to step on anyone's toes there, e.g. regarding
>> the use of __u32 vs. uint32_t style types. It's certainly desirable
>> to make the kernel headers that are _meant_ for inclusion compatible
>> with standard compilers.
>>
>> Mike Frysinger has posted a few patches that make the installed headers
>> friendlier to strict C99 users. While there was some negative feedback
>> about these patches, it was not about the idea of making the installed
>> headers C99 clean, but rather about the question whether those non-clean
>> parts should be exported in the first place.
>
> Wouldn't it be simpler to ask the developers to deliver their include files
> in a state that is clean for user space programs?

that's what make headers_install does, as others have pointed out.

David Lang

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-25 15:27         ` David Woodhouse
@ 2007-06-25 18:04           ` Harald Arnesen
  2007-06-25 20:26             ` Joerg Schilling
  0 siblings, 1 reply; 72+ messages in thread
From: Harald Arnesen @ 2007-06-25 18:04 UTC (permalink / raw)
  To: David Woodhouse; +Cc: Joerg Schilling, schilling, linux-kernel, david

David Woodhouse <dwmw2@infradead.org> writes:

>> >  Can you be more specific about why this is a problem? Don't
>> > we mostly define those crappy types using arch-specific knowledge, as
>> > 'int', 'long', etc?
>> 
>> I recommend you to install Sun Studio and to try to compile star or cdrtools
>> using Sun Studio by calling "make CCOM_suncc".
>>
>> ftp://ftp.berlios.de/pub/star/alpha/
>> ftp://ftp.berlios.de/pub/cdrecord/alpha/
>> 
>> You may need to hand edit the file incs/<arch-dir>/{xconfig.h!rules.conf}
>> 
>> in order to enable the auto-disabled features.
>> 
>> In any case, self reading the error messages from Sun Studio helps more than
>> trying to discuss it.
>
> I have no interest in doing this for myself, and I suspect that if I
> tried it I'd find that Sun Studio doesn't exist for Linux/PowerPC
> anyway. Please just show the error messages.

Apart from the usual whining about GNU make, the error message is:
make: *** No rule to make target `CCOM_suncc'.  Stop.

If I actually install smake, as Jörg recommends, the message becomes:
smake: Can't find any source for 'CCOM_suncc'.
smake: Couldn't make 'CCOM_suncc'.
-- 
Hilsen Harald.


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-25 14:53   ` Joerg Schilling
  2007-06-25 15:26     ` Arjan van de Ven
@ 2007-06-25 20:18     ` Sam Ravnborg
  1 sibling, 0 replies; 72+ messages in thread
From: Sam Ravnborg @ 2007-06-25 20:18 UTC (permalink / raw)
  To: Joerg Schilling; +Cc: arjan, schilling, linux-kernel

On Mon, Jun 25, 2007 at 04:53:55PM +0200, Joerg Schilling wrote:
> 
> star needs "ext2_fs.h". This file is not usable at all on many Linux 
> distributions, even with GCC.

I was curious so I did:

$ mkdir ~/foo
$ cd ~/kernel/linux-2.6
$ make INSTALL_HDR_PATH=~/foo
$ cd ~/foo
$ cat j.c
#include <stdio.h>
#include "etx2_fs.h"

main()
{
	printf("helloo\n");
}

$ gcc -o j j.c
=> No warning, no errors

$ gcc -ansi -pedantic -o j j.c
In file included from j.c:2:
ext2_fs.h:53:25: warning: ISO C does not permit named variadic macros

$ gcc -ansi -pedantic -std=c99 -o j j.c
In file included from j.c:2:
ext2_fs.h:53:25: warning: ISO C does not permit named variadic macros
j.c:5: warning: return type defaults to ‘int’

Is it this part you are referring to in the above or have I overlooked something?

	Sam

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-25 18:04           ` Harald Arnesen
@ 2007-06-25 20:26             ` Joerg Schilling
  2007-06-25 20:32               ` David Woodhouse
  2007-06-25 21:43               ` Harald Arnesen
  0 siblings, 2 replies; 72+ messages in thread
From: Joerg Schilling @ 2007-06-25 20:26 UTC (permalink / raw)
  To: harald, dwmw2; +Cc: schilling, linux-kernel, david

Harald Arnesen <harald@skogtun.org> wrote:

> David Woodhouse <dwmw2@infradead.org> writes:
>
> >> >  Can you be more specific about why this is a problem? Don't
> >> > we mostly define those crappy types using arch-specific knowledge, as
> >> > 'int', 'long', etc?
> >> 
> >> I recommend you to install Sun Studio and to try to compile star or cdrtools
> >> using Sun Studio by calling "make CCOM_suncc".
> >>
> >> ftp://ftp.berlios.de/pub/star/alpha/
> >> ftp://ftp.berlios.de/pub/cdrecord/alpha/
> >> 
> >> You may need to hand edit the file incs/<arch-dir>/{xconfig.h!rules.conf}
> >> 
> >> in order to enable the auto-disabled features.
> >> 
> >> In any case, self reading the error messages from Sun Studio helps more than
> >> trying to discuss it.
> >
> > I have no interest in doing this for myself, and I suspect that if I
> > tried it I'd find that Sun Studio doesn't exist for Linux/PowerPC
> > anyway. Please just show the error messages.
>
> Apart from the usual whining about GNU make, the error message is:
> make: *** No rule to make target `CCOM_suncc'.  Stop.
>
> If I actually install smake, as Jörg recommends, the message becomes:
> smake: Can't find any source for 'CCOM_suncc'.
> smake: Couldn't make 'CCOM_suncc'.

Well, I was in hope that a small typo (in special as the correct spelling is in 
the file README.compile) should not be a problem.

You need to use CCOM=suncc 

Jörg

-- 
 EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
       js@cs.tu-berlin.de                (uni)  
       schilling@fokus.fraunhofer.de     (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-25 20:26             ` Joerg Schilling
@ 2007-06-25 20:32               ` David Woodhouse
  2007-06-25 21:43               ` Harald Arnesen
  1 sibling, 0 replies; 72+ messages in thread
From: David Woodhouse @ 2007-06-25 20:32 UTC (permalink / raw)
  To: Joerg Schilling; +Cc: harald, schilling, linux-kernel, david

On Mon, 2007-06-25 at 22:26 +0200, Joerg Schilling wrote:
> Well, I was in hope that a small typo (in special as the correct
> spelling is in the file README.compile) should not be a problem.
> 
> You need to use CCOM=suncc 

No, I need someone else to use CCOM=suncc for me. Unless suncc works on
Linux/PowerPC _and_ you find me a few extra hours in the day to deal
with bugs for someone who can't even be bothered to write a coherent bug
report.

-- 
dwmw2


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-25 20:26             ` Joerg Schilling
  2007-06-25 20:32               ` David Woodhouse
@ 2007-06-25 21:43               ` Harald Arnesen
  2007-06-25 21:48                 ` Harald Arnesen
  1 sibling, 1 reply; 72+ messages in thread
From: Harald Arnesen @ 2007-06-25 21:43 UTC (permalink / raw)
  To: Joerg Schilling; +Cc: dwmw2, schilling, linux-kernel, david

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=utf-8, Size: 544 bytes --]

Joerg.Schilling@fokus.fraunhofer.de (Joerg Schilling) writes:

>> If I actually install smake, as Jörg recommends, the message becomes:
>> smake: Can't find any source for 'CCOM_suncc'.
>> smake: Couldn't make 'CCOM_suncc'.
>
> Well, I was in hope that a small typo (in special as the correct spelling is in 
> the file README.compile) should not be a problem.
>
> You need to use CCOM=suncc 

Then it (star, I haven't tried cdrtools yes) compiles and links fine.
There must be something wrong with your Linux installation.
-- 
Hilsen Harald.


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-25 21:43               ` Harald Arnesen
@ 2007-06-25 21:48                 ` Harald Arnesen
  2007-06-25 21:49                   ` Joerg Schilling
  0 siblings, 1 reply; 72+ messages in thread
From: Harald Arnesen @ 2007-06-25 21:48 UTC (permalink / raw)
  To: Joerg Schilling; +Cc: dwmw2, schilling, linux-kernel, david

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=utf-8, Size: 670 bytes --]

Harald Arnesen <harald@skogtun.org> writes:

> Joerg.Schilling@fokus.fraunhofer.de (Joerg Schilling) writes:
>
>>> If I actually install smake, as Jörg recommends, the message becomes:
>>> smake: Can't find any source for 'CCOM_suncc'.
>>> smake: Couldn't make 'CCOM_suncc'.
>>
>> Well, I was in hope that a small typo (in special as the correct spelling is in 
>> the file README.compile) should not be a problem.
>>
>> You need to use CCOM=suncc 
>
> Then it (star, I haven't tried cdrtools yes) compiles and links fine.
> There must be something wrong with your Linux installation.

FYI, cdrtools also compile and link fine with Sun's C compiler.
-- 
Hilsen Harald.


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-25 21:48                 ` Harald Arnesen
@ 2007-06-25 21:49                   ` Joerg Schilling
  2007-06-25 22:30                     ` Harald Arnesen
  0 siblings, 1 reply; 72+ messages in thread
From: Joerg Schilling @ 2007-06-25 21:49 UTC (permalink / raw)
  To: harald; +Cc: schilling, linux-kernel, dwmw2, david

Harald Arnesen <harald@skogtun.org> wrote:

> Harald Arnesen <harald@skogtun.org> writes:
>
> > Joerg.Schilling@fokus.fraunhofer.de (Joerg Schilling) writes:
> >
> >>> If I actually install smake, as Jörg recommends, the message becomes:
> >>> smake: Can't find any source for 'CCOM_suncc'.
> >>> smake: Couldn't make 'CCOM_suncc'.
> >>
> >> Well, I was in hope that a small typo (in special as the correct spelling is in 
> >> the file README.compile) should not be a problem.
> >>
> >> You need to use CCOM=suncc 
> >
> > Then it (star, I haven't tried cdrtools yes) compiles and links fine.
> > There must be something wrong with your Linux installation.
>
> FYI, cdrtools also compile and link fine with Sun's C compiler.

Mmmmm, if you call "cdrecord -scanbus", what do you get?

Jörg

-- 
 EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
       js@cs.tu-berlin.de                (uni)  
       schilling@fokus.fraunhofer.de     (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-25 21:49                   ` Joerg Schilling
@ 2007-06-25 22:30                     ` Harald Arnesen
  2007-06-25 22:42                       ` Joerg Schilling
  0 siblings, 1 reply; 72+ messages in thread
From: Harald Arnesen @ 2007-06-25 22:30 UTC (permalink / raw)
  To: Joerg Schilling; +Cc: schilling, linux-kernel, dwmw2, david

Joerg.Schilling@fokus.fraunhofer.de (Joerg Schilling) writes:

>> FYI, cdrtools also compile and link fine with Sun's C compiler.
>
> Mmmmm, if you call "cdrecord -scanbus", what do you get?

I may have misunderstood your make system. I cd-ed into the cdrtools
directory, ran ./Gmake.linux clean (I had already compiled with GCC),
and then ./Gmake.linux CCOM=suncc. I didn't see any errors at the end of
the make output.

However, what confused me was that the cdrecord binary wasn't removed.
And scrolling back, I see several compile errors from Sun's C compiler.

Shouldn't "make clean" remove the executable files?
-- 
Hilsen Harald.


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-25 22:30                     ` Harald Arnesen
@ 2007-06-25 22:42                       ` Joerg Schilling
  0 siblings, 0 replies; 72+ messages in thread
From: Joerg Schilling @ 2007-06-25 22:42 UTC (permalink / raw)
  To: harald; +Cc: schilling, linux-kernel, dwmw2, david

Harald Arnesen <harald@skogtun.org> wrote:

> Joerg.Schilling@fokus.fraunhofer.de (Joerg Schilling) writes:
>
> >> FYI, cdrtools also compile and link fine with Sun's C compiler.
> >
> > Mmmmm, if you call "cdrecord -scanbus", what do you get?
>
> I may have misunderstood your make system. I cd-ed into the cdrtools
> directory, ran ./Gmake.linux clean (I had already compiled with GCC),
> and then ./Gmake.linux CCOM=suncc. I didn't see any errors at the end of
> the make output.
>
> However, what confused me was that the cdrecord binary wasn't removed.
> And scrolling back, I see several compile errors from Sun's C compiler.
>
> Shouldn't "make clean" remove the executable files?

make clean only removes the *.o files.

If you call "make relink", all results are removed before recreating.

BTW: your problem is caused by a "bash" bug. With a shell that correctly
works with "sh -ce 'command...'", you would see an abort after the first
error.

Jörg

-- 
 EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
       js@cs.tu-berlin.de                (uni)  
       schilling@fokus.fraunhofer.de     (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-22 15:00       ` Adrian Bunk
@ 2007-06-26 15:26         ` H. Peter Anvin
  2007-06-27  1:32         ` Kyle Moffett
  1 sibling, 0 replies; 72+ messages in thread
From: H. Peter Anvin @ 2007-06-26 15:26 UTC (permalink / raw)
  To: Adrian Bunk
  Cc: David Woodhouse, Joerg Schilling, david, schilling, linux-kernel

Adrian Bunk wrote:
> 
> It would certainly help if Joerg would tell what exactly breaks, but I 
> spot one likely problem in include/asm-i386/types.h:
> 
> #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
> typedef __signed__ long long __s64;
> typedef unsigned long long __u64;
> #endif
> 
> It might make sense to remove the #if and simply require that
> a C compiler under Linux must know about the C99 "long long"?
> 

Yes.

	-hpa


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-22 15:00       ` Adrian Bunk
  2007-06-26 15:26         ` H. Peter Anvin
@ 2007-06-27  1:32         ` Kyle Moffett
  2007-06-27 15:40           ` Adrian Bunk
  2007-06-28  4:02           ` Linux Kernel include files H. Peter Anvin
  1 sibling, 2 replies; 72+ messages in thread
From: Kyle Moffett @ 2007-06-27  1:32 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: David Woodhouse, Joerg Schilling, david, LKML Kernel

On Jun 22, 2007, at 11:00:38, Adrian Bunk wrote:
> It would certainly help if Joerg would tell what exactly breaks,  
> but I spot one likely problem in include/asm-i386/types.h:
>
> #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
> typedef __signed__ long long __s64;
> typedef unsigned long long __u64;
> #endif
>
> It might make sense to remove the #if and simply require that a C  
> compiler under Linux must know about the C99 "long long"?

Gah, this particular topic and a few other similar header- 
compatibility ones show up once a month on LKML; I should probably  
just make a patch to fix all the types.h files and be done with it.   
The proper solution is this:

# if __STDC_VERSION__ >= 19901L
typedef   signed long long __s64;
typedef unsigned long long __u64;
# elif defined(__GNUC__)
__extension__ typedef   signed long long __s64;
__extension__ typedef unsigned long long __u64;
# else
#  error "Your compiler doesn't support long long (IOW: It sucks).   
Please get a new one"
# endif

That way if you have any kind of vaguely-long-long-compatible  
compiler then it will work, and otherwise you'll get a nice useful  
error message.  It also makes sure that GCC doesn't spew warnings/ 
errors when in c89-pedantic mode.  The "__extension__" keyword is  
designed for use in implementation header files which want to use GCC- 
isms unconditionally.

Cheers,
Kyle Moffett


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-27  1:32         ` Kyle Moffett
@ 2007-06-27 15:40           ` Adrian Bunk
  2007-06-27 15:52             ` Joerg Schilling
  2007-06-28  4:02           ` Linux Kernel include files H. Peter Anvin
  1 sibling, 1 reply; 72+ messages in thread
From: Adrian Bunk @ 2007-06-27 15:40 UTC (permalink / raw)
  To: Kyle Moffett; +Cc: David Woodhouse, Joerg Schilling, david, LKML Kernel

On Tue, Jun 26, 2007 at 09:32:39PM -0400, Kyle Moffett wrote:
> On Jun 22, 2007, at 11:00:38, Adrian Bunk wrote:
>> It would certainly help if Joerg would tell what exactly breaks, but I 
>> spot one likely problem in include/asm-i386/types.h:
>>
>> #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
>> typedef __signed__ long long __s64;
>> typedef unsigned long long __u64;
>> #endif
>>
>> It might make sense to remove the #if and simply require that a C compiler 
>> under Linux must know about the C99 "long long"?
>
> Gah, this particular topic and a few other similar header-compatibility 
> ones show up once a month on LKML; I should probably just make a patch to 
> fix all the types.h files and be done with it.  The proper solution is 
> this:
>
> # if __STDC_VERSION__ >= 19901L
> typedef   signed long long __s64;
> typedef unsigned long long __u64;
> # elif defined(__GNUC__)
> __extension__ typedef   signed long long __s64;
> __extension__ typedef unsigned long long __u64;
> # else
> #  error "Your compiler doesn't support long long (IOW: It sucks).  Please 
> get a new one"

This part is wrong.

gcc supported "long long" before C99 existed.
And Joerg said the Sun cc supported "long long" before gcc did.

> # endif
>
> That way if you have any kind of vaguely-long-long-compatible compiler then 
> it will work, and otherwise you'll get a nice useful error message.

No, consider a pre-C99 gcc version that supports "long long".

> It 
> also makes sure that GCC doesn't spew warnings/errors when in c89-pedantic 
> mode.  The "__extension__" keyword is designed for use in implementation 
> header files which want to use GCC-isms unconditionally.

That's a good point I missed.

What about:

#if defined(__GNUC__) && __STDC_VERSION__ < 19901L
__extension__ typedef   signed long long __s64;
__extension__ typedef unsigned long long __u64;
#else
typedef   signed long long __s64;
typedef unsigned long long __u64;
#endif

> Cheers,
> Kyle Moffett

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-27 15:40           ` Adrian Bunk
@ 2007-06-27 15:52             ` Joerg Schilling
  2007-06-27 15:59               ` Robert P. J. Day
  2007-06-27 17:32               ` Userspace compiler support of "long long" Adrian Bunk
  0 siblings, 2 replies; 72+ messages in thread
From: Joerg Schilling @ 2007-06-27 15:52 UTC (permalink / raw)
  To: mrmacman_g4, bunk; +Cc: linux-kernel, dwmw2, david

Adrian Bunk <bunk@stusta.de> wrote:

> That's a good point I missed.
>
> What about:
>
> #if defined(__GNUC__) && __STDC_VERSION__ < 19901L
> __extension__ typedef   signed long long __s64;
> __extension__ typedef unsigned long long __u64;
> #else
> typedef   signed long long __s64;
> typedef unsigned long long __u64;
> #endif

What about using:

#if (defined(__GNUC__) || defined(__SUNPRO_C)) && !defined(__STRICT_ANSI__) 

Well, there seems to be one other compiler (the one from Intel).
It may be that if this compiler does not claim to be GCC, another
definituion needs to be added.

Jörg

-- 
 EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
       js@cs.tu-berlin.de                (uni)  
       schilling@fokus.fraunhofer.de     (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-27 15:52             ` Joerg Schilling
@ 2007-06-27 15:59               ` Robert P. J. Day
  2007-06-27 17:32               ` Userspace compiler support of "long long" Adrian Bunk
  1 sibling, 0 replies; 72+ messages in thread
From: Robert P. J. Day @ 2007-06-27 15:59 UTC (permalink / raw)
  To: Joerg Schilling; +Cc: mrmacman_g4, bunk, linux-kernel, dwmw2, david

On Wed, 27 Jun 2007, Joerg Schilling wrote:

> Adrian Bunk <bunk@stusta.de> wrote:
>
> > That's a good point I missed.
> >
> > What about:
> >
> > #if defined(__GNUC__) && __STDC_VERSION__ < 19901L
> > __extension__ typedef   signed long long __s64;
> > __extension__ typedef unsigned long long __u64;
> > #else
> > typedef   signed long long __s64;
> > typedef unsigned long long __u64;
> > #endif
>
> What about using:
>
> #if (defined(__GNUC__) || defined(__SUNPRO_C)) && !defined(__STRICT_ANSI__)
>
> Well, there seems to be one other compiler (the one from Intel).
> It may be that if this compiler does not claim to be GCC, another
> definituion needs to be added.

the intel compiler does indeed claim to be gcc.

rday
-- 
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://fsdev.net/wiki/index.php?title=Main_Page
========================================================================

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Userspace compiler support of "long long"
  2007-06-27 15:52             ` Joerg Schilling
  2007-06-27 15:59               ` Robert P. J. Day
@ 2007-06-27 17:32               ` Adrian Bunk
  2007-06-27 22:30                 ` Kyle Moffett
  2007-06-28 10:26                 ` Harald Arnesen
  1 sibling, 2 replies; 72+ messages in thread
From: Adrian Bunk @ 2007-06-27 17:32 UTC (permalink / raw)
  To: Joerg Schilling; +Cc: mrmacman_g4, linux-kernel, dwmw2, david

On Wed, Jun 27, 2007 at 05:52:08PM +0200, Joerg Schilling wrote:
> Adrian Bunk <bunk@stusta.de> wrote:
> 
> > That's a good point I missed.
> >
> > What about:
> >
> > #if defined(__GNUC__) && __STDC_VERSION__ < 19901L
> > __extension__ typedef   signed long long __s64;
> > __extension__ typedef unsigned long long __u64;
> > #else
> > typedef   signed long long __s64;
> > typedef unsigned long long __u64;
> > #endif
> 
> What about using:
> 
> #if (defined(__GNUC__) || defined(__SUNPRO_C)) && !defined(__STRICT_ANSI__) 

AFAIR __extension__ was gcc specific.

Does the Sun cc provide options for strict C90 checking?
And if yes, what is it's syntax for disabling this checking for a line 
of code?

> Well, there seems to be one other compiler (the one from Intel).
> It may be that if this compiler does not claim to be GCC, another
> definituion needs to be added.

AFAIR the Intel compiler claims to be gcc.

But these are by far not the only C compilers under Linux, and the more 
important points are:

Is there any userspace Linux compiler that does not support "long long"?
If yes, is there any other way to tell that something is a
64bit int on 32bit architectures?

> Jörg

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Userspace compiler support of "long long"
  2007-06-27 17:32               ` Userspace compiler support of "long long" Adrian Bunk
@ 2007-06-27 22:30                 ` Kyle Moffett
  2007-06-27 22:57                   ` Randy Dunlap
                                     ` (3 more replies)
  2007-06-28 10:26                 ` Harald Arnesen
  1 sibling, 4 replies; 72+ messages in thread
From: Kyle Moffett @ 2007-06-27 22:30 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: LKML Kernel, David Woodhouse, david, linux-arch

On Jun 27, 2007, at 13:32:40, Adrian Bunk wrote:
> AFAIR the Intel compiler claims to be gcc.
>
> But these are by far not the only C compilers under Linux, and the  
> more important points are:
>
> Is there any userspace Linux compiler that does not support "long  
> long"?

Don't know, but I'd guess not.


> If yes, is there any other way to tell that something is a 64bit  
> int on 32bit architectures?

Not that I know of.  Probably the straight #else conditional is OK.   
We should also merge up the types since *EVERY* linux architecture  
has these same types:

typedef   signed char      __s8;
typedef unsigned char      __u8;
typedef   signed short     __s16;
typedef unsigned short     __u16;
typedef   signed int       __s32;
typedef unsigned int       __u32;

Then all 64-bit archs have:
typedef   signed long      __s64;
typedef unsigned long      __u64;

While all 32-bit archs have:
typedef   signed long long __s64;
typedef unsigned long long __u64;

The only trick is if you care about building 32-bit compat code using  
64-bit linux kernel headers.  In that case we should probably just  
make all archs use "long long" for their 64-bit integers, unless  
there's some platform I'm not remembering where "long long" is 128- 
bits or bigger.  The other benefit is that people could then just use  
the printf format "%llu" for 64-bit integers instead of having to  
conditionalize it all over the place.

I'm working on a patch now.

Cheers,
Kyle Moffett


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Userspace compiler support of "long long"
  2007-06-27 22:30                 ` Kyle Moffett
@ 2007-06-27 22:57                   ` Randy Dunlap
  2007-06-27 23:16                     ` Randy Dunlap
  2007-06-28  0:30                   ` Andi Kleen
                                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 72+ messages in thread
From: Randy Dunlap @ 2007-06-27 22:57 UTC (permalink / raw)
  To: Kyle Moffett; +Cc: Adrian Bunk, LKML Kernel, David Woodhouse, david, linux-arch

On Wed, 27 Jun 2007 18:30:52 -0400 Kyle Moffett wrote:

> On Jun 27, 2007, at 13:32:40, Adrian Bunk wrote:
> > AFAIR the Intel compiler claims to be gcc.
> >
> > But these are by far not the only C compilers under Linux, and the  
> > more important points are:
> >
> > Is there any userspace Linux compiler that does not support "long  
> > long"?
> 
> Don't know, but I'd guess not.
> 
> 
> > If yes, is there any other way to tell that something is a 64bit  
> > int on 32bit architectures?
> 
> Not that I know of.  Probably the straight #else conditional is OK.   
> We should also merge up the types since *EVERY* linux architecture  
> has these same types:
> 
> typedef   signed char      __s8;
> typedef unsigned char      __u8;
> typedef   signed short     __s16;
> typedef unsigned short     __u16;
> typedef   signed int       __s32;
> typedef unsigned int       __u32;
> 
> Then all 64-bit archs have:
> typedef   signed long      __s64;
> typedef unsigned long      __u64;
> 
> While all 32-bit archs have:
> typedef   signed long long __s64;
> typedef unsigned long long __u64;
> 
> The only trick is if you care about building 32-bit compat code using  
> 64-bit linux kernel headers.  In that case we should probably just  
> make all archs use "long long" for their 64-bit integers, unless  
> there's some platform I'm not remembering where "long long" is 128- 
> bits or bigger.  The other benefit is that people could then just use  
> the printf format "%llu" for 64-bit integers instead of having to  
> conditionalize it all over the place.
> 
> I'm working on a patch now.

LDD3 ch. 11 says that long on Sparc64 is 32 bits.
Same for "ppc" (don't know which power* arch. they mean by that).

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Userspace compiler support of "long long"
  2007-06-27 22:57                   ` Randy Dunlap
@ 2007-06-27 23:16                     ` Randy Dunlap
  2007-06-28  2:12                       ` Geert Uytterhoeven
  2007-06-28  3:06                       ` Kyle McMartin
  0 siblings, 2 replies; 72+ messages in thread
From: Randy Dunlap @ 2007-06-27 23:16 UTC (permalink / raw)
  To: Kyle Moffett; +Cc: Adrian Bunk, LKML Kernel, David Woodhouse, david, linux-arch

On Wed, 27 Jun 2007 15:57:15 -0700 Randy Dunlap wrote:

> On Wed, 27 Jun 2007 18:30:52 -0400 Kyle Moffett wrote:
> 
> > On Jun 27, 2007, at 13:32:40, Adrian Bunk wrote:
> > > AFAIR the Intel compiler claims to be gcc.
> > >
> > > But these are by far not the only C compilers under Linux, and the  
> > > more important points are:
> > >
> > > Is there any userspace Linux compiler that does not support "long  
> > > long"?
> > 
> > Don't know, but I'd guess not.
> > 
> > 
> > > If yes, is there any other way to tell that something is a 64bit  
> > > int on 32bit architectures?
> > 
> > Not that I know of.  Probably the straight #else conditional is OK.   
> > We should also merge up the types since *EVERY* linux architecture  
> > has these same types:
> > 
> > typedef   signed char      __s8;
> > typedef unsigned char      __u8;
> > typedef   signed short     __s16;
> > typedef unsigned short     __u16;
> > typedef   signed int       __s32;
> > typedef unsigned int       __u32;
> > 
> > Then all 64-bit archs have:
> > typedef   signed long      __s64;
> > typedef unsigned long      __u64;
> > 
> > While all 32-bit archs have:
> > typedef   signed long long __s64;
> > typedef unsigned long long __u64;
> > 
> > The only trick is if you care about building 32-bit compat code using  
> > 64-bit linux kernel headers.  In that case we should probably just  
> > make all archs use "long long" for their 64-bit integers, unless  
> > there's some platform I'm not remembering where "long long" is 128- 
> > bits or bigger.  The other benefit is that people could then just use  
> > the printf format "%llu" for 64-bit integers instead of having to  
> > conditionalize it all over the place.
> > 
> > I'm working on a patch now.
> 
> LDD3 ch. 11 says that long on Sparc64 is 32 bits.
> Same for "ppc" (don't know which power* arch. they mean by that).

Hm, I suppose that table only applies to userspace, not kernel...

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Userspace compiler support of "long long"
  2007-06-27 22:30                 ` Kyle Moffett
  2007-06-27 22:57                   ` Randy Dunlap
@ 2007-06-28  0:30                   ` Andi Kleen
  2007-06-28 11:42                     ` Kyle Moffett
  2007-06-28  3:57                   ` Matthew Wilcox
  2007-06-28  4:03                   ` H. Peter Anvin
  3 siblings, 1 reply; 72+ messages in thread
From: Andi Kleen @ 2007-06-28  0:30 UTC (permalink / raw)
  To: Kyle Moffett; +Cc: Adrian Bunk, LKML Kernel, David Woodhouse, david, linux-arch

On Thursday 28 June 2007 00:30:52 Kyle Moffett wrote:
> On Jun 27, 2007, at 13:32:40, Adrian Bunk wrote:
> > AFAIR the Intel compiler claims to be gcc.
> >
> > But these are by far not the only C compilers under Linux, and the  
> > more important points are:
> >
> > Is there any userspace Linux compiler that does not support "long  
> > long"?
> 
> Don't know, but I'd guess not.

Tendra C and probably lcc. I would guess tinycc too.

> The only trick is if you care about building 32-bit compat code using  
> 64-bit linux kernel headers.  In that case we should probably just  
> make all archs use "long long" for their 64-bit integers, unless  
> there's some platform I'm not remembering where "long long" is 128- 
> bits or bigger.  The other benefit is that people could then just use  
> the printf format "%llu" for 64-bit integers instead of having to  
> conditionalize it all over the place.
> 
> I'm working on a patch now.

Changing this will give you a zillion warnings for printk formats.

-Andi
 

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Userspace compiler support of "long long"
  2007-06-27 23:16                     ` Randy Dunlap
@ 2007-06-28  2:12                       ` Geert Uytterhoeven
  2007-06-28  6:50                         ` Jan Engelhardt
  2007-06-28  3:06                       ` Kyle McMartin
  1 sibling, 1 reply; 72+ messages in thread
From: Geert Uytterhoeven @ 2007-06-28  2:12 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Kyle Moffett, Adrian Bunk, LKML Kernel, David Woodhouse, david,
	linux-arch

On Wed, 27 Jun 2007, Randy Dunlap wrote:
> On Wed, 27 Jun 2007 15:57:15 -0700 Randy Dunlap wrote:
> > LDD3 ch. 11 says that long on Sparc64 is 32 bits.
> > Same for "ppc" (don't know which power* arch. they mean by that).
> 
> Hm, I suppose that table only applies to userspace, not kernel...

32-bit userspace?

On 64-bit, `long' is 64-bit on all platforms supported by Linux.

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Userspace compiler support of "long long"
  2007-06-27 23:16                     ` Randy Dunlap
  2007-06-28  2:12                       ` Geert Uytterhoeven
@ 2007-06-28  3:06                       ` Kyle McMartin
  1 sibling, 0 replies; 72+ messages in thread
From: Kyle McMartin @ 2007-06-28  3:06 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Kyle Moffett, Adrian Bunk, LKML Kernel, David Woodhouse, david,
	linux-arch

On Wed, Jun 27, 2007 at 04:16:48PM -0700, Randy Dunlap wrote:
> > LDD3 ch. 11 says that long on Sparc64 is 32 bits.
> > Same for "ppc" (don't know which power* arch. they mean by that).
> 
> Hm, I suppose that table only applies to userspace, not kernel...
> 

Doing 64-bit Linux non-LP64 would be an interesting exercise in masochism...

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Userspace compiler support of "long long"
  2007-06-27 22:30                 ` Kyle Moffett
  2007-06-27 22:57                   ` Randy Dunlap
  2007-06-28  0:30                   ` Andi Kleen
@ 2007-06-28  3:57                   ` Matthew Wilcox
  2007-06-28 11:53                     ` Kyle Moffett
  2007-06-28  4:03                   ` H. Peter Anvin
  3 siblings, 1 reply; 72+ messages in thread
From: Matthew Wilcox @ 2007-06-28  3:57 UTC (permalink / raw)
  To: Kyle Moffett; +Cc: Adrian Bunk, LKML Kernel, David Woodhouse, david, linux-arch

On Wed, Jun 27, 2007 at 06:30:52PM -0400, Kyle Moffett wrote:
> Then all 64-bit archs have:
> typedef   signed long      __s64;
> typedef unsigned long      __u64;
> 
> While all 32-bit archs have:
> typedef   signed long long __s64;
> typedef unsigned long long __u64;

include/asm-parisc/types.h:typedef unsigned long long __u64;

For both 32 and 64-bit.

include/asm-sh64/types.h:typedef unsigned long long __u64;
include/asm-x86_64/types.h:typedef unsigned long long  __u64;

So that's three architectures that violate your first assertion.

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-27  1:32         ` Kyle Moffett
  2007-06-27 15:40           ` Adrian Bunk
@ 2007-06-28  4:02           ` H. Peter Anvin
  1 sibling, 0 replies; 72+ messages in thread
From: H. Peter Anvin @ 2007-06-28  4:02 UTC (permalink / raw)
  To: Kyle Moffett
  Cc: Adrian Bunk, David Woodhouse, Joerg Schilling, david, LKML Kernel

Kyle Moffett wrote:
> 
> Gah, this particular topic and a few other similar header-compatibility 
> ones show up once a month on LKML; I should probably just make a patch 
> to fix all the types.h files and be done with it.  The proper solution 
> is this:
> 
> # if __STDC_VERSION__ >= 19901L
> typedef   signed long long __s64;
> typedef unsigned long long __u64;
> # elif defined(__GNUC__)
> __extension__ typedef   signed long long __s64;
> __extension__ typedef unsigned long long __u64;
> # else
> #  error "Your compiler doesn't support long long (IOW: It sucks).  
> Please get a new one"
> # endif
> 
> That way if you have any kind of vaguely-long-long-compatible compiler 
> then it will work, and otherwise you'll get a nice useful error 
> message.  It also makes sure that GCC doesn't spew warnings/errors when 
> in c89-pedantic mode.  The "__extension__" keyword is designed for use 
> in implementation header files which want to use GCC-isms unconditionally.
> 

__extension__ should be macroized if so.

However, since something that doesn't have "long long" won't be able to 
compile those headers, there is absolutely no reason to not simply use 
it -- you get an error message on that line, which is good enough. 
There is definitely no reason to use a test like the one above, which is 
wrong for several supportable compilers.

	-hpa


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Userspace compiler support of "long long"
  2007-06-27 22:30                 ` Kyle Moffett
                                     ` (2 preceding siblings ...)
  2007-06-28  3:57                   ` Matthew Wilcox
@ 2007-06-28  4:03                   ` H. Peter Anvin
  3 siblings, 0 replies; 72+ messages in thread
From: H. Peter Anvin @ 2007-06-28  4:03 UTC (permalink / raw)
  To: Kyle Moffett; +Cc: Adrian Bunk, LKML Kernel, David Woodhouse, david, linux-arch

Kyle Moffett wrote:
>> 
> The only trick is if you care about building 32-bit compat code using 
> 64-bit linux kernel headers.  In that case we should probably just make 
> all archs use "long long" for their 64-bit integers, unless there's some 
> platform I'm not remembering where "long long" is 128-bits or bigger.  
> The other benefit is that people could then just use the printf format 
> "%llu" for 64-bit integers instead of having to conditionalize it all 
> over the place.
> 

No, you really don't want to do that, because then u64 != uint64_t on 
those platforms.

	-hpa


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Userspace compiler support of "long long"
  2007-06-28  2:12                       ` Geert Uytterhoeven
@ 2007-06-28  6:50                         ` Jan Engelhardt
  2007-06-28 11:34                           ` Geert Uytterhoeven
  0 siblings, 1 reply; 72+ messages in thread
From: Jan Engelhardt @ 2007-06-28  6:50 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Randy Dunlap, Kyle Moffett, Adrian Bunk, LKML Kernel,
	David Woodhouse, david, linux-arch


On Jun 28 2007 04:12, Geert Uytterhoeven wrote:
>On Wed, 27 Jun 2007, Randy Dunlap wrote:
>> On Wed, 27 Jun 2007 15:57:15 -0700 Randy Dunlap wrote:
>> > LDD3 ch. 11 says that long on Sparc64 is 32 bits.
>> > Same for "ppc" (don't know which power* arch. they mean by that).
>> 
>> Hm, I suppose that table only applies to userspace, not kernel...
>
>32-bit userspace?
>
>On 64-bit, `long' is 64-bit on all platforms supported by Linux.

All types are as wide as the compiler makes them.

Compiler  short  int long llong
Turbo C      16   16   32     -
GCC -m32     16   32   32    64
GCC -m64     16   32   64    64



	Jan
-- 

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Userspace compiler support of "long long"
  2007-06-27 17:32               ` Userspace compiler support of "long long" Adrian Bunk
  2007-06-27 22:30                 ` Kyle Moffett
@ 2007-06-28 10:26                 ` Harald Arnesen
  2007-06-28 10:44                   ` Joerg Schilling
  2007-06-28 12:11                   ` Kyle Moffett
  1 sibling, 2 replies; 72+ messages in thread
From: Harald Arnesen @ 2007-06-28 10:26 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: Joerg Schilling, mrmacman_g4, linux-kernel, dwmw2, david

Adrian Bunk <bunk@stusta.de> writes:

> Is there any userspace Linux compiler that does not support "long long"?
> If yes, is there any other way to tell that something is a
> 64bit int on 32bit architectures?

TenDRA C:

"test.c", line 6: Error:
  [ISO 6.5.2]: Illegal type specifier, 'long long', assuming 'long'.

-- 
Hilsen Harald.


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Userspace compiler support of "long long"
  2007-06-28 10:26                 ` Harald Arnesen
@ 2007-06-28 10:44                   ` Joerg Schilling
  2007-06-28 12:11                   ` Kyle Moffett
  1 sibling, 0 replies; 72+ messages in thread
From: Joerg Schilling @ 2007-06-28 10:44 UTC (permalink / raw)
  To: harald, bunk; +Cc: mrmacman_g4, linux-kernel, dwmw2, david

Harald Arnesen <harald@skogtun.org> wrote:

> Adrian Bunk <bunk@stusta.de> writes:
>
> > Is there any userspace Linux compiler that does not support "long long"?
> > If yes, is there any other way to tell that something is a
> > 64bit int on 32bit architectures?
>
> TenDRA C:
>
> "test.c", line 6: Error:
>   [ISO 6.5.2]: Illegal type specifier, 'long long', assuming 'long'.

You cannot use this compiler for any program that uses an interface that
needs long long.

BTW: C99 requires long long but the Large File summit from 1995 did to the
same since 1995. An 32 bit OS that supports large files cannot have a compiler
that does not support long long.

If TenDRA C does support 64 bit integral type in a different way. TenDRA C
would need to deliver include files that take care about this fact.

Jörg

-- 
 EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
       js@cs.tu-berlin.de                (uni)  
       schilling@fokus.fraunhofer.de     (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Userspace compiler support of "long long"
  2007-06-28  6:50                         ` Jan Engelhardt
@ 2007-06-28 11:34                           ` Geert Uytterhoeven
  2007-06-28 11:36                             ` David Woodhouse
  0 siblings, 1 reply; 72+ messages in thread
From: Geert Uytterhoeven @ 2007-06-28 11:34 UTC (permalink / raw)
  To: Jan Engelhardt
  Cc: Randy Dunlap, Kyle Moffett, Adrian Bunk, LKML Kernel,
	David Woodhouse, david, linux-arch

On Thu, 28 Jun 2007, Jan Engelhardt wrote:
> On Jun 28 2007 04:12, Geert Uytterhoeven wrote:
> >On Wed, 27 Jun 2007, Randy Dunlap wrote:
> >> On Wed, 27 Jun 2007 15:57:15 -0700 Randy Dunlap wrote:
> >> > LDD3 ch. 11 says that long on Sparc64 is 32 bits.
> >> > Same for "ppc" (don't know which power* arch. they mean by that).
> >> 
> >> Hm, I suppose that table only applies to userspace, not kernel...
> >
> >32-bit userspace?
> >
> >On 64-bit, `long' is 64-bit on all platforms supported by Linux.
> 
> All types are as wide as the compiler makes them.
> 
> Compiler  short  int long llong
> Turbo C      16   16   32     -
> GCC -m32     16   32   32    64
> GCC -m64     16   32   64    64

We do not support building Linux with Turbo C (or MS Visual C for Win64
P64).

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Userspace compiler support of "long long"
  2007-06-28 11:34                           ` Geert Uytterhoeven
@ 2007-06-28 11:36                             ` David Woodhouse
  2007-06-28 12:20                               ` Kyle Moffett
  0 siblings, 1 reply; 72+ messages in thread
From: David Woodhouse @ 2007-06-28 11:36 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Jan Engelhardt, Randy Dunlap, Kyle Moffett, Adrian Bunk,
	LKML Kernel, david, linux-arch

On Thu, 2007-06-28 at 13:34 +0200, Geert Uytterhoeven wrote:
> We do not support building Linux with Turbo C (or MS Visual C for
> Win64 P64). 

We're talking about types which are exposed to userspace.

-- 
dwmw2


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Userspace compiler support of "long long"
  2007-06-28  0:30                   ` Andi Kleen
@ 2007-06-28 11:42                     ` Kyle Moffett
  0 siblings, 0 replies; 72+ messages in thread
From: Kyle Moffett @ 2007-06-28 11:42 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Adrian Bunk, LKML Kernel, David Woodhouse, david, linux-arch

On Jun 27, 2007, at 20:30:42, Andi Kleen wrote:
> On Thursday 28 June 2007 00:30:52 Kyle Moffett wrote:
>> The only trick is if you care about building 32-bit compat code  
>> using 64-bit linux kernel headers.  In that case we should  
>> probably just make all archs use "long long" for their 64-bit  
>> integers, unless there's some platform I'm not remembering where  
>> "long long" is 128-bits or bigger.  The other benefit is that  
>> people could then just use the printf format "%llu" for 64-bit  
>> integers instead of having to conditionalize it all over the place.
>>
>> I'm working on a patch now.
>
> Changing this will give you a zillion warnings for printk formats.

Why?  If this were a problem then we'd be getting a zillion warnings  
*now* from all the 32-bit archs (which already use "long long" for 64- 
bit.  This would actually make it _easier_ to get the printk formats  
right, as you could always use %ull for 64-bit types without having  
to cast for 64-bit platforms.

This is another way to get around the "build 32-bit-compat userspace  
on 64-bit kernel headers" problem:  It tells GCC to use the  
"smallest" available type of the given size, which ends up being  
exactly the types we use now.  On the other hand, it only works for  
GCC which sort of ruins most of the reason for changing the types in  
the first place.

typedef   signed __s8  __attribute__((__mode__(__QI__)));
typedef unsigned __u8  __attribute__((__mode__(__QI__)));
typedef   signed __s16 __attribute__((__mode__(__HI__)));
typedef unsigned __u16 __attribute__((__mode__(__HI__)));
typedef   signed __s32 __attribute__((__mode__(__SI__)));
typedef unsigned __u32 __attribute__((__mode__(__SI__)));
typedef   signed __s64 __attribute__((__mode__(__DI__)));
typedef unsigned __u64 __attribute__((__mode__(__DI__)));

Cheers,
Kyle Moffett


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Userspace compiler support of "long long"
  2007-06-28  3:57                   ` Matthew Wilcox
@ 2007-06-28 11:53                     ` Kyle Moffett
  2007-06-28 12:08                       ` Jakub Jelinek
  0 siblings, 1 reply; 72+ messages in thread
From: Kyle Moffett @ 2007-06-28 11:53 UTC (permalink / raw)
  To: Matthew Wilcox
  Cc: Adrian Bunk, LKML Kernel, David Woodhouse, david, Andi Kleen, linux-arch

On Jun 27, 2007, at 23:57:54, Matthew Wilcox wrote:
> On Wed, Jun 27, 2007 at 06:30:52PM -0400, Kyle Moffett wrote:
>> Then all 64-bit archs have:
>> typedef   signed long      __s64;
>> typedef unsigned long      __u64;
>>
>> While all 32-bit archs have:
>> typedef   signed long long __s64;
>> typedef unsigned long long __u64;
>
> include/asm-parisc/types.h:typedef unsigned long long __u64;
>
> For both 32 and 64-bit.
>
> include/asm-sh64/types.h:typedef unsigned long long __u64;
> include/asm-x86_64/types.h:typedef unsigned long long  __u64;
>
> So that's three architectures that violate your first assertion.

Oh, ok, that makes it even easier to say this with certainty:   
Changing the other 64-bit archs to use "long long" for their 64-bit  
numbers will not cause additional warnings.  I'm also almost certain  
there are no architectures which use "long long" for 128-bit  
integers. (Moreover, I can't find hardly anything which does 128-bit  
integers at all).

Cheers,
Kyle Moffett


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Userspace compiler support of "long long"
  2007-06-28 11:53                     ` Kyle Moffett
@ 2007-06-28 12:08                       ` Jakub Jelinek
  2007-06-28 12:18                         ` Kyle Moffett
  0 siblings, 1 reply; 72+ messages in thread
From: Jakub Jelinek @ 2007-06-28 12:08 UTC (permalink / raw)
  To: Kyle Moffett
  Cc: Matthew Wilcox, Adrian Bunk, LKML Kernel, David Woodhouse, david,
	Andi Kleen, linux-arch

On Thu, Jun 28, 2007 at 07:53:51AM -0400, Kyle Moffett wrote:
> On Jun 27, 2007, at 23:57:54, Matthew Wilcox wrote:
> >On Wed, Jun 27, 2007 at 06:30:52PM -0400, Kyle Moffett wrote:
> >>Then all 64-bit archs have:
> >>typedef   signed long      __s64;
> >>typedef unsigned long      __u64;
> >>
> >>While all 32-bit archs have:
> >>typedef   signed long long __s64;
> >>typedef unsigned long long __u64;
> >
> >include/asm-parisc/types.h:typedef unsigned long long __u64;
> >
> >For both 32 and 64-bit.
> >
> >include/asm-sh64/types.h:typedef unsigned long long __u64;
> >include/asm-x86_64/types.h:typedef unsigned long long  __u64;
> >
> >So that's three architectures that violate your first assertion.
> 
> Oh, ok, that makes it even easier to say this with certainty:   
> Changing the other 64-bit archs to use "long long" for their 64-bit  
> numbers will not cause additional warnings.  I'm also almost certain  
> there are no architectures which use "long long" for 128-bit  
> integers. (Moreover, I can't find hardly anything which does 128-bit  
> integers at all).

unsigned long and unsigned long long have the same size, precision
and alignment on all LP64 arches, that's true.  But they have
different ranks and more importantly they mangle differently in C++.
So, whether some user exposed type uses unsigned long or unsigned long long
is part of the ABI, whether that's size_t, uintptr_t, uint64_t, u_int64_t
or any other type, you can't change it without breaking the ABI.

	Jakub

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Userspace compiler support of "long long"
  2007-06-28 10:26                 ` Harald Arnesen
  2007-06-28 10:44                   ` Joerg Schilling
@ 2007-06-28 12:11                   ` Kyle Moffett
  2007-06-28 15:31                     ` Mark Brown
  1 sibling, 1 reply; 72+ messages in thread
From: Kyle Moffett @ 2007-06-28 12:11 UTC (permalink / raw)
  To: Harald Arnesen; +Cc: Adrian Bunk, LKML Kernel, David Woodhouse, david

On Jun 28, 2007, at 06:26:06, Harald Arnesen wrote:
> Adrian Bunk <bunk@stusta.de> writes:
>> Is there any userspace Linux compiler that does not support "long  
>> long"?  If yes, is there any other way to tell that something is a  
>> 64bit int on 32bit architectures?
>
> TenDRA C:
>
> "test.c", line 6: Error:
>   [ISO 6.5.2]: Illegal type specifier, 'long long', assuming 'long'.

I can't even find the docs for their "tcc".  Their "tchk" appears to  
have a "#pragma longlong type allow" or something, so I'd imagine the  
same exists for tcc and would be required to build stuff using kernel  
headers.  On the other hand, their compiler looks so immature that it  
does not appear to be worth spending much time worrying about now.   
When somebody shows up with a solution for that compiler then we can  
look at it at that time.

Cheers,
Kyle Moffett


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Userspace compiler support of "long long"
  2007-06-28 12:08                       ` Jakub Jelinek
@ 2007-06-28 12:18                         ` Kyle Moffett
  0 siblings, 0 replies; 72+ messages in thread
From: Kyle Moffett @ 2007-06-28 12:18 UTC (permalink / raw)
  To: Jakub Jelinek
  Cc: Matthew Wilcox, Adrian Bunk, LKML Kernel, David Woodhouse, david,
	Andi Kleen, linux-arch

On Jun 28, 2007, at 08:08:03, Jakub Jelinek wrote:
> On Thu, Jun 28, 2007 at 07:53:51AM -0400, Kyle Moffett wrote:
>> Oh, ok, that makes it even easier to say this with certainty:  
>> Changing the other 64-bit archs to use "long long" for their 64- 
>> bit numbers will not cause additional warnings.  I'm also almost  
>> certain there are no architectures which use "long long" for 128- 
>> bit integers. (Moreover, I can't find hardly anything which does  
>> 128-bit integers at all).
>
> unsigned long and unsigned long long have the same size, precision  
> and alignment on all LP64 arches, that's true.  But they have  
> different ranks and more importantly they mangle differently in C+ 
> +.  So, whether some user exposed type uses unsigned long or  
> unsigned long long is part of the ABI, whether that's size_t,  
> uintptr_t, uint64_t, u_int64_t or any other type, you can't change  
> it without breaking the ABI.

That sounds *extraordinarily* broken.  Hopefully this would *not*  
affect the type of a function which is passed a C "struct" containing  
the "long long", right?

Hmm, I guess the question is:  Do we support people directly passing  
__u64 to C++ functions in userspace?  I could understand, perhaps,  
passing around structures defined in the kernel headers, but  
certainly not the kernel-internal types.  The only reason we even  
export those is so we can have a private set of bit-size-defined  
types with which to define kernel ABI structures.

Cheers,
Kyle Moffett


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Userspace compiler support of "long long"
  2007-06-28 11:36                             ` David Woodhouse
@ 2007-06-28 12:20                               ` Kyle Moffett
  0 siblings, 0 replies; 72+ messages in thread
From: Kyle Moffett @ 2007-06-28 12:20 UTC (permalink / raw)
  To: David Woodhouse
  Cc: Geert Uytterhoeven, Jan Engelhardt, Randy Dunlap, Adrian Bunk,
	LKML Kernel, david, linux-arch

On Jun 28, 2007, at 07:36:14, David Woodhouse wrote:
> On Thu, 2007-06-28 at 13:34 +0200, Geert Uytterhoeven wrote:
>> We do not support building Linux with Turbo C (or MS Visual C for  
>> Win64 P64).
>
> We're talking about types which are exposed to userspace.

Yes, and all 64-bit software built using kernel headers must be built  
in LP64 mode, anything else is pure insanity.  On LP64 (IE: how the  
kernel itself is compiled on EVERY 64-bit arch):

char == 8 bits
short == 16 bits
int == 32 bits
long == 64 bits
pointer == 64 bits
long long == 64 bits

On LP32 (IE: how the kernel itself is compiled on EVERY 32-bit arch):

char == 8 bits
short == 16 bits
int == 32 bits
long == 32 bits
pointer == 32 bits
long long == 64 bits

Ergo we can simply require that if you want to use kernel headers you  
must be using the same mode as the kernel is compiled in (LP32 or LP64).

The simplest guaranteed-not-to-break way to do this on _every_  
supported platform is:
typedef   signed char  __s8;
typedef unsigned char  __s8;
typedef   signed short __s16;
typedef unsigned short __s16;
typedef   signed int   __s32;
typedef unsigned int   __s32;
# if __STDC_VERSION__ >= 19901L
typedef   signed long long __s64;
typedef unsigned long long __s64;
# elif defined(__GNUC__)
__extension__ typedef   signed long long __s64;
__extension__ typedef unsigned long long __s64;
# endif

If you have some other compiler that works under linux *AND* supports  
a 64-bit type in non-C99-mode (whether "long long" or something  
else), then they are welcome to submit patches to fix it.

Cheers,
Kyle Moffett


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Userspace compiler support of "long long"
  2007-06-28 12:11                   ` Kyle Moffett
@ 2007-06-28 15:31                     ` Mark Brown
  0 siblings, 0 replies; 72+ messages in thread
From: Mark Brown @ 2007-06-28 15:31 UTC (permalink / raw)
  To: Kyle Moffett
  Cc: Harald Arnesen, Adrian Bunk, LKML Kernel, David Woodhouse, david

[-- Attachment #1: Type: text/plain, Size: 1429 bytes --]

On Thu, Jun 28, 2007 at 08:11:59AM -0400, Kyle Moffett wrote:

> I can't even find the docs for their "tcc".  Their "tchk" appears to  

tchk is the same thing pretty much with output disabled.  There's a HTML
copy of the man page here:

  http://www.penguin-soft.com/penguin/man/1/tendracc.html

It's packaged for Debian and therefore Ubuntu and other derived
distributions.

> have a "#pragma longlong type allow" or something, so I'd imagine the  
> same exists for tcc and would be required to build stuff using kernel  
> headers.

You just need to specify -Ysystem (or some other API selection option)
when building to get it to accept long long.  Since TenDRA focuses on
strict standards conformance it defaults to something roughly equivalent
to GCC with -std=c89 -pedantic -Werror and requires the user to
explicitly enable support for any other APIs and features they want to
use.

>           On the other hand, their compiler looks so immature that it  
> does not appear to be worth spending much time worrying about now.   
> When somebody shows up with a solution for that compiler then we can  
> look at it at that time.

The compiler is solid enough but old - it predates C99 and has had no
real development since then beyond updating the system include overrides
to work with newer glibc versions.

-- 
"You grabbed my hand and we fell into it, like a daydream - or a fever."

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 307 bytes --]

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
       [not found]           ` <8B4T2-7py-37@gated-at.bofh.it>
@ 2007-07-01  9:47             ` Bodo Eggert
  0 siblings, 0 replies; 72+ messages in thread
From: Bodo Eggert @ 2007-07-01  9:47 UTC (permalink / raw)
  To: Jan Engelhardt, harald, david, dwmw2, linux-kernel, schilling

Jan Engelhardt <jengelh@computergmbh.de> wrote:
> On Jun 28 2007 12:57, Jan-Benedict Glaw wrote:

>>> > It's not an accusation -- it's merely an observation. You may not have
>>> > noticed that your mailer was misbehaving; now you _do_ know, and if you
>>> > care about RFC compliance you might want to fix it. You're not _obliged_
>>> > to fix it, of course. I just thought you'd like to know.
>>> 
>>> Well there you are: my mailer is definitely NOT missbehaving.
>>> Please do not repeat similar accusations when not knowing the reason.
>>
>>Just out of interest: In which cases do you want to break threading?
> 
> The threading for this thread is ok.

It's broken from 46826d62.lTsuVo9cC7wGjcjf%Joerg.Schilling@fokus.fraunhofer.de
on, or news:8AGnE-33a-13@gated-at.bofh.it

It will be broken again here, this time because of the news gateway.
-- 
Top 100 things you don't want the sysadmin to say:
54. Uh huh......"nu -k $USER".. no problem....sure thing...

Friß, Spammer: maXuz@LA7exnsi.7eggert.dyndns.org q9kcgx.G@w.7eggert.dyndns.org

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-28 13:49   ` Jan Engelhardt
@ 2007-06-29 12:59     ` David Woodhouse
  0 siblings, 0 replies; 72+ messages in thread
From: David Woodhouse @ 2007-06-29 12:59 UTC (permalink / raw)
  To: Jan Engelhardt
  Cc: Sam Ravnborg, Joerg Schilling, arjan, Linux Kernel Mailing List,
	schilling, Ulrich Drepper

On Thu, 2007-06-28 at 15:49 +0200, Jan Engelhardt wrote:
> I'll have to chime in here.
> Test program:
> #include <sys/socket.h>
> #include <sys/stat.h>
> #include <sys/types.h>
> #include <arpa/inet.h>
> #include <netinet/in.h>
> #include <errno.h>
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> #include <unistd.h>
> #include <linux/in.h> /* get IP_FREEBIND */
> 
> Creates a lot of error messages.
> (Lots of redefinitions.)
> 
> $ rpm -q linux-kernel-headers glibc
> linux-kernel-headers-2.6.21-7
> glibc-2.6-5
> (suse 10.3 factory)
> 
> So looks like there's still something to do.

Hm, yes. But what? Is it reasonable for people to include <linux/in.h>
and <netinet/in.h> at the same time? 

It's suboptimal that they have to include <linux/in.h> for certain
definitions, but that file also provides conflicting definitions of
stuff which exists elsewhere.

Should we split <linux/in.h> into two parts?

-- 
dwmw2


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-28 10:57         ` Jan-Benedict Glaw
@ 2007-06-28 16:15           ` Jan Engelhardt
  0 siblings, 0 replies; 72+ messages in thread
From: Jan Engelhardt @ 2007-06-28 16:15 UTC (permalink / raw)
  To: Jan-Benedict Glaw
  Cc: Joerg Schilling, dwmw2, schilling, linux-kernel, harald, david


On Jun 28 2007 12:57, Jan-Benedict Glaw wrote:
>> >
>> > It's not an accusation -- it's merely an observation. You may not have
>> > noticed that your mailer was misbehaving; now you _do_ know, and if you
>> > care about RFC compliance you might want to fix it. You're not _obliged_
>> > to fix it, of course. I just thought you'd like to know.
>> 
>> Well there you are: my mailer is definitely NOT missbehaving.
>> Please do not repeat similar accusations when not knowing the reason.
>
>Just out of interest: In which cases do you want to break threading?

The threading for this thread is ok.


	Jan
-- 

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-27 17:18 ` Sam Ravnborg
  2007-06-28 10:47   ` Joerg Schilling
@ 2007-06-28 13:49   ` Jan Engelhardt
  2007-06-29 12:59     ` David Woodhouse
  1 sibling, 1 reply; 72+ messages in thread
From: Jan Engelhardt @ 2007-06-28 13:49 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Joerg Schilling, arjan, Linux Kernel Mailing List, schilling,
	Ulrich Drepper


On Jun 27 2007 19:18, Sam Ravnborg wrote:
>
>For my test I used latest -git of the Linux kernel.
>In this version the include of ext2_fs_bh.h is guarded
>by __KERNEL__ like this:
>
>#ifdef __KERNEL__
>#include <linux/ext2_fs_sb.h>
>static inline struct ext2_sb_info *EXT2_SB(struct super_block *sb)
>{
>        return sb->s_fs_info;
>}
[...]

I'll have to chime in here.
Test program:
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <linux/in.h> /* get IP_FREEBIND */

Creates a lot of error messages.
(Lots of redefinitions.)

$ rpm -q linux-kernel-headers glibc
linux-kernel-headers-2.6.21-7
glibc-2.6-5
(suse 10.3 factory)

So looks like there's still something to do.



	Jan
-- 

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-28 10:39       ` Joerg Schilling
@ 2007-06-28 10:57         ` Jan-Benedict Glaw
  2007-06-28 16:15           ` Jan Engelhardt
  0 siblings, 1 reply; 72+ messages in thread
From: Jan-Benedict Glaw @ 2007-06-28 10:57 UTC (permalink / raw)
  To: Joerg Schilling; +Cc: dwmw2, schilling, linux-kernel, harald, david

[-- Attachment #1: Type: text/plain, Size: 1113 bytes --]

On Thu, 2007-06-28 12:39:57 +0200, Joerg Schilling <Joerg.Schilling@fokus.fraunhofer.de> wrote:
> > > > By the way, your mailer seems to be sometimes omitting In-Reply-To: and
> > > > References: headers, which RFC2822 says you SHOULD include in replies. 
> > > 
> > > Sending such accusation without knowing the reason is not polite.
> >
> > It's not an accusation -- it's merely an observation. You may not have
> > noticed that your mailer was misbehaving; now you _do_ know, and if you
> > care about RFC compliance you might want to fix it. You're not _obliged_
> > to fix it, of course. I just thought you'd like to know.
> 
> Well there you are: my mailer is definitely NOT missbehaving.
> Please do not repeat similar accusations when not knowing the reason.

Just out of interest: In which cases do you want to break threading?

MfG, JBG

-- 
      Jan-Benedict Glaw      jbglaw@lug-owl.de              +49-172-7608481
Signature of:              What we do for ourselves dies with us. What we do for
the second  :         others and the world remains and is immortal. (Albert Pine)

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-27 17:18 ` Sam Ravnborg
@ 2007-06-28 10:47   ` Joerg Schilling
  2007-06-28 13:49   ` Jan Engelhardt
  1 sibling, 0 replies; 72+ messages in thread
From: Joerg Schilling @ 2007-06-28 10:47 UTC (permalink / raw)
  To: sam; +Cc: schilling, linux-kernel, arjan

Sam Ravnborg <sam@ravnborg.org> wrote:

> > gcc -c t.c
> > In file included from /usr/include/linux/ext2_fs.h:20,
> >                  from t.c:2:
> > /usr/include/linux/ext2_fs_sb.h:40: error: syntax error before âuid_tâ
> > /usr/include/linux/ext2_fs_sb.h:49: error: syntax error before âs_next_generationâ
> > /usr/include/linux/ext2_fs_sb.h:51: error: syntax error before â*â token
> > /usr/include/linux/ext2_fs_sb.h:56: error: syntax error before â}â token
>
> Hi Jörg.
>
> For my test I used latest -git of the Linux kernel.
> In this version the include of ext2_fs_bh.h is guarded
> by __KERNEL__ like this:
>
> #ifdef __KERNEL__
> #include <linux/ext2_fs_sb.h>
> static inline struct ext2_sb_info *EXT2_SB(struct super_block *sb)
> {
>         return sb->s_fs_info;
> }
>

Thank you!

Jörg

-- 
 EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
       js@cs.tu-berlin.de                (uni)  
       schilling@fokus.fraunhofer.de     (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-28 10:37     ` David Woodhouse
@ 2007-06-28 10:39       ` Joerg Schilling
  2007-06-28 10:57         ` Jan-Benedict Glaw
  0 siblings, 1 reply; 72+ messages in thread
From: Joerg Schilling @ 2007-06-28 10:39 UTC (permalink / raw)
  To: dwmw2; +Cc: schilling, linux-kernel, harald, david

David Woodhouse <dwmw2@infradead.org> wrote:

> On Thu, 2007-06-28 at 12:27 +0200, Joerg Schilling wrote:
> > David Woodhouse <dwmw2@infradead.org> wrote:
> > 
> > > On Wed, 2007-06-27 at 16:00 +0200, Joerg Schilling wrote:
> > > > Warning: *** linux/ext2_fs.h is not usable at all ***
> > > > Warning: *** This makes it impossible to support Linux file flags ***
> > > > You may try to compile using 'make COPTX=-DTRY_EXT2_FS'
> > >
> > > Again, can you be _specific_? Amusing though your consistent 'Lunix is
> > > broken' chants are, the only reason I'm bothering to participate in this
> > > thread is on the off-chance that something _productive_ will come of it.
> > 
> > I have been forced to add this test as too many people reported that they
> > have no been able to compile star on their Linux distribution. 
>
> But do you not know _why_? What exactly are you testing _for_?
>
> Bug reports which merely say 'is broken' are not helpful.

If you like to know what I test, I encourage you to check the autoconf
scripts. I am testing whether the named include file may be used from a 
user space program.

As I did mention already, I was forced to add the test in order to be able to
compile at all.


> > > By the way, your mailer seems to be sometimes omitting In-Reply-To: and
> > > References: headers, which RFC2822 says you SHOULD include in replies. 
> > 
> > Sending such accusation without knowing the reason is not polite.
>
> It's not an accusation -- it's merely an observation. You may not have
> noticed that your mailer was misbehaving; now you _do_ know, and if you
> care about RFC compliance you might want to fix it. You're not _obliged_
> to fix it, of course. I just thought you'd like to know.

Well there you are: my mailer is definitely NOT missbehaving.
Please do not repeat similar accusations when not knowing the reason.

Jörg

-- 
 EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
       js@cs.tu-berlin.de                (uni)  
       schilling@fokus.fraunhofer.de     (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-28 10:27   ` Joerg Schilling
@ 2007-06-28 10:37     ` David Woodhouse
  2007-06-28 10:39       ` Joerg Schilling
  0 siblings, 1 reply; 72+ messages in thread
From: David Woodhouse @ 2007-06-28 10:37 UTC (permalink / raw)
  To: Joerg Schilling; +Cc: schilling, linux-kernel, harald, david

On Thu, 2007-06-28 at 12:27 +0200, Joerg Schilling wrote:
> David Woodhouse <dwmw2@infradead.org> wrote:
> 
> > On Wed, 2007-06-27 at 16:00 +0200, Joerg Schilling wrote:
> > > Warning: *** linux/ext2_fs.h is not usable at all ***
> > > Warning: *** This makes it impossible to support Linux file flags ***
> > > You may try to compile using 'make COPTX=-DTRY_EXT2_FS'
> >
> > Again, can you be _specific_? Amusing though your consistent 'Lunix is
> > broken' chants are, the only reason I'm bothering to participate in this
> > thread is on the off-chance that something _productive_ will come of it.
> 
> I have been forced to add this test as too many people reported that they
> have no been able to compile star on their Linux distribution. 

But do you not know _why_? What exactly are you testing _for_?

Bug reports which merely say 'is broken' are not helpful.

> > By the way, your mailer seems to be sometimes omitting In-Reply-To: and
> > References: headers, which RFC2822 says you SHOULD include in replies. 
> 
> Sending such accusation without knowing the reason is not polite.

It's not an accusation -- it's merely an observation. You may not have
noticed that your mailer was misbehaving; now you _do_ know, and if you
care about RFC compliance you might want to fix it. You're not _obliged_
to fix it, of course. I just thought you'd like to know.

-- 
dwmw2


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-27 16:04 ` David Woodhouse
@ 2007-06-28 10:27   ` Joerg Schilling
  2007-06-28 10:37     ` David Woodhouse
  0 siblings, 1 reply; 72+ messages in thread
From: Joerg Schilling @ 2007-06-28 10:27 UTC (permalink / raw)
  To: dwmw2; +Cc: schilling, linux-kernel, harald, david

David Woodhouse <dwmw2@infradead.org> wrote:

> On Wed, 2007-06-27 at 16:00 +0200, Joerg Schilling wrote:
> > Warning: *** linux/ext2_fs.h is not usable at all ***
> > Warning: *** This makes it impossible to support Linux file flags ***
> > You may try to compile using 'make COPTX=-DTRY_EXT2_FS'
>
> Again, can you be _specific_? Amusing though your consistent 'Lunix is
> broken' chants are, the only reason I'm bothering to participate in this
> thread is on the off-chance that something _productive_ will come of it.

I have been forced to add this test as too many people reported that they
have no been able to compile star on their Linux distribution. 


> By the way, your mailer seems to be sometimes omitting In-Reply-To: and
> References: headers, which RFC2822 says you SHOULD include in replies. 

Sending such accusation without knowing the reason is not polite.

Jörg

-- 
 EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
       js@cs.tu-berlin.de                (uni)  
       schilling@fokus.fraunhofer.de     (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-27 22:35       ` Bodo Eggert
@ 2007-06-27 23:07         ` Arjan van de Ven
  0 siblings, 0 replies; 72+ messages in thread
From: Arjan van de Ven @ 2007-06-27 23:07 UTC (permalink / raw)
  To: 7eggert; +Cc: Joerg Schilling, bunk, schilling, sam, linux-kernel


> @Jörg: The responsibility to maintain clean headers shifted only recently,

yes.. from distro to the kernel ;)

in the old case it was always a distro bug...

> and there is possibly still a lot to do. If you can point out errors, they
> can and probably will be fixed. But as you know, having a precise error
> message or description does help.

absolutely. if you find issues with the "real" kernel headers (eg the
make headers_install ones) ... as you have seen there's lots of interest
to make sure they're as useful as reasonably possible


-- 
if you want to mail me at work (you don't), use arjan (at) linux.intel.com
Test the interaction between Linux and your BIOS via http://www.linuxfirmwarekit.org


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
       [not found]     ` <8AKUp-1wx-41@gated-at.bofh.it>
@ 2007-06-27 22:35       ` Bodo Eggert
  2007-06-27 23:07         ` Arjan van de Ven
  0 siblings, 1 reply; 72+ messages in thread
From: Bodo Eggert @ 2007-06-27 22:35 UTC (permalink / raw)
  To: Arjan van de Ven, Joerg Schilling, bunk, schilling, sam, linux-kernel

Arjan van de Ven <arjan@infradead.org> wrote:
> On Wed, 2007-06-27 at 18:41 +0200, Joerg Schilling wrote:

>> Well, I did report these kind of problems many years ago and as it has not
>> been fixed after some years, I was asuming that it is still the way I see it
>> on Suse 10.0.
> 
> I'd suggest reporting SuSE bugs to SuSE; that's more effective ;)
> (although I don't know how they will deal with bugreports against older
> versions)
> 
> your bug looks certainly valid.. just you're not using the "proper"
> header set that the kernel developers suggest ;)

Even though you put the smiley there, it does not seem fair to expect people
to know the latest bits of kernel developement and deployment procedures
unless hanging around on lkml is a requirement for linux users. I'm just
browsing that list, filtering and ignoring a lot. If I didn't do that, I
would not even suspect something like make headers_install to exist, nor
would I try to search for it.

@Jörg: The responsibility to maintain clean headers shifted only recently,
and there is possibly still a lot to do. If you can point out errors, they
can and probably will be fixed. But as you know, having a precise error
message or description does help.
-- 
W.I.N.D.O.W.S.:
 Wireless Intelligent Neohuman Designed for Observation and Worldwide Sabotage
        -- http://www.brunching.com/toys/toy-cyborger.html (down)
Friß, Spammer: IQ@7eggert.dyndns.org kgrQit6@p.7eggert.dyndns.org

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-27 13:45 Joerg Schilling
@ 2007-06-27 22:16 ` H. Peter Anvin
  0 siblings, 0 replies; 72+ messages in thread
From: H. Peter Anvin @ 2007-06-27 22:16 UTC (permalink / raw)
  To: Joerg Schilling; +Cc: bunk, dwmw2, david, linux-kernel, schilling

Joerg Schilling wrote:
> 
> After copying /usr/include/linux/types.h  to
> /opt/sunstudio12/prod/include/cc/linux/types.h and removing all 
> 
> #if defined(__GNUC__) && !defined(__STRICT_ANSI__) 
> ...
> #endif
> 
> stuff, I got cdrtools compiled using "suncc" and I did even get a woring 
> cdrecord.
> 

Indeed, this guard is bogus.

	-hpa


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-27 16:41   ` Joerg Schilling
@ 2007-06-27 18:50     ` Arjan van de Ven
  0 siblings, 0 replies; 72+ messages in thread
From: Arjan van de Ven @ 2007-06-27 18:50 UTC (permalink / raw)
  To: Joerg Schilling; +Cc: bunk, schilling, sam, linux-kernel

On Wed, 2007-06-27 at 18:41 +0200, Joerg Schilling wrote:

> Well, I did report these kind of problems many years ago and as it has not been 
> fixed after some years, I was asuming that it is still the way I see it on Suse 
> 10.0.

I'd suggest reporting SuSE bugs to SuSE; that's more effective ;)
(although I don't know how they will deal with bugreports against older
versions)

your bug looks certainly valid.. just you're not using the "proper"
header set that the kernel developers suggest ;)


-- 
if you want to mail me at work (you don't), use arjan (at) linux.intel.com
Test the interaction between Linux and your BIOS via http://www.linuxfirmwarekit.org


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-27 13:58 Joerg Schilling
  2007-06-27 16:40 ` Adrian Bunk
@ 2007-06-27 17:18 ` Sam Ravnborg
  2007-06-28 10:47   ` Joerg Schilling
  2007-06-28 13:49   ` Jan Engelhardt
  1 sibling, 2 replies; 72+ messages in thread
From: Sam Ravnborg @ 2007-06-27 17:18 UTC (permalink / raw)
  To: Joerg Schilling; +Cc: arjan, linux-kernel, schilling

On Wed, Jun 27, 2007 at 03:58:43PM +0200, Joerg Schilling wrote:
> Sam Ravnborg <sam@ravnborg.org> wrote:
> 
> > On Mon, Jun 25, 2007 at 04:53:55PM +0200, Joerg Schilling wrote:
> > > 
> > > star needs "ext2_fs.h". This file is not usable at all on many Linux 
> > > distributions, even with GCC.
> >
> > I was curious so I did:
> >
> > $ mkdir ~/foo
> > $ cd ~/kernel/linux-2.6
> > $ make INSTALL_HDR_PATH=~/foo
> > $ cd ~/foo
> > $ cat j.c
> > #include <stdio.h>
> > #include "etx2_fs.h"
> >
> > main()
> > {
> > 	printf("helloo\n");
> > }
> >
> > $ gcc -o j j.c
> > => No warning, no errors
> >
> 
> On Suse Linux 10.0, I get e.g.:
> 
> cat t.c
> #include <stdio.h>
> #include <linux/ext2_fs.h>
> 
> gcc -c t.c
> In file included from /usr/include/linux/ext2_fs.h:20,
>                  from t.c:2:
> /usr/include/linux/ext2_fs_sb.h:40: error: syntax error before âuid_tâ
> /usr/include/linux/ext2_fs_sb.h:49: error: syntax error before âs_next_generationâ
> /usr/include/linux/ext2_fs_sb.h:51: error: syntax error before â*â token
> /usr/include/linux/ext2_fs_sb.h:56: error: syntax error before â}â token

Hi Jörg.

For my test I used latest -git of the Linux kernel.
In this version the include of ext2_fs_bh.h is guarded
by __KERNEL__ like this:

#ifdef __KERNEL__
#include <linux/ext2_fs_sb.h>
static inline struct ext2_sb_info *EXT2_SB(struct super_block *sb)
{
        return sb->s_fs_info;
}

And therefore the include statement is removed in the exported set of kernel
include files.
So this particular issue is solved with the latest kernel and using the headers
prepared for export.

This tells me that we are on the right track with exporting the headers and sanitize them.

	Sam

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-27 16:40 ` Adrian Bunk
@ 2007-06-27 16:41   ` Joerg Schilling
  2007-06-27 18:50     ` Arjan van de Ven
  0 siblings, 1 reply; 72+ messages in thread
From: Joerg Schilling @ 2007-06-27 16:41 UTC (permalink / raw)
  To: bunk; +Cc: schilling, sam, linux-kernel, arjan

Adrian Bunk <bunk@stusta.de> wrote:

> > On Suse Linux 10.0, I get e.g.:
> > 
> > cat t.c
> > #include <stdio.h>
> > #include <linux/ext2_fs.h>
> > 
> > gcc -c t.c
> > In file included from /usr/include/linux/ext2_fs.h:20,
> >                  from t.c:2:
> > /usr/include/linux/ext2_fs_sb.h:40: error: syntax error before âuid_tâ
> > /usr/include/linux/ext2_fs_sb.h:49: error: syntax error before âs_next_generationâ
> > /usr/include/linux/ext2_fs_sb.h:51: error: syntax error before â*â token
> > /usr/include/linux/ext2_fs_sb.h:56: error: syntax error before â}â token
>
> Already fixed since kernel 2.6.18.
>
> Our header were a mess and we are working on getting them better.
> But we can't timetravel and fix old distributions.

Well, I did report these kind of problems many years ago and as it has not been 
fixed after some years, I was asuming that it is still the way I see it on Suse 
10.0.



Jörg

-- 
 EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
       js@cs.tu-berlin.de                (uni)  
       schilling@fokus.fraunhofer.de     (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-27 13:58 Joerg Schilling
@ 2007-06-27 16:40 ` Adrian Bunk
  2007-06-27 16:41   ` Joerg Schilling
  2007-06-27 17:18 ` Sam Ravnborg
  1 sibling, 1 reply; 72+ messages in thread
From: Adrian Bunk @ 2007-06-27 16:40 UTC (permalink / raw)
  To: Joerg Schilling; +Cc: sam, arjan, linux-kernel, schilling

On Wed, Jun 27, 2007 at 03:58:43PM +0200, Joerg Schilling wrote:
> Sam Ravnborg <sam@ravnborg.org> wrote:
> 
> > On Mon, Jun 25, 2007 at 04:53:55PM +0200, Joerg Schilling wrote:
> > > 
> > > star needs "ext2_fs.h". This file is not usable at all on many Linux 
> > > distributions, even with GCC.
> >
> > I was curious so I did:
> >
> > $ mkdir ~/foo
> > $ cd ~/kernel/linux-2.6
> > $ make INSTALL_HDR_PATH=~/foo
> > $ cd ~/foo
> > $ cat j.c
> > #include <stdio.h>
> > #include "etx2_fs.h"
> >
> > main()
> > {
> > 	printf("helloo\n");
> > }
> >
> > $ gcc -o j j.c
> > => No warning, no errors
> >
> 
> On Suse Linux 10.0, I get e.g.:
> 
> cat t.c
> #include <stdio.h>
> #include <linux/ext2_fs.h>
> 
> gcc -c t.c
> In file included from /usr/include/linux/ext2_fs.h:20,
>                  from t.c:2:
> /usr/include/linux/ext2_fs_sb.h:40: error: syntax error before âuid_tâ
> /usr/include/linux/ext2_fs_sb.h:49: error: syntax error before âs_next_generationâ
> /usr/include/linux/ext2_fs_sb.h:51: error: syntax error before â*â token
> /usr/include/linux/ext2_fs_sb.h:56: error: syntax error before â}â token

Already fixed since kernel 2.6.18.

Our header were a mess and we are working on getting them better.
But we can't timetravel and fix old distributions.

> Jörg

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
  2007-06-27 14:00 Joerg Schilling
@ 2007-06-27 16:04 ` David Woodhouse
  2007-06-28 10:27   ` Joerg Schilling
  0 siblings, 1 reply; 72+ messages in thread
From: David Woodhouse @ 2007-06-27 16:04 UTC (permalink / raw)
  To: Joerg Schilling; +Cc: harald, david, linux-kernel, schilling

On Wed, 2007-06-27 at 16:00 +0200, Joerg Schilling wrote:
> Warning: *** linux/ext2_fs.h is not usable at all ***
> Warning: *** This makes it impossible to support Linux file flags ***
> You may try to compile using 'make COPTX=-DTRY_EXT2_FS'

Again, can you be _specific_? Amusing though your consistent 'Lunix is
broken' chants are, the only reason I'm bothering to participate in this
thread is on the off-chance that something _productive_ will come of it.

By the way, your mailer seems to be sometimes omitting In-Reply-To: and
References: headers, which RFC2822 says you SHOULD include in replies. 

-- 
dwmw2


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
@ 2007-06-27 14:00 Joerg Schilling
  2007-06-27 16:04 ` David Woodhouse
  0 siblings, 1 reply; 72+ messages in thread
From: Joerg Schilling @ 2007-06-27 14:00 UTC (permalink / raw)
  To: harald; +Cc: david, dwmw2, linux-kernel, schilling

Harald Arnesen <harald@skogtun.org> wrote:

> Joerg.Schilling@fokus.fraunhofer.de (Joerg Schilling) writes:
>
> >> If I actually install smake, as Jörg recommends, the message becomes:
> >> smake: Can't find any source for 'CCOM_suncc'.
> >> smake: Couldn't make 'CCOM_suncc'.
> >
> > Well, I was in hope that a small typo (in special as the correct spelling is in 
> > the file README.compile) should not be a problem.
> >
> > You need to use CCOM=suncc 
>
> Then it (star, I haven't tried cdrtools yes) compiles and links fine.
> There must be something wrong with your Linux installation.

Maybe because it automatically deactivates the Linux extensions if the 
autoconfiguration sees broken include files. Did you see something like:

checking if Linux include file linux/ext2_fs.h is broken... yes
checking if Linux include file /usr/src/linux/include/linux/ext2_fs.h is broken... yes
checking if Linux include file scsi/scsi.h is broken... no
checking if Linux include file /usr/src/linux/include/scsi/scsi.h is broken... no
checking if Linux include file scsi/sg.h is broken... no
checking if Linux include file /usr/src/linux/include/scsi/sg.h is broken... no

Warning: *** /usr/src/linux/include contains broken include files ***
Warning: *** /usr/src/linux/include is not used this reason ***
Warning: This may result in the inability to use recent Linux kernel interfaces


Warning: *** linux/ext2_fs.h is not usable at all ***
Warning: *** This makes it impossible to support Linux file flags ***
You may try to compile using 'make COPTX=-DTRY_EXT2_FS'

Jörg

-- 
 EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
       js@cs.tu-berlin.de                (uni)  
       schilling@fokus.fraunhofer.de     (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
@ 2007-06-27 13:58 Joerg Schilling
  2007-06-27 16:40 ` Adrian Bunk
  2007-06-27 17:18 ` Sam Ravnborg
  0 siblings, 2 replies; 72+ messages in thread
From: Joerg Schilling @ 2007-06-27 13:58 UTC (permalink / raw)
  To: sam; +Cc: arjan, linux-kernel, schilling

Sam Ravnborg <sam@ravnborg.org> wrote:

> On Mon, Jun 25, 2007 at 04:53:55PM +0200, Joerg Schilling wrote:
> > 
> > star needs "ext2_fs.h". This file is not usable at all on many Linux 
> > distributions, even with GCC.
>
> I was curious so I did:
>
> $ mkdir ~/foo
> $ cd ~/kernel/linux-2.6
> $ make INSTALL_HDR_PATH=~/foo
> $ cd ~/foo
> $ cat j.c
> #include <stdio.h>
> #include "etx2_fs.h"
>
> main()
> {
> 	printf("helloo\n");
> }
>
> $ gcc -o j j.c
> => No warning, no errors
>

On Suse Linux 10.0, I get e.g.:

cat t.c
#include <stdio.h>
#include <linux/ext2_fs.h>

gcc -c t.c
In file included from /usr/include/linux/ext2_fs.h:20,
                 from t.c:2:
/usr/include/linux/ext2_fs_sb.h:40: error: syntax error before âuid_tâ
/usr/include/linux/ext2_fs_sb.h:49: error: syntax error before âs_next_generationâ
/usr/include/linux/ext2_fs_sb.h:51: error: syntax error before â*â token
/usr/include/linux/ext2_fs_sb.h:56: error: syntax error before â}â token

Jörg

-- 
 EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
       js@cs.tu-berlin.de                (uni)  
       schilling@fokus.fraunhofer.de     (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: Linux Kernel include files
@ 2007-06-27 13:45 Joerg Schilling
  2007-06-27 22:16 ` H. Peter Anvin
  0 siblings, 1 reply; 72+ messages in thread
From: Joerg Schilling @ 2007-06-27 13:45 UTC (permalink / raw)
  To: bunk, dwmw2; +Cc: david, linux-kernel, schilling

Adrian Bunk <bunk@stusta.de> wrote:

> > Personally, I think that's a load of bollocks. And it certainly doesn't
> > apply to Linux-specific files like <linux/cdrom.h>, which are perfectly
> > entitled to use a C standard from last millennium, regardless of
> > namespace 'pollution' issues. That's why we continue to use the crappy
> > __u32 types. Can you be more specific about why this is a problem? Don't
> > we mostly define those crappy types using arch-specific knowledge, as
> > 'int', 'long', etc?
> >...
>
> It would certainly help if Joerg would tell what exactly breaks, but I 
> spot one likely problem in include/asm-i386/types.h:
>
> #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
> typedef __signed__ long long __s64;
> typedef unsigned long long __u64;
> #endif
>
> It might make sense to remove the #if and simply require that
> a C compiler under Linux must know about the C99 "long long"?

The Sun compiler did support the long long type before gcc did.
This is not a problem.

I get e.g.:

 ==> COMPILING "scsihack.o"
"/usr/include/linux/byteorder/little_endian.h", line 43: inline keyword applied to __le64: must be a function identifier
"/usr/include/linux/byteorder/little_endian.h", line 43: syntax error before or at: __cpu_to_le64p
"/usr/include/linux/byteorder/little_endian.h", line 45: operands must have arithmetic type: op "*"
"/usr/include/linux/byteorder/little_endian.h", line 47: syntax error before or at: *
"/usr/include/linux/byteorder/little_endian.h", line 49: undefined symbol: p
"/usr/include/linux/byteorder/little_endian.h", line 49: cannot dereference non-pointer type
"/usr/include/linux/byteorder/little_endian.h", line 67: inline keyword applied to __be64: must be a function identifier
"/usr/include/linux/byteorder/little_endian.h", line 67: syntax error before or at: __cpu_to_be64p
"/usr/include/linux/byteorder/little_endian.h", line 69: syntax error before or at: __swab64p
"/usr/include/linux/byteorder/little_endian.h", line 71: syntax error before or at: *
"/usr/include/linux/byteorder/little_endian.h", line 73: undefined symbol: p
"scsi-linux-sg.c", line 1152: warning: statement not reached
cc: acomp failed for scsihack.c

And it seems that yout proposal did point into the right direction.

After copying /usr/include/linux/types.h  to
/opt/sunstudio12/prod/include/cc/linux/types.h and removing all 

#if defined(__GNUC__) && !defined(__STRICT_ANSI__) 
...
#endif

stuff, I got cdrtools compiled using "suncc" and I did even get a woring 
cdrecord.

Thanks for the help!

Jörg

-- 
 EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
       js@cs.tu-berlin.de                (uni)  
       schilling@fokus.fraunhofer.de     (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily

^ permalink raw reply	[flat|nested] 72+ messages in thread

end of thread, other threads:[~2007-07-01  9:47 UTC | newest]

Thread overview: 72+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-21 22:32 Linux Kernel include files Joerg Schilling
2007-06-21 23:25 ` david
2007-06-21 23:38   ` Joerg Schilling
2007-06-22  3:38     ` David Woodhouse
2007-06-22  5:18       ` H. Peter Anvin
2007-06-22 15:00       ` Adrian Bunk
2007-06-26 15:26         ` H. Peter Anvin
2007-06-27  1:32         ` Kyle Moffett
2007-06-27 15:40           ` Adrian Bunk
2007-06-27 15:52             ` Joerg Schilling
2007-06-27 15:59               ` Robert P. J. Day
2007-06-27 17:32               ` Userspace compiler support of "long long" Adrian Bunk
2007-06-27 22:30                 ` Kyle Moffett
2007-06-27 22:57                   ` Randy Dunlap
2007-06-27 23:16                     ` Randy Dunlap
2007-06-28  2:12                       ` Geert Uytterhoeven
2007-06-28  6:50                         ` Jan Engelhardt
2007-06-28 11:34                           ` Geert Uytterhoeven
2007-06-28 11:36                             ` David Woodhouse
2007-06-28 12:20                               ` Kyle Moffett
2007-06-28  3:06                       ` Kyle McMartin
2007-06-28  0:30                   ` Andi Kleen
2007-06-28 11:42                     ` Kyle Moffett
2007-06-28  3:57                   ` Matthew Wilcox
2007-06-28 11:53                     ` Kyle Moffett
2007-06-28 12:08                       ` Jakub Jelinek
2007-06-28 12:18                         ` Kyle Moffett
2007-06-28  4:03                   ` H. Peter Anvin
2007-06-28 10:26                 ` Harald Arnesen
2007-06-28 10:44                   ` Joerg Schilling
2007-06-28 12:11                   ` Kyle Moffett
2007-06-28 15:31                     ` Mark Brown
2007-06-28  4:02           ` Linux Kernel include files H. Peter Anvin
2007-06-25 15:17       ` Joerg Schilling
2007-06-25 15:27         ` David Woodhouse
2007-06-25 18:04           ` Harald Arnesen
2007-06-25 20:26             ` Joerg Schilling
2007-06-25 20:32               ` David Woodhouse
2007-06-25 21:43               ` Harald Arnesen
2007-06-25 21:48                 ` Harald Arnesen
2007-06-25 21:49                   ` Joerg Schilling
2007-06-25 22:30                     ` Harald Arnesen
2007-06-25 22:42                       ` Joerg Schilling
2007-06-21 23:59   ` Arnd Bergmann
2007-06-25 15:06     ` Joerg Schilling
2007-06-25 16:00       ` david
2007-06-25 14:48   ` Joerg Schilling
2007-06-21 23:47 ` Arjan van de Ven
2007-06-25 14:53   ` Joerg Schilling
2007-06-25 15:26     ` Arjan van de Ven
2007-06-25 15:27       ` Robert P. J. Day
2007-06-25 20:18     ` Sam Ravnborg
2007-06-27 13:45 Joerg Schilling
2007-06-27 22:16 ` H. Peter Anvin
2007-06-27 13:58 Joerg Schilling
2007-06-27 16:40 ` Adrian Bunk
2007-06-27 16:41   ` Joerg Schilling
2007-06-27 18:50     ` Arjan van de Ven
2007-06-27 17:18 ` Sam Ravnborg
2007-06-28 10:47   ` Joerg Schilling
2007-06-28 13:49   ` Jan Engelhardt
2007-06-29 12:59     ` David Woodhouse
2007-06-27 14:00 Joerg Schilling
2007-06-27 16:04 ` David Woodhouse
2007-06-28 10:27   ` Joerg Schilling
2007-06-28 10:37     ` David Woodhouse
2007-06-28 10:39       ` Joerg Schilling
2007-06-28 10:57         ` Jan-Benedict Glaw
2007-06-28 16:15           ` Jan Engelhardt
     [not found] <8AGnE-33a-15@gated-at.bofh.it>
     [not found] ` <8AISu-6Qn-31@gated-at.bofh.it>
     [not found]   ` <8AISu-6Qn-29@gated-at.bofh.it>
     [not found]     ` <8AKUp-1wx-41@gated-at.bofh.it>
2007-06-27 22:35       ` Bodo Eggert
2007-06-27 23:07         ` Arjan van de Ven
     [not found] <8AGnE-33a-13@gated-at.bofh.it>
     [not found] ` <8AIfO-63r-29@gated-at.bofh.it>
     [not found]   ` <8AZJA-7BV-3@gated-at.bofh.it>
     [not found]     ` <8AZJA-7BV-1@gated-at.bofh.it>
     [not found]       ` <8AZJQ-7BV-15@gated-at.bofh.it>
     [not found]         ` <8AZTo-7OT-3@gated-at.bofh.it>
     [not found]           ` <8B4T2-7py-37@gated-at.bofh.it>
2007-07-01  9:47             ` Bodo Eggert

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).