Changeset 874ed210 in mainline


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.

Files:
7 edited

Legend:

Unmodified
Added
Removed
  • boot/Makefile.build

    rd86393c8 r874ed210  
    3636DEFS = -DBOOT -DRELEASE=$(RELEASE) "-DCOPYRIGHT=$(COPYRIGHT)" "-DNAME=$(NAME)" -D__$(BITS)_BITS__ -D__$(ENDIANESS)__
    3737
    38 AFLAGS = --fatal-warnings
    3938LDFLAGS = -Wl,--fatal-warnings,--warn-common $(EXTRA_LDFLAGS)
    4039
     
    4241        -ffreestanding -nostdlib \
    4342        -fexec-charset=UTF-8 -finput-charset=UTF-8 -fno-common \
    44         -fdebug-prefix-map=$(realpath $(ROOT_PATH))=.
     43        -fdebug-prefix-map=$(realpath $(ROOT_PATH))=. \
     44        -Wa,--fatal-warnings
    4545
    4646GCC_CFLAGS = -Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes \
     
    8080-include $(DEPENDS)
    8181
    82 AS_CFLAGS := $(addprefix -Xassembler ,$(AFLAGS))
    83 
    8482$(BOOT_OUTPUT): $(RAW)
    8583        $(OBJCOPY) -O $(BFD_OUTPUT) $< $@
     
    9290
    9391%.o: %.s | depend
    94         $(CC_JOB) -c -MD -MP $(DEFS) $(CFLAGS) $(AS_CFLAGS)
     92        $(CC_JOB) -c -MD -MP $(DEFS) $(CFLAGS)
    9593
    9694%.o: %.S | depend
    97         $(CC_JOB) -c -MD -MP $(DEFS) $(CFLAGS) $(AS_CFLAGS)
     95        $(CC_JOB) -c -MD -MP $(DEFS) $(CFLAGS)
    9896
    9997%.o: %.c | depend
  • 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)
  • kernel/arch/arm32/Makefile.inc

    rd86393c8 r874ed210  
    3535        # This is necessary to allow vmsr insn and fpexc manipulation
    3636        # Use vfp32 to allow context save/restore of d16-d31 regs.
    37         AFLAGS += -mfloat-abi=hard -mfpu=vfp3
     37        COMMON_CFLAGS += -mfloat-abi=hard
    3838endif
    3939
  • kernel/arch/ia64/Makefile.inc

    rd86393c8 r874ed210  
    3030COMMON_CFLAGS += -mconstant-gp -fno-unwind-tables -mfixed-range=f32-f127
    3131
    32 AFLAGS += -mconstant-gp
    3332LDFLAGS += -Wl,-EL
    3433
  • kernel/arch/ppc32/Makefile.inc

    rd86393c8 r874ed210  
    2828
    2929
    30 COMMON_CFLAGS += -mcpu=powerpc -msoft-float -m32
    31 AFLAGS += -a32
     30COMMON_CFLAGS += -mcpu=powerpc -msoft-float -m32 -Wa,-a32
    3231LDFLAGS += -Wl,-no-check-sections
    3332
  • uspace/Makefile.common

    rd86393c8 r874ed210  
    109109START_FILES = $(LIBC_PREFIX)/crt0.o $(LIBC_PREFIX)/crt1.o
    110110
    111 AFLAGS = --fatal-warnings
    112111LDFLAGS = -Wl,--fatal-warnings,--warn-common
    113112
     
    194193        -Werror-implicit-function-declaration \
    195194        -Wsystem-headers \
    196         -Wunknown-pragmas
     195        -Wunknown-pragmas \
     196        -Wa,--fatal-warnings
    197197
    198198# XXX: -fno-builtin-strftime is for a seemingly spurious format warning.
     
    299299LIB_LDFLAGS = $(LDFLAGS) -shared -Wl,-soname,$(LSONAME) -Wl,--no-undefined,--no-allow-shlib-undefined
    300300
    301 AS_CFLAGS := $(addprefix -Xassembler ,$(AFLAGS))
    302 
    303301OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
    304302LOBJECTS := $(addsuffix .lo,$(basename $(SOURCES)))
     
    386384
    387385%.o: %.S | depend
    388         $(CC_JOB) -c -MD -MP $(DEFS) $(CFLAGS) $(EXTRA_CFLAGS) $(AS_CFLAGS)
     386        $(CC_JOB) -c -MD -MP $(DEFS) $(CFLAGS) $(EXTRA_CFLAGS)
    389387
    390388%.o: %.s | depend
    391         $(CC_JOB) -c -MD -MP $(DEFS) $(CFLAGS) $(EXTRA_CFLAGS) $(AS_CFLAGS)
     389        $(CC_JOB) -c -MD -MP $(DEFS) $(CFLAGS) $(EXTRA_CFLAGS)
    392390
    393391%.o: %.c | depend
     
    407405
    408406%.lo: %.S | depend
    409         $(CC_JOB) -c -MD -MP $(DEFS) $(LIB_CFLAGS) $(EXTRA_CFLAGS) $(AS_CFLAGS)
     407        $(CC_JOB) -c -MD -MP $(DEFS) $(LIB_CFLAGS) $(EXTRA_CFLAGS)
    410408
    411409%.lo: %.s | depend
    412         $(CC_JOB) -c -MD -MP $(DEFS) $(LIB_CFLAGS) $(EXTRA_CFLAGS) $(AS_CFLAGS)
     410        $(CC_JOB) -c -MD -MP $(DEFS) $(LIB_CFLAGS) $(EXTRA_CFLAGS)
    413411
    414412%.lo: %.c | depend
  • uspace/lib/c/arch/ppc32/Makefile.common

    rd86393c8 r874ed210  
    3333endif
    3434
    35 COMMON_CFLAGS += -mcpu=powerpc -m$(FLOATS)-float -m32 -Wl,-z,max-page-size=0x1000
    36 AFLAGS += -a32
    37 LDFLAGS += -Wl,--gc-sections
     35COMMON_CFLAGS += -mcpu=powerpc -m$(FLOATS)-float -m32 -Wa,-a32
     36LDFLAGS += -Wl,--gc-sections -Wl,-z,max-page-size=0x1000
    3837
    3938ENDIANESS = BE
Note: See TracChangeset for help on using the changeset viewer.