Re: compiling the kernel not using (linux, gcc)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 22, 2005 at 06:46:30 +0200, MHD.Tayseer wrote:
> well .. the "unraliable guide to kernel hacking" sais that there are the 
> following gnu extentions in the linux kernel:
> 
>    *
> 
>      Inline functions
> 
>    *
> 
>      Statement expressions (ie. the ({ and }) constructs).
> 
>    *
> 
>      Declaring attributes of a function / variable / type (__attribute__)
> 
>    *
> 
>      Labeled elements
> 
>    *
> 
>      typeof
> 
>    *
> 
>      Zero length arrays
> 
>    *
> 
>      Macro varargs
> 
>    *
> 
>      Arithmetic on void pointers
> 
>    *
> 
>      Non-Constant initializers
> 
>    *
> 
>      Assembler Instructions (not outside arch/ and include/asm/)
> 
>    *
> 
>      Function names as strings (__FUNCTION__)
> 
>    *
> 
>      __builtin_constant_p()
> 
> is there more/less of those extensions now ? the document mentioned 
> above is dated 2000 and i think life has changed so much inside the 
> linux kernel since then...

I would add one quite significant -- heavy wizardry in the linker script.
I believe linker script takes care of marking start and end of the init list
and some other very important things. And AFAIK that's a GNU-ld specific
stuff.

> another question ..  is there a known work around of those extensions to 
> turn them into Ansi C?, or such an extensions are hard to be done under 

Some have already made it in C99 standard, so many compilers may provide them
now, though the syntax is usually slightly different than the old gcc
extension.

> ansi C .. i mean that it may be trivial to move a declaration or an 
> expression two or three lines before .. is it trivial as text/syntax 
> modifications or there are extensions that are based on a special gcc logic?

The block expression might be quite hard sometimes. But the major problem are
some of the __attribute__ specification -- asmlinkage (chages the calling
convention) and initcall/exitcall things (the linker script applies magic to
them). And of course though the AT&T assembly syntax can be translated, it's
not all *that* easy.

> and if i wanna use cygwin .. i know that this question may now be asked 
> here but can i call windows executable (the compiler in my case) from 
> cygwin without recompiling/modifying it ?

Sure you can. As well as you can run cygwin executable from windows directly,
as long as it can find the appropriate dynamic library.

-- 
						 Jan 'Bulb' Hudec <bulb@xxxxxx>

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux