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-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
* 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 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
[parent not found: <8AGnE-33a-15@gated-at.bofh.it>]
[parent not found: <8AGnE-33a-13@gated-at.bofh.it>]

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