Changeset 6ab8697 in mainline for kernel


Ignore:
Timestamp:
2009-10-07T14:03:35Z (16 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2088dfc
Parents:
7a53208
Message:

use builtin_va_* for va_* functions and va_list type
(this is probably safer than our own implementation since it respects the particular ABI used by the compiler)
this fixes kernel printf() when using clang

Location:
kernel
Files:
8 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • kernel/Makefile

    r7a53208 r6ab8697  
    4949GCC_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) -imacros ../config.h \
    5050        -fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) \
    51         -finput-charset=UTF-8 -fno-builtin -Wall -Wextra -Wno-unused-parameter \
    52         -Wmissing-prototypes -Werror -nostdlib -nostdinc -pipe
     51        -finput-charset=UTF-8 -ffreestanding -fno-builtin -nostdlib -nostdinc \
     52        -Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes -Werror \
     53        -pipe
    5354
    5455ICC_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) -imacros ../config.h \
    55         -fno-builtin -Wall -Wmissing-prototypes -Werror \
    56         -nostdlib -nostdinc -wd170
     56        -ffreestanding -fno-builtin -nostdlib -nostdinc -Wall -Wmissing-prototypes \
     57        -Werror -wd170
    5758
    5859SUNCC_CFLAGS = -I$(INCLUDES) -xO$(OPTIMIZATION) \
     
    6263CLANG_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) -imacros ../config.h \
    6364        -fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) \
    64         -finput-charset=UTF-8 -fno-builtin -Wall -Wextra -Wno-unused-parameter \
    65         -Wmissing-prototypes -nostdlib -nostdinc -pipe
     65        -finput-charset=UTF-8 -ffreestanding -fno-builtin -nostdlib -nostdinc \
     66        -Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes -pipe \
     67        -arch $(CLANG_ARCH)
    6668
    6769LFLAGS = -M
  • kernel/arch/amd64/Makefile.inc

    r7a53208 r6ab8697  
    3434BFD = binary
    3535TARGET = amd64-linux-gnu
     36CLANG_ARCH = x86_64
    3637TOOLCHAIN_DIR = $(CROSS_PREFIX)/amd64
    3738
  • kernel/arch/ia32/Makefile.inc

    r7a53208 r6ab8697  
    3434BFD = binary
    3535TARGET = i686-pc-linux-gnu
     36CLANG_ARCH = i386
    3637TOOLCHAIN_DIR = $(CROSS_PREFIX)/ia32
    3738
  • kernel/generic/include/print.h

    r7a53208 r6ab8697  
    3737
    3838#include <arch/types.h>
    39 #include <arch/arg.h>
     39#include <stdarg.h>
    4040
    4141#define EOF (-1)
  • kernel/generic/include/printf/printf_core.h

    r7a53208 r6ab8697  
    3737
    3838#include <typedefs.h>
    39 #include <arch/arg.h>
     39#include <stdarg.h>
    4040
    4141/** Structure for specifying output methods for different printf clones. */
  • kernel/generic/include/stdarg.h

    r7a53208 r6ab8697  
    2727 */
    2828
    29 /** @addtogroup generic 
     29/** @addtogroup generic
    3030 * @{
    3131 */
     
    3737 * for all architectures with compiler support for __builtin_va_*.
    3838 */
    39  
     39
    4040#ifndef KERN_STDARG_H_
    4141#define KERN_STDARG_H_
     
    4343typedef __builtin_va_list va_list;
    4444
    45 #define va_start(ap, last)              __builtin_va_start(ap, last)
    46 #define va_arg(ap, type)                __builtin_va_arg(ap, type)
    47 #define va_end(ap)                      __builtin_va_end(ap)
    48 #define va_copy(dst, src)               __builtin_va_copy(dst, src)
     45#define va_start(ap, last)  __builtin_va_start(ap, last)
     46#define va_arg(ap, type)    __builtin_va_arg(ap, type)
     47#define va_end(ap)          __builtin_va_end(ap)
     48#define va_copy(dst, src)   __builtin_va_copy(dst, src)
    4949
    5050#endif
  • kernel/generic/src/printf/printf_core.c

    r7a53208 r6ab8697  
    3939#include <printf/printf_core.h>
    4040#include <print.h>
    41 #include <arch/arg.h>
     41#include <stdarg.h>
    4242#include <macros.h>
    4343#include <string.h>
Note: See TracChangeset for help on using the changeset viewer.