Changeset 009c485 in mainline for kernel/Makefile


Ignore:
Timestamp:
2018-05-01T19:02:23Z (7 years ago)
Author:
Jiří Zárevúcky <jiri.zarevucky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
742fc98e
Parents:
5261062
Message:

Always use CC for linking.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/Makefile

    r5261062 r009c485  
    116116endif
    117117
    118 #
    119 # Mind the mutual ordering with the inclusion of the arch Makefile.inc.
    120 # AFLAGS and LFLAGS must be initialized before the inclusion.
    121 #
    122 AFLAGS = --fatal-warnings
    123 LFLAGS = -n -T $(LINK) -M --fatal-warnings --warn-common
     118AFLAGS += --fatal-warnings
     119LDFLAGS += -Wl,-n -T $(LINK) -Wl,-M,--fatal-warnings,--warn-common
    124120
    125121ifeq ($(CONFIG_STRIP_BINARIES),y)
    126         LFLAGS += --strip-all
    127 endif
    128 
    129 #
    130 # Mind the mutual ordering with the initialization of AFLAGS and LFLAGS.
    131 # The arch Makefile.inc must be included after the initialization.
    132 #
     122        LDFLAGS += -s
     123endif
     124
    133125-include arch/$(KARCH)/Makefile.inc
    134126-include genarch/Makefile.inc
     
    358350
    359351AS_CFLAGS := $(addprefix -Xassembler ,$(AFLAGS))
    360 LD_CFLAGS := $(addprefix -Xlinker ,$(LFLAGS))
    361352
    362353-include $(GENERIC_DEPENDS)
     
    385376
    386377$(RAW): $(LINK) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(SYMTAB_OBJECTS)
    387 ifeq ($(CONFIG_LTO),y)
    388         $(CC) $(DEFS) $(CFLAGS) $(LD_CFLAGS) -Xlinker -Map -Xlinker $(MAP) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(SYMTAB_OBJECTS)
    389 else
    390         $(LD) $(LFLAGS) -Map $(MAP) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(SYMTAB_OBJECTS)
    391 endif
     378        $(CC) $(DEFS) $(CFLAGS) $(LDFLAGS) -Wl,-Map,$(MAP) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(SYMTAB_OBJECTS)
    392379
    393380$(LINK): $(LINK).in
     
    411398$(REAL_MAP).bin: $(LINK) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS)
    412399        echo "$(AS_PROLOG)""$(SYMTAB_SECTION)" | $(CC) $(CFLAGS) $(AS_CFLAGS) -x assembler -c -o $(EMPTY_MAP) -
    413 ifeq ($(CONFIG_LTO),y)
    414         $(CC) $(DEFS) $(CFLAGS) $(LD_CFLAGS) -Xlinker -Map -Xlinker $(MAP_PREV) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(EMPTY_MAP)
    415 else
    416         $(LD) $(LFLAGS) -Map $(MAP_PREV) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(EMPTY_MAP)
    417 endif
     400        $(CC) $(DEFS) $(CFLAGS) $(LDFLAGS) -Wl,-Map,$(MAP_PREV) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(EMPTY_MAP)
    418401        $(OBJDUMP) -t $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) > $(DUMP)
    419402        $(GENMAP) $(MAP_PREV) $(DUMP) $@
     
    423406
    424407        echo "$(AS_PROLOG)""$(SYMTAB_SECTION)"" .incbin \"$@\"" | $(CC) $(CFLAGS) $(AS_CFLAGS) -x assembler -c -o $(SIZEOK_MAP) -
    425 ifeq ($(CONFIG_LTO),y)
    426         $(CC) $(DEFS) $(CFLAGS) $(LD_CFLAGS) -Xlinker -Map -Xlinker $(MAP_PREV) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(SIZEOK_MAP)
    427 else
    428         $(LD) $(LFLAGS) -Map $(MAP_PREV) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(SIZEOK_MAP)
    429 endif
     408        $(CC) $(DEFS) $(CFLAGS) $(LDFLAGS) -Wl,-Map,$(MAP_PREV) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(SIZEOK_MAP)
    430409        $(OBJDUMP) -t $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) > $(DUMP)
    431410        $(GENMAP) $(MAP_PREV) $(DUMP) $@
Note: See TracChangeset for help on using the changeset viewer.