Changeset 874ed210 in mainline for kernel/Makefile


Ignore:
Timestamp:
2019-06-24T16:13:58Z (5 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
59d8235
Parents:
d86393c8
Message:

Fold assembler flags into cflags, for consistent behavior

This way —fatal-warning applies to custom assembly in C files as well,
e.g. inline asm, and to some of the attributes that change emitted
assembly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/Makefile

    rd86393c8 r874ed210  
    9292        -ffreestanding -nostdlib \
    9393        -fexec-charset=UTF-8 -finput-charset=UTF-8 -fno-common \
    94         -fdebug-prefix-map=$(realpath $(ROOT_PATH))=.
     94        -fdebug-prefix-map=$(realpath $(ROOT_PATH))=. \
     95        -Wa,--fatal-warnings
    9596
    9697GCC_CFLAGS = -std=gnu11 -Wall -Wextra -Wno-unused-parameter \
     
    101102        -Wno-missing-field-initializers -Wno-unused-command-line-argument \
    102103        -Wmissing-prototypes -Werror-implicit-function-declaration \
    103         -Wwrite-strings -pipe -fno-stack-protector -fno-PIC
     104        -Wwrite-strings -pipe -fno-stack-protector -fno-PIC \
     105        -mllvm -asm-macro-max-nesting-depth=1000
    104106
    105107ifeq ($(CONFIG_DEBUG),y)
     
    119121endif
    120122
    121 AFLAGS += --fatal-warnings
    122123LDFLAGS += -Wl,-n -T $(LINK) -Wl,-M,--fatal-warnings,--warn-common
    123124
     
    341342GENARCH_DEPENDS := $(addsuffix .d,$(basename $(GENARCH_SOURCES)))
    342343
    343 AS_CFLAGS := $(addprefix -Xassembler ,$(AFLAGS))
    344 
    345344-include $(GENERIC_DEPENDS)
    346345-include $(ARCH_DEPENDS)
    347346-include $(GENARCH_DEPENDS)
    348347
    349 ifeq ($(COMPILER),clang)
    350         AS_CFLAGS += -mllvm -asm-macro-max-nesting-depth=1000
    351 endif
    352 
    353348ifeq ($(CONFIG_SYMTAB),y)
    354349        SYMTAB_OBJECTS := generic/src/debug/real_map.o
     
    374369
    375370%.o: %.S
    376         $(CC_JOB) -c -MD -MP $(DEFS) $(CFLAGS) $(AS_CFLAGS)
     371        $(CC_JOB) -c -MD -MP $(DEFS) $(CFLAGS)
    377372
    378373%.o: %.s
    379         $(CC_JOB) -c -MD -MP $(DEFS) $(CFLAGS) $(AS_CFLAGS)
     374        $(CC_JOB) -c -MD -MP $(DEFS) $(CFLAGS)
    380375
    381376%.o: %.c
     
    383378
    384379$(REAL_MAP).o: $(REAL_MAP).bin
    385         echo "$(AS_PROLOG)""$(SYMTAB_SECTION)"" .incbin \"$<\"" | $(CC) $(CFLAGS) $(AS_CFLAGS) -x assembler -c -o $@ -
     380        echo "$(AS_PROLOG)""$(SYMTAB_SECTION)"" .incbin \"$<\"" | $(CC) $(CFLAGS) -x assembler -c -o $@ -
    386381
    387382$(REAL_MAP).bin: $(LINK) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS)
    388         echo "$(AS_PROLOG)""$(SYMTAB_SECTION)" | $(CC) $(CFLAGS) $(AS_CFLAGS) -x assembler -c -o $(EMPTY_MAP) -
     383        echo "$(AS_PROLOG)""$(SYMTAB_SECTION)" | $(CC) $(CFLAGS) -x assembler -c -o $(EMPTY_MAP) -
    389384        $(CC) $(DEFS) $(CFLAGS) $(LDFLAGS) -Wl,-Map,$(MAP_PREV) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(EMPTY_MAP)
    390385        $(OBJDUMP) -t $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) > $(DUMP)
     
    394389        # on architectures that have bss after symtab
    395390
    396         echo "$(AS_PROLOG)""$(SYMTAB_SECTION)"" .incbin \"$@\"" | $(CC) $(CFLAGS) $(AS_CFLAGS) -x assembler -c -o $(SIZEOK_MAP) -
     391        echo "$(AS_PROLOG)""$(SYMTAB_SECTION)"" .incbin \"$@\"" | $(CC) $(CFLAGS) -x assembler -c -o $(SIZEOK_MAP) -
    397392        $(CC) $(DEFS) $(CFLAGS) $(LDFLAGS) -Wl,-Map,$(MAP_PREV) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(SIZEOK_MAP)
    398393        $(OBJDUMP) -t $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) > $(DUMP)
Note: See TracChangeset for help on using the changeset viewer.