Changeset 52d30c4 in mainline


Ignore:
Timestamp:
2007-06-05T21:24:40Z (17 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4a8635b
Parents:
92d349c8
Message:

A bit of infrastructure for building with different compilers.
CFLAGS split into GCC_CFLAGS and SUNCC_CFLAGS.
As of now, there are no separate ICC_CFLAGS, but can be easily added.

Location:
kernel
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • kernel/Makefile

    r92d349c8 r52d30c4  
    3737#
    3838
    39 DEFS = -D$(ARCH) -DARCH=\"$(ARCH)\" -DRELEASE=\"$(RELEASE)\" "-DNAME=\"$(NAME)\"" -DKERNEL
    40 CFLAGS = -fno-builtin -fomit-frame-pointer -Wall -Wmissing-prototypes -Werror -O3 -nostdlib -nostdinc -Igeneric/include/
    41 
    42 #SUNCC_CFLAGS = -xO3 -Igeneric/include/ -xnolib -xc99=all \
    43 #-D__FUNCTION__=__func__ -features=extensions \
    44 #-erroff=E_ZERO_SIZED_STRUCT_UNION
     39DEFS = -D$(ARCH) -DARCH=\"$(ARCH)\" -DRELEASE=\"$(RELEASE)\" "-DNAME=\"$(NAME)\"" \
     40        -DKERNEL
     41
     42GCC_CFLAGS = -fno-builtin -fomit-frame-pointer -Wall -Wmissing-prototypes \
     43        -Werror -O3 -nostdlib -nostdinc -Igeneric/include/
     44
     45SUNCC_CFLAGS = -xO3 -Igeneric/include/ -xnolib -xc99=all \
     46        -D__FUNCTION__=__func__ -features=extensions \
     47        -erroff=E_ZERO_SIZED_STRUCT_UNION
     48
    4549
    4650LFLAGS = -M
     
    132136        OBJDUMP = objdump
    133137        LIBDIR = /usr/lib
     138        CFLAGS = $(GCC_CFLAGS)
    134139endif
    135140
     
    142147        OBJDUMP = objdump
    143148        LIBDIR = /usr/lib
     149        CFLAGS = $(GCC_CFLAGS)
    144150endif
    145151
     
    152158        OBJDUMP = objdump
    153159        LIBDIR = /usr/lib
     160        CFLAGS = $(SUNCC_CFLAGS)
    154161endif
    155162
     
    162169        OBJDUMP = $(TOOLCHAIN_DIR)/bin/$(TARGET)-objdump
    163170        LIBDIR = $(TOOLCHAIN_DIR)/lib
     171        CFLAGS = $(GCC_CFLAGS)
    164172endif
    165173
  • kernel/arch/amd64/Makefile.inc

    r92d349c8 r52d30c4  
    3636TOOLCHAIN_DIR = /usr/local/amd64
    3737
    38 CFLAGS += -fno-unwind-tables -m64 -mcmodel=kernel -mno-red-zone
     38GCC_CFLAGS += -fno-unwind-tables -m64 -mcmodel=kernel -mno-red-zone
     39SUNCC_CFLAGS += -m64 -xmodel=kernel
     40
    3941DEFS += -DMACHINE=$(MACHINE) -D__64_BITS__
    4042
     
    4345
    4446ifeq ($(MACHINE),opteron)
    45         CFLAGS += -march=opteron
     47        GCC_CFLAGS += -march=opteron   
    4648        DEFS += -DFENCES=p4
    4749endif
  • kernel/arch/arm32/Makefile.inc

    r92d349c8 r52d30c4  
    3737TOOLCHAIN_DIR = /usr/local/arm
    3838
    39 CFLAGS +=
     39GCC_CFLAGS +=
    4040
    4141DEFS += -D__32_BITS__ -DMACHINE=$(MACHINE)
  • kernel/arch/ia32/Makefile.inc

    r92d349c8 r52d30c4  
    3737
    3838DEFS += -DMACHINE=$(MACHINE) -D__32_BITS__
     39SUNCC_CFLAGS = -m32
    3940
    4041## Accepted CPUs
     
    4243
    4344ifeq ($(MACHINE),athlon-xp)
    44         CFLAGS += -march=athlon-xp -mmmx -msse -m3dnow
     45        GCC_CFLAGS += -march=athlon-xp -mmmx -msse -m3dnow
    4546        DEFS += -DCONFIG_FENCES_P3
    4647        CONFIG_SMP = n
     
    4849endif
    4950ifeq ($(MACHINE),athlon-mp)
    50         CFLAGS += -march=athlon-mp -mmmx -msse -m3dnow
     51        GCC_CFLAGS += -march=athlon-mp -mmmx -msse -m3dnow
    5152        DEFS += -DCONFIG_FENCES_P3
    5253        CONFIG_HT = n
    5354endif
    5455ifeq ($(MACHINE),pentium3)
    55         CFLAGS += -march=pentium3 -mmmx -msse
     56        GCC_CFLAGS += -march=pentium3 -mmmx -msse
    5657        DEFS += -DCONFIG_FENCES_P3
    5758        CONFIG_HT = n
    5859endif
    5960ifeq ($(MACHINE),prescott)
    60         CFLAGS += -march=pentium4 -mfpmath=sse -mmmx -msse -msse2 -msse3
     61        GCC_CFLAGS += -march=pentium4 -mfpmath=sse -mmmx -msse -msse2 -msse3
    6162        DEFS += -DCONFIG_FENCES_P4
    6263endif
    6364ifeq ($(MACHINE),pentium4)
    6465        ifeq ($(COMPILER),icc_native)
    65                 CFLAGS += -march=pentium4
     66                GCC_CFLAGS += -march=pentium4
    6667        else
    67                 CFLAGS += -march=pentium4 -mfpmath=sse -mmmx -msse -msse2
     68                GCC_CFLAGS += -march=pentium4 -mfpmath=sse -mmmx -msse -msse2
    6869        endif
    6970        DEFS += -DCONFIG_FENCES_P4
  • kernel/arch/ia32xen/Makefile.inc

    r92d349c8 r52d30c4  
    3838DEFS += -DMACHINE=$(MACHINE) -D__32_BITS__
    3939
     40SUNCC_CFLAGS = -m32
     41
    4042## Accepted CPUs
    4143#
    4244
    4345ifeq ($(MACHINE),athlon-xp)
    44         CFLAGS += -march=athlon-xp -mmmx -msse -m3dnow
     46        GCC_CFLAGS += -march=athlon-xp -mmmx -msse -m3dnow
    4547        DEFS += -DCONFIG_FENCES_P3
    4648        CONFIG_SMP = n
     
    4850endif
    4951ifeq ($(MACHINE),athlon-mp)
    50         CFLAGS += -march=athlon-mp -mmmx -msse -m3dnow
     52        GCC_CFLAGS += -march=athlon-mp -mmmx -msse -m3dnow
    5153        DEFS += -DCONFIG_FENCES_P3
    5254        CONFIG_HT = n
    5355endif
    5456ifeq ($(MACHINE),pentium3)
    55         CFLAGS += -march=pentium3 -mmmx -msse
     57        GCC_CFLAGS += -march=pentium3 -mmmx -msse
    5658        DEFS += -DCONFIG_FENCES_P3
    5759        CONFIG_HT = n
    5860endif
    5961ifeq ($(MACHINE),prescott)
    60         CFLAGS += -march=pentium4 -mfpmath=sse -mmmx -msse -msse2 -msse3
     62        GCC_CFLAGS += -march=pentium4 -mfpmath=sse -mmmx -msse -msse2 -msse3
    6163        DEFS += -DCONFIG_FENCES_P4
    6264endif
    6365ifeq ($(MACHINE),pentium4)
    64         CFLAGS += -march=pentium4 -mfpmath=sse -mmmx -msse -msse2
     66        GCC_CFLAGS += -march=pentium4 -mfpmath=sse -mmmx -msse -msse2
    6567        DEFS += -DCONFIG_FENCES_P4
    6668endif
  • kernel/arch/ia64/Makefile.inc

    r92d349c8 r52d30c4  
    3939INIT0_SIZE = 0x100000
    4040
    41 CFLAGS += -mconstant-gp -fno-unwind-tables -mfixed-range=f32-f127
     41GCC_CFLAGS += -mconstant-gp -fno-unwind-tables -mfixed-range=f32-f127
    4242LFLAGS += -EL
    4343AFLAGS += -mconstant-gp
  • kernel/arch/mips32/Makefile.inc

    r92d349c8 r52d30c4  
    3838INIT_SIZE = 262144
    3939
    40 CFLAGS += -mno-abicalls -G 0 -fno-zero-initialized-in-bss
     40GCC_CFLAGS += -mno-abicalls -G 0 -fno-zero-initialized-in-bss
    4141
    4242DEFS += -D__32_BITS__ -DMACHINE=$(MACHINE) -DKERNEL_LOAD_ADDRESS=${KERNEL_LOAD_ADDRESS} -DINIT_ADDRESS=${INIT_ADDRESS} -DINIT_SIZE=${INIT_SIZE}
     
    6767        TOOLCHAIN_DIR = /usr/local/mips/bin
    6868        KERNEL_LOAD_ADDRESS = 0x88002000
    69         CFLAGS += -EB -DBIG_ENDIAN -DARCH_HAS_FPU -march=r4600
     69        GCC_CFLAGS += -EB -DBIG_ENDIAN -DARCH_HAS_FPU -march=r4600
    7070        INIT_ADDRESS = 0
    7171        INIT_SIZE = 0
     
    8181        TARGET = mips-sgi-irix5
    8282        TOOLCHAIN_DIR = /usr/local/mips/bin
    83         CFLAGS += -EB -DBIG_ENDIAN -DARCH_HAS_FPU -mips3
     83        GCC_CFLAGS += -EB -DBIG_ENDIAN -DARCH_HAS_FPU -mips3
    8484        INIT_ADDRESS = 0x81800000
    8585endif
     
    9090        BFD_NAME = elf32-tradlittlemips
    9191        BFD = elf32-tradlittlemips
    92         CFLAGS += -mhard-float -mips3 -DTLBCNT=16
     92        GCC_CFLAGS += -mhard-float -mips3 -DTLBCNT=16
    9393        TLBCNT = 16
    9494endif
     
    9696        BFD_NAME = elf32-tradlittlemips
    9797        BFD = binary
    98         CFLAGS += -mhard-float -mips3
     98        GCC_CFLAGS += -mhard-float -mips3
    9999endif
    100100
  • kernel/arch/ppc32/Makefile.inc

    r92d349c8 r52d30c4  
    3636TOOLCHAIN_DIR = /usr/local/ppc
    3737
    38 CFLAGS += -mcpu=powerpc -msoft-float -m32
     38GCC_CFLAGS += -mcpu=powerpc -msoft-float -m32
    3939AFLAGS += -a32
    4040LFLAGS += -no-check-sections -N
  • kernel/arch/ppc64/Makefile.inc

    r92d349c8 r52d30c4  
    3636TOOLCHAIN_DIR = /usr/local/ppc64
    3737
    38 CFLAGS += -mcpu=powerpc64 -msoft-float -m64
     38GCC_CFLAGS += -mcpu=powerpc64 -msoft-float -m64
    3939AFLAGS += -a64
    4040LFLAGS += -no-check-sections -N
  • kernel/arch/sparc64/Makefile.inc

    r92d349c8 r52d30c4  
    3636TOOLCHAIN_DIR = /usr/local/sparc64
    3737
    38 CFLAGS += -mcpu=ultrasparc -m64
     38GCC_CFLAGS += -mcpu=ultrasparc -m64
     39SUNCC_CFLAGS +=
    3940LFLAGS += -no-check-sections -N
    4041
Note: See TracChangeset for help on using the changeset viewer.