Changeset a0a273e in mainline for kernel/Makefile
- Timestamp:
- 2017-10-03T18:12:17Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a41cda7
- Parents:
- 0f28387
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/Makefile
r0f28387 ra0a273e 84 84 DEFS = -DKERNEL -DRELEASE=$(RELEASE) "-DCOPYRIGHT=$(COPYRIGHT)" "-DNAME=$(NAME)" -D__$(BITS)_BITS__ -D__$(ENDIANESS)__ 85 85 86 GCC_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \87 -f exec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS)\88 -f input-charset=UTF-8 -ffreestanding -fno-builtin -nostdlib -nostdinc \89 -std=gnu99 -Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes \ 90 -Werror-implicit-function-declaration -Wwrite-strings\91 - pipe92 93 ICC_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \ 94 -ffreestanding -fno-builtin -nostdlib -nostdinc-Wall -Wmissing-prototypes \86 COMMON_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \ 87 -ffreestanding -fno-builtin -nostdlib -nostdinc \ 88 -fexec-charset=UTF-8 -finput-charset=UTF-8 89 90 GCC_CFLAGS = -std=gnu99 -Wall -Wextra -Wno-unused-parameter \ 91 -Wmissing-prototypes -Werror-implicit-function-declaration \ 92 -Wwrite-strings -pipe 93 94 ICC_CFLAGS = -Wall -Wmissing-prototypes \ 95 95 -Werror-implicit-function-declaration -wd170 96 96 97 # clang does not support following options but I am not sure whether 98 # something won't break because of that: 99 # -fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) -finput-charset=UTF-8 100 CLANG_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \ 101 -ffreestanding -fno-builtin -nostdlib -nostdinc \ 102 -std=gnu99 -Wall -Werror -Wextra -Wno-unused-parameter -Wmissing-prototypes \ 103 -Werror-implicit-function-declaration -Wwrite-strings \ 104 -integrated-as -pipe -target $(CLANG_TARGET) 97 CLANG_CFLAGS = -std=gnu99 -Wall -Wextra -Wno-unused-parameter \ 98 -Wmissing-prototypes -Werror-implicit-function-declaration \ 99 -Wwrite-strings -pipe -fno-stack-protector -fno-PIC 105 100 106 101 ifeq ($(CONFIG_DEBUG),y) 107 GCC_CFLAGS += -Werror 108 ICC_CFLAGS += -Werror 102 COMMON_CFLAGS += -Werror 109 103 endif 110 104 111 105 ifeq ($(CONFIG_LTO),y) 112 GCC_CFLAGS += -flto106 COMMON_CFLAGS += -flto 113 107 endif 114 108 115 109 ifeq ($(CONFIG_LINE_DEBUG),y) 116 GCC_CFLAGS += -g 117 ICC_CFLAGS += -g 118 CLANG_CFLAGS += -g 110 COMMON_CFLAGS += -g 119 111 endif 120 112 … … 123 115 # AFLAGS and LFLAGS must be initialized before the inclusion. 124 116 # 125 AFLAGS = --fatal-warnings117 AFLAGS = 126 118 LFLAGS = -n -T $(LINK) -M --fatal-warnings 119 120 # FIXME: This condition is a workaround for issues #693 and #694. 121 ifneq ($(KARCH),sparc64) 122 ifneq ($(KARCH),mips32) 123 AFLAGS += --fatal-warnings 124 endif 125 endif 127 126 128 127 # … … 156 155 157 156 ifeq ($(COMPILER),gcc_native) 158 CFLAGS = $( GCC_CFLAGS)157 CFLAGS = $(COMMON_CFLAGS) $(GCC_CFLAGS) 159 158 DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS) 160 159 INSTRUMENTATION = -finstrument-functions … … 162 161 163 162 ifeq ($(COMPILER),gcc_cross) 164 CFLAGS = $( GCC_CFLAGS)163 CFLAGS = $(COMMON_CFLAGS) $(GCC_CFLAGS) 165 164 DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS) 166 165 INSTRUMENTATION = -finstrument-functions … … 168 167 169 168 ifeq ($(COMPILER),gcc_helenos) 170 CFLAGS = $( GCC_CFLAGS)169 CFLAGS = $(COMMON_CFLAGS) $(GCC_CFLAGS) 171 170 DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS) 172 171 INSTRUMENTATION = -finstrument-functions … … 174 173 175 174 ifeq ($(COMPILER),icc) 176 CFLAGS = $( ICC_CFLAGS)175 CFLAGS = $(COMMON_CFLAGS) $(ICC_CFLAGS) 177 176 DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS) 178 177 INSTRUMENTATION = … … 180 179 181 180 ifeq ($(COMPILER),clang) 182 CFLAGS = $(C LANG_CFLAGS)181 CFLAGS = $(COMMON_CFLAGS) $(CLANG_CFLAGS) 183 182 DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS) 184 INSTRUMENTATION = 183 INSTRUMENTATION = -finstrument-functions 185 184 endif 186 185 … … 384 383 AUTOGENS_AG := $(ARCH_AUTOGENS_AG) $(GENARCH_AUTOGENS_AG) 385 384 386 LFLAGS_LTO := $(addprefix -Xlinker ,$(LFLAGS)) 385 AS_CFLAGS := $(addprefix -Xassembler ,$(AFLAGS)) 386 LD_CFLAGS := $(addprefix -Xlinker ,$(LFLAGS)) 387 388 ifeq ($(COMPILER),clang) 389 AS_CFLAGS += -mllvm -asm-macro-max-nesting-depth=1000 390 endif 387 391 388 392 ifeq ($(CONFIG_SYMTAB),y) … … 404 408 $(RAW): $(LINK) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(SYMTAB_OBJECTS) 405 409 ifeq ($(CONFIG_LTO),y) 406 $( GCC) $(LFLAGS_LTO) -Xlinker -Map -Xlinker $(MAP) $(DEFS) $(GCC_CFLAGS) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(SYMTAB_OBJECTS)410 $(CC) $(DEFS) $(CFLAGS) $(LD_CFLAGS) -Xlinker -Map -Xlinker $(MAP) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(SYMTAB_OBJECTS) 407 411 else 408 412 $(LD) $(LFLAGS) -Map $(MAP) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(SYMTAB_OBJECTS) … … 417 421 %.h: %.ag 418 422 $(AUTOGEN) probe $< >$<.probe.c 419 $(CC ) $(DEFS) $(CFLAGS) -S -o $<.probe.s $<.probe.c423 $(CC_AUTOGEN) $(DEFS) $(CFLAGS) -S -o $<.probe.s $<.probe.c 420 424 $(AUTOGEN) generate $< <$<.probe.s >$@ 421 425 422 426 %.o: %.S $(DEPEND) 423 $( GCC) $(DEFS) $(GCC_CFLAGS) -D__ASM__ -c -o $@ $<427 $(CC) $(DEFS) $(CFLAGS) $(AS_CFLAGS) -D__ASM__ -c -o $@ $< 424 428 ifeq ($(PRECHECK),y) 425 $(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $( GCC_CFLAGS) -D__ASM__429 $(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $(CFLAGS) -D__ASM__ 426 430 endif 427 431 428 432 %.o: %.s $(DEPEND) 429 $( AS) $(AFLAGS)-o $@ $<433 $(CC) $(DEFS) $(CFLAGS) $(AS_CFLAGS) -D__ASM__ -c -o $@ $< 430 434 ifeq ($(PRECHECK),y) 431 435 $(JOBFILE) $(JOB) $< $@ as asm $(DEFS) $(CFLAGS) $(EXTRA_FLAGS) … … 439 443 440 444 $(REAL_MAP).o: $(REAL_MAP).bin 441 echo "$(AS_PROLOG)""$(SYMTAB_SECTION)"" .incbin \"$<\"" | $( AS) $(AFLAGS) -o $@445 echo "$(AS_PROLOG)""$(SYMTAB_SECTION)"" .incbin \"$<\"" | $(CC) $(CFLAGS) $(AS_CFLAGS) -x assembler -c -o $@ - 442 446 443 447 $(REAL_MAP).bin: $(LINK) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) 444 echo "$(AS_PROLOG)""$(SYMTAB_SECTION)" | $( AS) $(AFLAGS) -o $(EMPTY_MAP)448 echo "$(AS_PROLOG)""$(SYMTAB_SECTION)" | $(CC) $(CFLAGS) $(AS_CFLAGS) -x assembler -c -o $(EMPTY_MAP) - 445 449 ifeq ($(CONFIG_LTO),y) 446 $( GCC) $(LFLAGS_LTO) -Xlinker -Map -Xlinker $(MAP_PREV) $(DEFS) $(GCC_CFLAGS) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(EMPTY_MAP)450 $(CC) $(DEFS) $(CFLAGS) $(LD_CFLAGS) -Xlinker -Map -Xlinker $(MAP_PREV) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(EMPTY_MAP) 447 451 else 448 452 $(LD) $(LFLAGS) -Map $(MAP_PREV) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(EMPTY_MAP) … … 454 458 # on architectures that have bss after symtab 455 459 456 echo "$(AS_PROLOG)""$(SYMTAB_SECTION)"" .incbin \"$@\"" | $( AS) $(AFLAGS) -o $(SIZEOK_MAP)460 echo "$(AS_PROLOG)""$(SYMTAB_SECTION)"" .incbin \"$@\"" | $(CC) $(CFLAGS) $(AS_CFLAGS) -x assembler -c -o $(SIZEOK_MAP) - 457 461 ifeq ($(CONFIG_LTO),y) 458 $( GCC) $(LFLAGS_LTO) -Xlinker -Map -Xlinker $(MAP_PREV) $(DEFS) $(GCC_CFLAGS) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(SIZEOK_MAP)462 $(CC) $(DEFS) $(CFLAGS) $(LD_CFLAGS) -Xlinker -Map -Xlinker $(MAP_PREV) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(SIZEOK_MAP) 459 463 else 460 464 $(LD) $(LFLAGS) -Map $(MAP_PREV) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(SIZEOK_MAP)
Note:
See TracChangeset
for help on using the changeset viewer.