Changeset 69dc065 in mainline for kernel/Makefile


Ignore:
Timestamp:
2009-09-17T22:42:56Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c1618ed
Parents:
82cf692
Message:

initial Clang support

this is more like a proof-of-concept (tested with Clang and LLVM 2.6-pre1)

  • it is limited to ia32/amd64, but it will probably fail except compiling ia32 target on ia32 host
  • actually only Clang as compiler is used, native binutils are used for standalone assembler files and linking
  • kernel compiles fine, boots and even prints some scrambled initial messages to the framebuffer, but panics soon after that (it might be just a tiny glitch in output functions)
  • uspace compiles mostly fine, but the linking fails
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/Makefile

    r82cf692 r69dc065  
    5454ICC_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) -imacros ../config.h \
    5555        -fno-builtin -Wall -Wmissing-prototypes -Werror \
    56         -nostdlib -nostdinc \
    57         -wd170
     56        -nostdlib -nostdinc -wd170
    5857
    5958SUNCC_CFLAGS = -I$(INCLUDES) -xO$(OPTIMIZATION) \
    6059        -xnolib -xc99=all -features=extensions \
    6160        -erroff=E_ZERO_SIZED_STRUCT_UNION
     61
     62CLANG_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) -imacros ../config.h \
     63        -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
    6266
    6367LFLAGS = -M
     
    109113endif
    110114
    111 ifeq ($(COMPILER),icc_native)
     115ifeq ($(COMPILER),gcc_cross)
     116        CC = $(TOOLCHAIN_DIR)/bin/$(TARGET)-gcc
     117        GCC = $(CC)
     118        AS = $(TOOLCHAIN_DIR)/bin/$(TARGET)-as
     119        LD = $(TOOLCHAIN_DIR)/bin/$(TARGET)-ld
     120        OBJCOPY = $(TOOLCHAIN_DIR)/bin/$(TARGET)-objcopy
     121        OBJDUMP = $(TOOLCHAIN_DIR)/bin/$(TARGET)-objdump
     122        LIBDIR = $(TOOLCHAIN_DIR)/lib
     123        CFLAGS = $(GCC_CFLAGS)
     124        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
     125endif
     126
     127ifeq ($(COMPILER),icc)
    112128        CC = icc
    113129        GCC = gcc
     
    121137endif
    122138
    123 ifeq ($(COMPILER),suncc_native)
     139ifeq ($(COMPILER),suncc)
    124140        CC = suncc
    125141        GCC = gcc
     
    134150endif
    135151
    136 ifeq ($(COMPILER),gcc_cross)
    137         CC = $(TOOLCHAIN_DIR)/bin/$(TARGET)-gcc
    138         GCC = $(CC)
    139         AS = $(TOOLCHAIN_DIR)/bin/$(TARGET)-as
    140         LD = $(TOOLCHAIN_DIR)/bin/$(TARGET)-ld
    141         OBJCOPY = $(TOOLCHAIN_DIR)/bin/$(TARGET)-objcopy
    142         OBJDUMP = $(TOOLCHAIN_DIR)/bin/$(TARGET)-objdump
    143         LIBDIR = $(TOOLCHAIN_DIR)/lib
    144         CFLAGS = $(GCC_CFLAGS)
     152ifeq ($(COMPILER),clang)
     153        CC = clang
     154        GCC = gcc
     155        AS = $(BINUTILS_PREFIX)as
     156        LD = $(BINUTILS_PREFIX)ld
     157        OBJCOPY = $(BINUTILS_PREFIX)objcopy
     158        OBJDUMP = $(BINUTILS_PREFIX)objdump
     159        LIBDIR = /usr/lib
     160        CFLAGS = $(CLANG_CFLAGS)
    145161        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    146162endif
Note: See TracChangeset for help on using the changeset viewer.