Changeset a0a273e in mainline for kernel/arch


Ignore:
Timestamp:
2017-10-03T18:12:17Z (8 years ago)
Author:
jzr <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a41cda7
Parents:
0f28387
Message:

Unify compiler handling a bit.

Most compiler flags have been changed from GCC-specific to "common",
since code might build but not work properly without them.
Clang still rejects some of the flags, but at least we can see
the incompatibilities now.

Explicit —target flag was removed from clang, in favor of using clang
through a target-specific symlink. This allows clang to automatically
find correct assembler and linker, if it needs to.

Additionally, assembly language files are now compiled using $(CC)
whether or not they need the preprocessor. This allows clang to build
.s files using its integrated assembler.

Location:
kernel/arch
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/abs32le/Makefile.inc

    r0f28387 ra0a273e  
    3535       
    3636        ifeq ($(CROSS_TARGET),mips32)
    37                 GCC_CFLAGS += -mno-abicalls
     37                COMMON_CFLAGS += -mno-abicalls
    3838        endif
    3939endif
  • kernel/arch/amd64/Makefile.inc

    r0f28387 ra0a273e  
    3232
    3333FPU_NO_CFLAGS = -mno-sse -mno-sse2
    34 CMN1 = -m64 -mcmodel=$(MEMORY_MODEL) -mno-red-zone -fno-unwind-tables -fno-omit-frame-pointer
    35 GCC_CFLAGS += $(CMN1)
    36 ICC_CFLAGS += $(CMN1)
    37 CLANG_CFLAGS += $(CMN1)
     34COMMON_CFLAGS += -m64 -mcmodel=$(MEMORY_MODEL) -mno-red-zone -fno-unwind-tables -fno-omit-frame-pointer
    3835
    3936BITS = 64
     
    4441
    4542ifeq ($(PROCESSOR),opteron)
    46         CMN2 := -march=opteron
    47         GCC_CFLAGS += $(CMN2)
    48         ICC_CFLAGS += $(CMN2)
     43        COMMON_CFLAGS += -march=opteron
    4944endif
    5045
  • kernel/arch/arm32/Makefile.inc

    r0f28387 ra0a273e  
    3333ATSIGN = %
    3434
    35 GCC_CFLAGS += -fno-omit-frame-pointer -mapcs-frame -march=$(subst _,-,$(PROCESSOR_ARCH)) -mno-unaligned-access -mfpu=vfpv3
     35COMMON_CFLAGS += -fno-omit-frame-pointer -mapcs-frame -march=$(subst _,-,$(PROCESSOR_ARCH)) -mno-unaligned-access -mfpu=vfpv3
    3636
    3737ifeq ($(CONFIG_FPU),y)
  • kernel/arch/ia32/Makefile.inc

    r0f28387 ra0a273e  
    3434ENDIANESS = LE
    3535
    36 CMN1 = -m32 -fno-omit-frame-pointer
    37 GCC_CFLAGS += $(CMN1)
    38 ICC_CFLAGS += $(CMN1)
    39 CLANG_CFLAGS += $(CMN1)
     36COMMON_CFLAGS += -m32 -fno-omit-frame-pointer
    4037
    4138## Accepted CPUs
     
    4340
    4441ifeq ($(PROCESSOR),i486)
    45         CMN2 = -march=i486
     42        COMMON_CFLAGS += -march=i486
    4643endif
    4744
    4845ifeq ($(PROCESSOR),athlon_xp)
    49         CMN2 = -march=athlon-xp
     46        COMMON_CFLAGS += -march=athlon-xp
    5047endif
    5148
    5249ifeq ($(PROCESSOR),athlon_mp)
    53         CMN2 = -march=athlon-mp
     50        COMMON_CFLAGS += -march=athlon-mp
    5451endif
    5552
    5653ifeq ($(PROCESSOR),pentium3)
    57         CMN2 = -march=pentium3
     54        COMMON_CFLAGS += -march=pentium3
    5855endif
    5956
    6057ifeq ($(PROCESSOR),pentium4)
    61         CMN2 = -march=pentium4
     58        COMMON_CFLAGS += -march=pentium4
    6259endif
    6360
    6461ifeq ($(PROCESSOR),core)
    65         CMN2 = -march=prescott
     62        COMMON_CFLAGS += -march=prescott
    6663endif
    6764
    6865FPU_NO_CFLAGS = -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow
    69 GCC_CFLAGS += $(CMN2)
    70 ICC_CFLAGS += $(CMN2)
    71 CLANG_CFLAGS += $(CMN2)
    7266
    7367ARCH_SOURCES = \
  • kernel/arch/ia64/Makefile.inc

    r0f28387 ra0a273e  
    3030BFD_ARCH = ia64-elf64
    3131
    32 CMN1 = -mconstant-gp -fno-unwind-tables -mfixed-range=f32-f127
    33 GCC_CFLAGS += $(CMN1)
    34 ICC_CFLAGS += $(CMN1)
     32COMMON_CFLAGS += -mconstant-gp -fno-unwind-tables -mfixed-range=f32-f127
    3533
    3634AFLAGS += -mconstant-gp
  • kernel/arch/mips32/Makefile.inc

    r0f28387 ra0a273e  
    2929BFD_ARCH = mips
    3030BFD = binary
    31 GCC_CFLAGS += -msoft-float -mno-abicalls -G 0 -fno-zero-initialized-in-bss -mabi=32
     31COMMON_CFLAGS += -msoft-float -mno-abicalls -G 0 -fno-zero-initialized-in-bss -mabi=32
    3232AS_PROLOG = .module softfloat;
    3333
     
    4040        BFD_NAME = elf32-tradlittlemips
    4141        ENDIANESS = LE
    42         GCC_CFLAGS += -march=r4000
     42        COMMON_CFLAGS += -march=r4000
    4343endif
    4444ifeq ($(MACHINE),bmalta)
    4545        BFD_NAME = elf32-tradbigmips
    4646        ENDIANESS = BE
    47         GCC_CFLAGS += -D__BE__ -march=4kc
     47        COMMON_CFLAGS += -D__BE__ -march=4kc
    4848endif
    4949ifeq ($(MACHINE),lmalta)
    5050        BFD_NAME = elf32-tradlittlemips
    5151        ENDIANESS = LE
    52         GCC_CFLAGS += -march=4kc
     52        COMMON_CFLAGS += -march=4kc
    5353endif
    5454
  • kernel/arch/ppc32/Makefile.inc

    r0f28387 ra0a273e  
    3131BFD = binary
    3232
    33 GCC_CFLAGS += -mcpu=powerpc -msoft-float -m32
     33COMMON_CFLAGS += -mcpu=powerpc -msoft-float -m32
    3434AFLAGS += -a32
    3535LFLAGS += -no-check-sections
  • kernel/arch/riscv64/Makefile.inc

    r0f28387 ra0a273e  
    3131BFD = binary
    3232
    33 GCC_CFLAGS += -mcmodel=medany
     33COMMON_CFLAGS += -mcmodel=medany
    3434
    3535BITS = 64
  • kernel/arch/sparc64/Makefile.inc

    r0f28387 ra0a273e  
    3131BFD = binary
    3232
    33 GCC_CFLAGS += -m64 -mcpu=ultrasparc -mcmodel=medlow -mno-fpu
     33COMMON_CFLAGS += -m64 -mcpu=ultrasparc -mcmodel=medlow -mno-fpu
    3434
    3535LFLAGS += -no-check-sections
Note: See TracChangeset for help on using the changeset viewer.