Changeset a0a273e in mainline for uspace/lib


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:
uspace/lib/c
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/Makefile

    r0f28387 ra0a273e  
    194194%.h: %.ag
    195195        $(AUTOGEN) probe $< >$<.probe.c
    196         $(CC) $(DEFS) $(CFLAGS) -S -o $<.probe.s $<.probe.c
     196        $(CC_AUTOGEN) $(DEFS) $(CFLAGS) -S -o $<.probe.s $<.probe.c
    197197        $(AUTOGEN) generate $< <$<.probe.s >$@   
    198198
  • uspace/lib/c/arch/amd64/Makefile.common

    r0f28387 ra0a273e  
    2727#
    2828
    29 GCC_CFLAGS += -mno-tls-direct-seg-refs -fno-omit-frame-pointer
    30 CLANG_CFLAGS += -fno-omit-frame-pointer
     29COMMON_CFLAGS += -mno-tls-direct-seg-refs -fno-omit-frame-pointer
    3130LFLAGS += --gc-sections
    3231
  • uspace/lib/c/arch/arm32/Makefile.common

    r0f28387 ra0a273e  
    2828#
    2929
    30 GCC_CFLAGS += -ffixed-r9 -mtp=soft -fno-omit-frame-pointer -mapcs-frame \
     30COMMON_CFLAGS += -ffixed-r9 -mtp=soft -fno-omit-frame-pointer -mapcs-frame \
    3131        -march=$(subst _,-,$(PROCESSOR_ARCH))
    3232
     
    3434
    3535ifeq ($(CONFIG_FPU),y)
    36         GCC_CFLAGS += -mfloat-abi=hard
     36        COMMON_CFLAGS += -mfloat-abi=hard
    3737else
    3838        BASE_LIBS += $(LIBSOFTFLOAT_PREFIX)/libsoftfloat.a
  • uspace/lib/c/arch/ia32/Makefile.common

    r0f28387 ra0a273e  
    2828
    2929ifeq ($(PROCESSOR),i486)
    30         GCC_CFLAGS += -march=i486
     30        COMMON_CFLAGS += -march=i486
    3131else
    32         GCC_CFLAGS += -march=pentium
     32        COMMON_CFLAGS += -march=pentium
    3333endif
    3434
    35 GCC_CFLAGS += -mno-tls-direct-seg-refs -fno-omit-frame-pointer
    36 CLANG_CFLAGS += -fno-omit-frame-pointer
     35COMMON_CFLAGS += -mno-tls-direct-seg-refs -fno-omit-frame-pointer
    3736LFLAGS += --gc-sections
    3837
  • uspace/lib/c/arch/mips32/Makefile.common

    r0f28387 ra0a273e  
    2727#
    2828
    29 GCC_CFLAGS += -msoft-float -mabi=32
     29COMMON_CFLAGS += -msoft-float -mabi=32
    3030BASE_LIBS += $(LIBSOFTFLOAT_PREFIX)/libsoftfloat.a
    3131AS_PROLOG = .module softfloat;.abicalls;
     
    3838
    3939ifeq ($(MACHINE),msim)
    40         GCC_CFLAGS += -march=r4000
     40        COMMON_CFLAGS += -march=r4000
    4141endif
    4242
    4343ifeq ($(MACHINE),lmalta)
    44         GCC_CFLAGS += -march=4kc
     44        COMMON_CFLAGS += -march=4kc
    4545endif
    4646
  • uspace/lib/c/arch/mips32eb/Makefile.common

    r0f28387 ra0a273e  
    2727#
    2828
    29 GCC_CFLAGS += -msoft-float -mabi=32
     29COMMON_CFLAGS += -msoft-float -mabi=32
    3030BASE_LIBS += $(LIBSOFTFLOAT_PREFIX)/libsoftfloat.a
    3131AS_PROLOG = .module softfloat;.abicalls;
     
    3838
    3939ifeq ($(MACHINE),bmalta)
    40         GCC_CFLAGS += -march=4kc
     40        COMMON_CFLAGS += -march=4kc
    4141endif
    4242
  • uspace/lib/c/arch/ppc32/Makefile.common

    r0f28387 ra0a273e  
    3333endif
    3434
    35 GCC_CFLAGS += -mcpu=powerpc -m$(FLOATS)-float -m32
     35COMMON_CFLAGS += -mcpu=powerpc -m$(FLOATS)-float -m32
    3636BASE_LIBS += $(LIBSOFTFLOAT_PREFIX)/libsoftfloat.a
    3737AFLAGS += -a32
  • uspace/lib/c/arch/sparc64/Makefile.common

    r0f28387 ra0a273e  
    2828
    2929ifeq ($(PROCESSOR),sun4v)
    30 GCC_CFLAGS += -mcpu=niagara -mno-vis
     30COMMON_CFLAGS += -mcpu=niagara -mno-vis
    3131else
    32 GCC_CFLAGS += -mcpu=ultrasparc
     32COMMON_CFLAGS += -mcpu=ultrasparc
    3333endif
    3434
    35 GCC_CFLAGS += -m64 -mcmodel=medlow
     35COMMON_CFLAGS += -m64 -mcmodel=medlow
    3636
    3737LFLAGS += -no-check-sections --gc-sections
Note: See TracChangeset for help on using the changeset viewer.