Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset a0a273e in mainline


Ignore:
Timestamp:
2017-10-03T18:12:17Z (4 years ago)
Author:
jzr <zarevucky.jiri@…>
Branches:
lfn, master
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.

Files:
30 edited

Legend:

Unmodified
Added
Removed
  • HelenOS.config

    r0f28387 ra0a273e  
    300300@ "icc" Intel C Compiler
    301301@ "gcc_native" GNU C Compiler (native)
    302 ! [PLATFORM=amd64|PLATFORM=ia32] COMPILER (choice)
    303 
    304 % Compiler
    305 @ "gcc_cross" GNU C Compiler (cross-compiler)
    306 @ "gcc_helenos" GNU C Compiler (experimental HelenOS-specific cross-compiler)
    307 @ "icc" Intel C Compiler
    308 @ "gcc_native" GNU C Compiler (native)
    309 ! [PLATFORM=ia64] COMPILER (choice)
    310 
    311 % Compiler
    312 @ "gcc_cross" GNU C Compiler (cross-compiler)
    313 @ "gcc_helenos" GNU C Compiler (experimental HelenOS-specific cross-compiler)
    314 @ "gcc_native" GNU C Compiler (native)
    315 ! [PLATFORM=riscv64] COMPILER (choice)
     302! [PLATFORM=amd64|PLATFORM=ia32|PLATFORM=ia64] COMPILER (choice)
    316303
    317304% Compiler
     
    320307@ "gcc_helenos" GNU C Compiler (experimental HelenOS-specific cross-compiler)
    321308@ "gcc_native" GNU C Compiler (native)
    322 ! [PLATFORM=mips32|PLATFORM=ppc32|PLATFORM=abs32le|PLATFORM=arm32|PLATFORM=sparc64] COMPILER (choice)
    323 
     309! [PLATFORM=mips32|PLATFORM=ppc32|PLATFORM=abs32le|PLATFORM=arm32|PLATFORM=sparc64|PLATFORM=riscv64] COMPILER (choice)
     310
     311% Clang Integrated Assembler
     312@ "default" Use architecture default.
     313@ "yes" Use integrated assembler.
     314@ "no" Use GNU Assembler.
     315! [COMPILER=clang] INTEGRATED_AS (choice)
    324316
    325317## Cross-compiler target for abstract architecture
  • boot/Makefile.build

    r0f28387 ra0a273e  
    3636DEFS = -DBOOT -DRELEASE=$(RELEASE) "-DCOPYRIGHT=$(COPYRIGHT)" "-DNAME=$(NAME)" -D__$(BITS)_BITS__ -D__$(ENDIANESS)__
    3737
     38AFLAGS =
    3839LFLAGS = --fatal-warnings
    3940
    40 GCC_CFLAGS = $(INCLUDES) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
    41         -fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) \
    42         -finput-charset=UTF-8 -ffreestanding -fno-builtin -nostdlib -nostdinc \
    43         -Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes \
     41# FIXME: This condition is a workaround for issue #693.
     42ifneq ($(BARCH),mips32)
     43        AFLAGS += --fatal-warnings
     44endif
     45
     46COMMON_CFLAGS = $(INCLUDES) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
     47        -ffreestanding -fno-builtin -nostdlib -nostdinc \
     48        -fexec-charset=UTF-8 -finput-charset=UTF-8
     49
     50GCC_CFLAGS = -Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes \
    4451        -std=gnu99 -Werror-implicit-function-declaration -Wwrite-strings \
    4552        -pipe
    4653
    47 ICC_CFLAGS = $(INCLUDES) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
    48         -ffreestanding -fno-builtin -nostdlib -nostdinc -Wall -Wmissing-prototypes \
    49         -Werror-implicit-function-declaration -wd170
     54ICC_CFLAGS = -Wall -Wmissing-prototypes -Werror-implicit-function-declaration -wd170
    5055
    51 CLANG_CFLAGS = $(INCLUDES) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
    52         -fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) \
    53         -finput-charset=UTF-8 -ffreestanding -fno-builtin -nostdlib -nostdinc \
    54         -Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes \
     56CLANG_CFLAGS = -Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes \
    5557        -Werror-implicit-function-declaration -Wwrite-strings \
    56         -pipe
     58        -pipe  -fno-stack-protector -fno-PIC
    5759
    5860ifeq ($(CONFIG_DEBUG),y)
    59         GCC_CFLAGS += -Werror
    60         ICC_CFLAGS += -Werror
     61        COMMON_CFLAGS += -Werror
    6162endif
    6263
    6364ifeq ($(CONFIG_LINE_DEBUG),y)
    64         GCC_CFLAGS += -g
    65         ICC_CFLAGS += -g
    66         CLANG_CFLAGS += -g
     65        COMMON_CFLAGS += -g
    6766endif
    6867
    6968ifeq ($(COMPILER),gcc_native)
    70         CFLAGS = $(GCC_CFLAGS) $(EXTRA_CFLAGS)
     69        CFLAGS = $(COMMON_CFLAGS) $(GCC_CFLAGS) $(EXTRA_CFLAGS)
    7170        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    7271endif
    7372
    7473ifeq ($(COMPILER),gcc_cross)
    75         CFLAGS = $(GCC_CFLAGS) $(EXTRA_CFLAGS)
     74        CFLAGS = $(COMMON_CFLAGS) $(GCC_CFLAGS) $(EXTRA_CFLAGS)
    7675        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    7776endif
    7877
    7978ifeq ($(COMPILER),gcc_helenos)
    80         CFLAGS = $(GCC_CFLAGS) $(EXTRA_CFLAGS)
     79        CFLAGS = $(COMMON_CFLAGS) $(GCC_CFLAGS) $(EXTRA_CFLAGS)
    8180        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    8281endif
     
    8483
    8584ifeq ($(COMPILER),icc)
    86         CFLAGS = $(ICC_CFLAGS) $(EXTRA_CFLAGS)
     85        CFLAGS = $(COMMON_CFLAGS) $(ICC_CFLAGS) $(EXTRA_CFLAGS)
    8786        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    8887endif
    8988
    9089ifeq ($(COMPILER),clang)
    91         CFLAGS = $(CLANG_CFLAGS) $(EXTRA_CFLAGS)
     90        CFLAGS = $(COMMON_CFLAGS) $(CLANG_CFLAGS) $(EXTRA_CFLAGS)
    9291        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    9392endif
     
    105104endif
    106105
     106AS_CFLAGS := $(addprefix -Xassembler ,$(AFLAGS))
     107
    107108$(BOOT_OUTPUT): $(RAW)
    108109        $(OBJCOPY) -O $(BFD_OUTPUT) $< $@
     
    112113
    113114$(LINK): $(DEPEND)
    114         $(GCC) $(DEFS) $(GCC_CFLAGS) -D__ASM__ -D__LINKER__ -E -x c $(LINK).in | grep -v "^\#" > $(LINK)
     115        $(CC) $(DEFS) $(CFLAGS) -D__ASM__ -D__LINKER__ -E -x c $(LINK).in | grep -v "^\#" > $(LINK)
    115116
    116117%.o: %.S $(DEPEND)
    117         $(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@
     118        $(CC) $(DEFS) $(CFLAGS) $(AS_CFLAGS) -D__ASM__ -c $< -o $@
    118119ifeq ($(PRECHECK),y)
    119120        $(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $(CFLAGS) -D__ASM__
     
    127128
    128129%.o: %.s $(DEPEND)
    129         $(AS) $(AFLAGS) -o $@ $<
     130        $(CC) $(DEFS) $(CFLAGS) $(AS_CFLAGS) -D__ASM__ -c $< -o $@
    130131ifeq ($(PRECHECK),y)
    131132        $(JOBFILE) $(JOB) $< $@ as asm
  • defaults/amd64/Makefile.config

    r0f28387 ra0a273e  
    1010# Compiler
    1111COMPILER = gcc_cross
     12
     13# In case compiler is clang, whether or not to use its integrated assembler.
     14INTEGRATED_AS = default
    1215
    1316# Debug build
  • defaults/arm32/Makefile.config

    r0f28387 ra0a273e  
    77# Compiler
    88COMPILER = gcc_cross
     9
     10# In case compiler is clang, whether or not to use its integrated assembler.
     11INTEGRATED_AS = default
    912
    1013# Debug build
  • defaults/ia32/Makefile.config

    r0f28387 ra0a273e  
    1010# Compiler
    1111COMPILER = gcc_cross
     12
     13# In case compiler is clang, whether or not to use its integrated assembler.
     14INTEGRATED_AS = default
    1215
    1316# Debug build
  • defaults/ia64/Makefile.config

    r0f28387 ra0a273e  
    77# Compiler
    88COMPILER = gcc_cross
     9
     10# In case compiler is clang, whether or not to use its integrated assembler.
     11INTEGRATED_AS = default
    912
    1013# Debug build
  • defaults/mips32/Makefile.config

    r0f28387 ra0a273e  
    77# Compiler
    88COMPILER = gcc_cross
     9
     10# In case compiler is clang, whether or not to use its integrated assembler.
     11INTEGRATED_AS = default
    912
    1013# Debug build
  • defaults/ppc32/Makefile.config

    r0f28387 ra0a273e  
    77# Compiler
    88COMPILER = gcc_cross
     9
     10# In case compiler is clang, whether or not to use its integrated assembler.
     11INTEGRATED_AS = default
    912
    1013# Lazy FPU context switching
  • defaults/sparc64/Makefile.config

    r0f28387 ra0a273e  
    77# Compiler
    88COMPILER = gcc_cross
     9
     10# In case compiler is clang, whether or not to use its integrated assembler.
     11INTEGRATED_AS = default
    912
    1013# Support for SMP
  • defaults/special/Makefile.config

    r0f28387 ra0a273e  
    44# Compiler
    55COMPILER = gcc_cross
     6
     7# In case compiler is clang, whether or not to use its integrated assembler.
     8INTEGRATED_AS = default
    69
    710# Support for SMP
  • kernel/Makefile

    r0f28387 ra0a273e  
    8484DEFS = -DKERNEL -DRELEASE=$(RELEASE) "-DCOPYRIGHT=$(COPYRIGHT)" "-DNAME=$(NAME)" -D__$(BITS)_BITS__ -D__$(ENDIANESS)__
    8585
    86 GCC_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
    87         -fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) \
    88         -finput-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         -pipe
    92 
    93 ICC_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
    94         -ffreestanding -fno-builtin -nostdlib -nostdinc -Wall -Wmissing-prototypes \
     86COMMON_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
     87        -ffreestanding -fno-builtin -nostdlib -nostdinc \
     88        -fexec-charset=UTF-8 -finput-charset=UTF-8
     89
     90GCC_CFLAGS = -std=gnu99 -Wall -Wextra -Wno-unused-parameter \
     91        -Wmissing-prototypes -Werror-implicit-function-declaration \
     92        -Wwrite-strings -pipe
     93
     94ICC_CFLAGS = -Wall -Wmissing-prototypes \
    9595        -Werror-implicit-function-declaration -wd170
    9696
    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)
     97CLANG_CFLAGS = -std=gnu99 -Wall -Wextra -Wno-unused-parameter \
     98        -Wmissing-prototypes -Werror-implicit-function-declaration \
     99        -Wwrite-strings -pipe -fno-stack-protector -fno-PIC
    105100
    106101ifeq ($(CONFIG_DEBUG),y)
    107         GCC_CFLAGS += -Werror
    108         ICC_CFLAGS += -Werror
     102        COMMON_CFLAGS += -Werror
    109103endif
    110104
    111105ifeq ($(CONFIG_LTO),y)
    112         GCC_CFLAGS += -flto
     106        COMMON_CFLAGS += -flto
    113107endif
    114108
    115109ifeq ($(CONFIG_LINE_DEBUG),y)
    116         GCC_CFLAGS += -g
    117         ICC_CFLAGS += -g
    118         CLANG_CFLAGS += -g
     110        COMMON_CFLAGS += -g
    119111endif
    120112
     
    123115# AFLAGS and LFLAGS must be initialized before the inclusion.
    124116#
    125 AFLAGS = --fatal-warnings
     117AFLAGS =
    126118LFLAGS = -n -T $(LINK) -M --fatal-warnings
     119
     120# FIXME: This condition is a workaround for issues #693 and #694.
     121ifneq ($(KARCH),sparc64)
     122ifneq ($(KARCH),mips32)
     123        AFLAGS += --fatal-warnings
     124endif
     125endif
    127126
    128127#
     
    156155
    157156ifeq ($(COMPILER),gcc_native)
    158         CFLAGS = $(GCC_CFLAGS)
     157        CFLAGS = $(COMMON_CFLAGS) $(GCC_CFLAGS)
    159158        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    160159        INSTRUMENTATION = -finstrument-functions
     
    162161
    163162ifeq ($(COMPILER),gcc_cross)
    164         CFLAGS = $(GCC_CFLAGS)
     163        CFLAGS = $(COMMON_CFLAGS) $(GCC_CFLAGS)
    165164        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    166165        INSTRUMENTATION = -finstrument-functions
     
    168167
    169168ifeq ($(COMPILER),gcc_helenos)
    170         CFLAGS = $(GCC_CFLAGS)
     169        CFLAGS = $(COMMON_CFLAGS) $(GCC_CFLAGS)
    171170        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    172171        INSTRUMENTATION = -finstrument-functions
     
    174173
    175174ifeq ($(COMPILER),icc)
    176         CFLAGS = $(ICC_CFLAGS)
     175        CFLAGS = $(COMMON_CFLAGS) $(ICC_CFLAGS)
    177176        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    178177        INSTRUMENTATION =
     
    180179
    181180ifeq ($(COMPILER),clang)
    182         CFLAGS = $(CLANG_CFLAGS)
     181        CFLAGS = $(COMMON_CFLAGS) $(CLANG_CFLAGS)
    183182        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    184         INSTRUMENTATION =
     183        INSTRUMENTATION = -finstrument-functions
    185184endif
    186185
     
    384383AUTOGENS_AG := $(ARCH_AUTOGENS_AG) $(GENARCH_AUTOGENS_AG)
    385384
    386 LFLAGS_LTO := $(addprefix -Xlinker ,$(LFLAGS))
     385AS_CFLAGS := $(addprefix -Xassembler ,$(AFLAGS))
     386LD_CFLAGS := $(addprefix -Xlinker ,$(LFLAGS))
     387
     388ifeq ($(COMPILER),clang)
     389        AS_CFLAGS += -mllvm -asm-macro-max-nesting-depth=1000
     390endif
    387391
    388392ifeq ($(CONFIG_SYMTAB),y)
     
    404408$(RAW): $(LINK) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(SYMTAB_OBJECTS)
    405409ifeq ($(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)
    407411else
    408412        $(LD) $(LFLAGS) -Map $(MAP) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(SYMTAB_OBJECTS)
     
    417421%.h: %.ag
    418422        $(AUTOGEN) probe $< >$<.probe.c
    419         $(CC) $(DEFS) $(CFLAGS) -S -o $<.probe.s $<.probe.c
     423        $(CC_AUTOGEN) $(DEFS) $(CFLAGS) -S -o $<.probe.s $<.probe.c
    420424        $(AUTOGEN) generate $< <$<.probe.s >$@   
    421425
    422426%.o: %.S $(DEPEND)
    423         $(GCC) $(DEFS) $(GCC_CFLAGS) -D__ASM__ -c -o $@ $<
     427        $(CC) $(DEFS) $(CFLAGS) $(AS_CFLAGS) -D__ASM__ -c -o $@ $<
    424428ifeq ($(PRECHECK),y)
    425         $(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $(GCC_CFLAGS) -D__ASM__
     429        $(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $(CFLAGS) -D__ASM__
    426430endif
    427431
    428432%.o: %.s $(DEPEND)
    429         $(AS) $(AFLAGS) -o $@ $<
     433        $(CC) $(DEFS) $(CFLAGS) $(AS_CFLAGS) -D__ASM__ -c -o $@ $<
    430434ifeq ($(PRECHECK),y)
    431435        $(JOBFILE) $(JOB) $< $@ as asm $(DEFS) $(CFLAGS) $(EXTRA_FLAGS)
     
    439443
    440444$(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 $@ -
    442446
    443447$(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) -
    445449ifeq ($(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)
    447451else
    448452        $(LD) $(LFLAGS) -Map $(MAP_PREV) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(EMPTY_MAP)
     
    454458        # on architectures that have bss after symtab
    455459       
    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) -
    457461ifeq ($(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)
    459463else
    460464        $(LD) $(LFLAGS) -Map $(MAP_PREV) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(SIZEOK_MAP)
  • kernel/arch/abs32le/Makefile.inc

    r0f28387 ra0a273e  
    3535       
    3636        ifeq ($(CROSS_TARGET),mips32)
    37                 GCC_CFLAGS += -mno-abicalls
     37                COMMON_CFLAGS += -mno-abicalls
    3838        endif
    3939endif
  • kernel/arch/amd64/Makefile.inc

    r0f28387 ra0a273e  
    3232
    3333FPU_NO_CFLAGS = -mno-sse -mno-sse2
    34 CMN1 = -m64 -mcmodel=$(MEMORY_MODEL) -mno-red-zone -fno-unwind-tables -fno-omit-frame-pointer
    35 GCC_CFLAGS += $(CMN1)
    36 ICC_CFLAGS += $(CMN1)
    37 CLANG_CFLAGS += $(CMN1)
     34COMMON_CFLAGS += -m64 -mcmodel=$(MEMORY_MODEL) -mno-red-zone -fno-unwind-tables -fno-omit-frame-pointer
    3835
    3936BITS = 64
     
    4441
    4542ifeq ($(PROCESSOR),opteron)
    46         CMN2 := -march=opteron
    47         GCC_CFLAGS += $(CMN2)
    48         ICC_CFLAGS += $(CMN2)
     43        COMMON_CFLAGS += -march=opteron
    4944endif
    5045
  • kernel/arch/arm32/Makefile.inc

    r0f28387 ra0a273e  
    3333ATSIGN = %
    3434
    35 GCC_CFLAGS += -fno-omit-frame-pointer -mapcs-frame -march=$(subst _,-,$(PROCESSOR_ARCH)) -mno-unaligned-access -mfpu=vfpv3
     35COMMON_CFLAGS += -fno-omit-frame-pointer -mapcs-frame -march=$(subst _,-,$(PROCESSOR_ARCH)) -mno-unaligned-access -mfpu=vfpv3
    3636
    3737ifeq ($(CONFIG_FPU),y)
  • kernel/arch/ia32/Makefile.inc

    r0f28387 ra0a273e  
    3434ENDIANESS = LE
    3535
    36 CMN1 = -m32 -fno-omit-frame-pointer
    37 GCC_CFLAGS += $(CMN1)
    38 ICC_CFLAGS += $(CMN1)
    39 CLANG_CFLAGS += $(CMN1)
     36COMMON_CFLAGS += -m32 -fno-omit-frame-pointer
    4037
    4138## Accepted CPUs
     
    4340
    4441ifeq ($(PROCESSOR),i486)
    45         CMN2 = -march=i486
     42        COMMON_CFLAGS += -march=i486
    4643endif
    4744
    4845ifeq ($(PROCESSOR),athlon_xp)
    49         CMN2 = -march=athlon-xp
     46        COMMON_CFLAGS += -march=athlon-xp
    5047endif
    5148
    5249ifeq ($(PROCESSOR),athlon_mp)
    53         CMN2 = -march=athlon-mp
     50        COMMON_CFLAGS += -march=athlon-mp
    5451endif
    5552
    5653ifeq ($(PROCESSOR),pentium3)
    57         CMN2 = -march=pentium3
     54        COMMON_CFLAGS += -march=pentium3
    5855endif
    5956
    6057ifeq ($(PROCESSOR),pentium4)
    61         CMN2 = -march=pentium4
     58        COMMON_CFLAGS += -march=pentium4
    6259endif
    6360
    6461ifeq ($(PROCESSOR),core)
    65         CMN2 = -march=prescott
     62        COMMON_CFLAGS += -march=prescott
    6663endif
    6764
    6865FPU_NO_CFLAGS = -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow
    69 GCC_CFLAGS += $(CMN2)
    70 ICC_CFLAGS += $(CMN2)
    71 CLANG_CFLAGS += $(CMN2)
    7266
    7367ARCH_SOURCES = \
  • kernel/arch/ia64/Makefile.inc

    r0f28387 ra0a273e  
    3030BFD_ARCH = ia64-elf64
    3131
    32 CMN1 = -mconstant-gp -fno-unwind-tables -mfixed-range=f32-f127
    33 GCC_CFLAGS += $(CMN1)
    34 ICC_CFLAGS += $(CMN1)
     32COMMON_CFLAGS += -mconstant-gp -fno-unwind-tables -mfixed-range=f32-f127
    3533
    3634AFLAGS += -mconstant-gp
  • kernel/arch/mips32/Makefile.inc

    r0f28387 ra0a273e  
    2929BFD_ARCH = mips
    3030BFD = binary
    31 GCC_CFLAGS += -msoft-float -mno-abicalls -G 0 -fno-zero-initialized-in-bss -mabi=32
     31COMMON_CFLAGS += -msoft-float -mno-abicalls -G 0 -fno-zero-initialized-in-bss -mabi=32
    3232AS_PROLOG = .module softfloat;
    3333
     
    4040        BFD_NAME = elf32-tradlittlemips
    4141        ENDIANESS = LE
    42         GCC_CFLAGS += -march=r4000
     42        COMMON_CFLAGS += -march=r4000
    4343endif
    4444ifeq ($(MACHINE),bmalta)
    4545        BFD_NAME = elf32-tradbigmips
    4646        ENDIANESS = BE
    47         GCC_CFLAGS += -D__BE__ -march=4kc
     47        COMMON_CFLAGS += -D__BE__ -march=4kc
    4848endif
    4949ifeq ($(MACHINE),lmalta)
    5050        BFD_NAME = elf32-tradlittlemips
    5151        ENDIANESS = LE
    52         GCC_CFLAGS += -march=4kc
     52        COMMON_CFLAGS += -march=4kc
    5353endif
    5454
  • kernel/arch/ppc32/Makefile.inc

    r0f28387 ra0a273e  
    3131BFD = binary
    3232
    33 GCC_CFLAGS += -mcpu=powerpc -msoft-float -m32
     33COMMON_CFLAGS += -mcpu=powerpc -msoft-float -m32
    3434AFLAGS += -a32
    3535LFLAGS += -no-check-sections
  • kernel/arch/riscv64/Makefile.inc

    r0f28387 ra0a273e  
    3131BFD = binary
    3232
    33 GCC_CFLAGS += -mcmodel=medany
     33COMMON_CFLAGS += -mcmodel=medany
    3434
    3535BITS = 64
  • kernel/arch/sparc64/Makefile.inc

    r0f28387 ra0a273e  
    3131BFD = binary
    3232
    33 GCC_CFLAGS += -m64 -mcpu=ultrasparc -mcmodel=medlow -mno-fpu
     33COMMON_CFLAGS += -m64 -mcpu=ultrasparc -mcmodel=medlow -mno-fpu
    3434
    3535LFLAGS += -no-check-sections
  • tools/autotool.py

    r0f28387 ra0a273e  
    210210        target = None
    211211        gnu_target = None
    212         clang_target = None
    213212        helenos_target = None
    214213        cc_args = []
     
    220219                if (config['CROSS_TARGET'] == "arm32"):
    221220                        gnu_target = "arm-linux-gnueabi"
    222                         clang_target = "arm-unknown-none"
    223221                        helenos_target = "arm-helenos-gnueabi"
    224222               
    225223                if (config['CROSS_TARGET'] == "ia32"):
    226224                        gnu_target = "i686-pc-linux-gnu"
    227                         clang_target = "i686-unknown-none"
    228225                        helenos_target = "i686-pc-helenos"
    229226               
     
    231228                        cc_args.append("-mabi=32")
    232229                        gnu_target = "mipsel-linux-gnu"
    233                         clang_target = "mipsel-unknown-none"
    234230                        helenos_target = "mipsel-helenos"
    235231       
     
    237233                target = config['PLATFORM']
    238234                gnu_target = "amd64-linux-gnu"
    239                 clang_target = "x86_64-unknown-none"
    240235                helenos_target = "amd64-helenos"
    241236       
     
    243238                target = config['PLATFORM']
    244239                gnu_target = "arm-linux-gnueabi"
    245                 clang_target = "arm-unknown-none-eabi"
    246240                helenos_target = "arm-helenos-gnueabi"
    247241       
     
    249243                target = config['PLATFORM']
    250244                gnu_target = "i686-pc-linux-gnu"
    251                 clang_target = "i686-unknown-none"
    252245                helenos_target = "i686-pc-helenos"
    253246       
     
    264257                        target = config['PLATFORM']
    265258                        gnu_target = "mipsel-linux-gnu"
    266                         clang_target = "mipsel-unknown-none"
    267259                        helenos_target = "mipsel-helenos"
    268260               
     
    270262                        target = "mips32eb"
    271263                        gnu_target = "mips-linux-gnu"
    272                         clang_target = "mips-unknown-none"
    273264                        helenos_target = "mips-helenos"
    274265       
     
    280271                        target = config['PLATFORM']
    281272                        gnu_target = "mips64el-linux-gnu"
    282                         clang_target = "mips64el-unknown-none"
    283273                        helenos_target = "mips64el-helenos"
    284274       
     
    286276                target = config['PLATFORM']
    287277                gnu_target = "ppc-linux-gnu"
    288                 clang_target = "ppc-unknown-none"
    289278                helenos_target = "ppc-helenos"
    290279       
     
    292281                target = config['PLATFORM']
    293282                gnu_target = "riscv64-unknown-linux-gnu"
    294                 clang_target = "riscv-unknown-none"
    295283                helenos_target = "riscv64-helenos"
    296284       
     
    298286                target = config['PLATFORM']
    299287                gnu_target = "sparc64-linux-gnu"
    300                 clang_target = "sparc-unknown-none"
    301288                helenos_target = "sparc64-helenos"
    302289       
    303         return (target, cc_args, gnu_target, clang_target, helenos_target)
     290        return (target, cc_args, gnu_target, helenos_target)
    304291
    305292def check_app(args, name, details):
     
    351338        return found
    352339
     340def check_clang(path, prefix, common, details):
     341        "Check for clang"
     342       
     343        common['CLANG'] = "%sclang" % prefix
     344       
     345        if (not path is None):
     346                common['CLANG'] = "%s/%s" % (path, common['CLANG'])
     347       
     348        check_app([common['CLANG'], "--version"], "clang", details)
     349
    353350def check_gcc(path, prefix, common, details):
    354351        "Check for GCC"
     
    427424        outf.close()
    428425       
    429         args = [common['CC']]
    430         args.extend(common['CC_ARGS'])
     426        args = common['CC_AUTOGEN'].split(' ')
    431427        args.extend(["-S", "-o", PROBE_OUTPUT, PROBE_SOURCE])
    432428       
     
    547543        outf.close()
    548544       
    549         args = [common['CC']]
    550         args.extend(common['CC_ARGS'])
     545        args = common['CC_AUTOGEN'].split(' ')
    551546        args.extend(["-S", "-o", PROBE_INT128_OUTPUT, PROBE_INT128_SOURCE])
    552547       
     
    852847               
    853848                # Compiler
    854                 common['CC_ARGS'] = []
    855849                if (config['COMPILER'] == "gcc_cross"):
    856                         target, cc_args, gnu_target, clang_target, helenos_target = get_target(config)
     850                        target, cc_args, gnu_target, helenos_target = get_target(config)
    857851                       
    858852                        if (target is None) or (gnu_target is None):
     
    867861                       
    868862                        check_common(common, "GCC")
    869                         common['CC'] = common['GCC']
    870                         common['CC_ARGS'].extend(cc_args)
     863                        common['CC'] = " ".join([common['GCC']] + cc_args)
     864                        common['CC_AUTOGEN'] = common['CC']
    871865               
    872866                if (config['COMPILER'] == "gcc_helenos"):
    873                         target, cc_args, gnu_target, clang_target, helenos_target = get_target(config)
     867                        target, cc_args, gnu_target, helenos_target = get_target(config)
    874868                       
    875869                        if (target is None) or (helenos_target is None):
     
    884878                       
    885879                        check_common(common, "GCC")
    886                         common['CC'] = common['GCC']
    887                         common['CC_ARGS'].extend(cc_args)
     880                        common['CC'] = " ".join([common['GCC']] + cc_args)
     881                        common['CC_AUTOGEN'] = common['CC']
    888882               
    889883                if (config['COMPILER'] == "gcc_native"):
     
    893887                        check_common(common, "GCC")
    894888                        common['CC'] = common['GCC']
     889                        common['CC_AUTOGEN'] = common['CC']
    895890               
    896891                if (config['COMPILER'] == "icc"):
     
    900895                       
    901896                        common['CC'] = "icc"
     897                        common['CC_AUTOGEN'] = common['CC']
    902898               
    903899                if (config['COMPILER'] == "clang"):
    904                         target, cc_args, gnu_target, clang_target, helenos_target = get_target(config)
    905                        
    906                         if (target is None) or (gnu_target is None) or (clang_target is None):
    907                                 print_error(["Unsupported compiler target for clang.",
     900                        target, cc_args, gnu_target, helenos_target = get_target(config)
     901                       
     902                        if (target is None) or (gnu_target is None):
     903                                print_error(["Unsupported compiler target.",
    908904                                             "Please contact the developers of HelenOS."])
    909905                       
     
    911907                        prefix = "%s-" % gnu_target
    912908                       
    913                         check_app(["clang", "--version"], "clang compiler", "preferably version 1.0 or newer")
     909                        check_clang(path, prefix, common, "")
    914910                        check_gcc(path, prefix, common, PACKAGE_GCC)
    915911                        check_binutils(path, prefix, common, PACKAGE_BINUTILS)
    916912                       
    917913                        check_common(common, "GCC")
    918                         common['CC'] = "clang"
    919                         common['CC_ARGS'].extend(cc_args)
    920                         common['CC_ARGS'].append("-target")
    921                         common['CC_ARGS'].append(clang_target)
    922                         common['CLANG_TARGET'] = clang_target
     914                        check_common(common, "CLANG")
     915                        common['CC'] = " ".join([common['CLANG']] + cc_args)
     916                        common['CC_AUTOGEN'] = common['CC'] + " -no-integrated-as"
     917                       
     918                        if (config['INTEGRATED_AS'] == "yes"):
     919                                common['CC'] += " -integrated-as"
     920                       
     921                        if (config['INTEGRATED_AS'] == "no"):
     922                                common['CC'] += " -no-integrated-as"
    923923               
    924924                check_python()
  • uspace/Makefile.common

    r0f28387 ra0a273e  
    160160LIBNETTL_PREFIX = $(LIB_PREFIX)/nettl
    161161
    162 AFLAGS = --fatal-warnings
     162AFLAGS =
    163163LFLAGS = --fatal-warnings
     164
     165# FIXME: This condition is a workaround for issues #692 and #693.
     166ifneq ($(KARCH),ia64)
     167ifneq ($(KARCH),mips32)
     168        AFLAGS += --fatal-warnings
     169endif
     170endif
    164171
    165172ifeq ($(STATIC_NEEDED),y)
     
    228235        find . -name '*.lo' -follow -exec rm \{\} \;
    229236
    230 GCC_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
    231         -fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) \
    232         -finput-charset=UTF-8 -ffreestanding -fno-builtin -ffunction-sections \
    233         -nostdlib -nostdinc -Wall -Wextra -Wno-clobbered -Wno-unused-parameter \
    234         -Wmissing-prototypes -std=gnu99 -Werror-implicit-function-declaration \
    235         -Wwrite-strings -pipe -ggdb -D__$(ENDIANESS)__
    236 
    237 ICC_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
    238         -fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) \
    239         -finput-charset=UTF-8 -ffreestanding -fno-builtin -nostdlib -nostdinc \
    240         -Wall -Wextra -Wno-clobbered -Wno-unused-parameter -Wmissing-prototypes \
    241         -Werror-implicit-function-declaration -Wwrite-strings \
    242         -pipe -g -D__$(ENDIANESS)__
    243 
    244 # clang does not support following options but I am not sure whether
    245 # something won't break because of that:
    246 # -fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) -finput-charset=UTF-8
    247 CLANG_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
    248         -ffreestanding -fno-builtin -nostdlib -nostdinc \
    249         -Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes \
     237COMMON_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
     238        -ffreestanding -fno-builtin -nostdlib -nostdinc -fexec-charset=UTF-8 \
     239        -finput-charset=UTF-8 -D__$(ENDIANESS)__
     240
     241GCC_CFLAGS = -ffunction-sections -Wall -Wextra -Wno-clobbered \
     242        -Wno-unused-parameter -Wmissing-prototypes -std=gnu99 \
     243        -Werror-implicit-function-declaration \
     244        -Wwrite-strings -pipe
     245
     246ICC_CFLAGS = -Wall -Wextra -Wno-clobbered -Wno-unused-parameter \
     247        -Wmissing-prototypes -Werror-implicit-function-declaration \
     248        -Wwrite-strings -pipe
     249
     250CLANG_CFLAGS = -Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes \
    250251        -std=gnu99 -Werror-implicit-function-declaration -Wwrite-strings \
    251         -integrated-as -pipe -g -target $(CLANG_TARGET) -D__$(ENDIANESS)__
    252 
    253 LIB_CFLAGS = $(CFLAGS) -fPIC
    254 LIB_LFLAGS = $(LFLAGS) -shared -soname $(LSONAME) --whole-archive
     252        -pipe -fno-stack-protector -fno-PIC
    255253
    256254ifeq ($(CONFIG_DEBUG),y)
    257         GCC_CFLAGS += -Werror
    258         ICC_CFLAGS += -Werror
     255        COMMON_CFLAGS += -Werror
    259256endif
    260257
     
    267264# Prepare for POSIX before including platform specific stuff
    268265ifeq ($(POSIX_COMPAT),y)
    269         CFLAGS = -I$(LIBPOSIX_PREFIX)/include/posix -I$(LIBPOSIX_PREFIX)/include/
     266        CFLAGS += -I$(LIBPOSIX_PREFIX)/include/posix -I$(LIBPOSIX_PREFIX)/include/
    270267        BASE_LIBS = $(LIBPOSIX_PREFIX)/libposixaslibc.a $(LIBPOSIX_PREFIX)/libc4posix.a $(LIBSOFTINT_PREFIX)/libsoftint.a
    271268endif
     
    282279
    283280ifeq ($(COMPILER),gcc_cross)
    284         CFLAGS += $(GCC_CFLAGS)
     281        CFLAGS += $(COMMON_CFLAGS) $(GCC_CFLAGS)
    285282        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    286283endif
    287284
    288285ifeq ($(COMPILER),gcc_helenos)
    289         CFLAGS += $(GCC_CFLAGS)
     286        CFLAGS += $(COMMON_CFLAGS) $(GCC_CFLAGS)
    290287        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    291288endif
    292289
    293290ifeq ($(COMPILER),gcc_native)
    294         CFLAGS += $(GCC_CFLAGS)
     291        CFLAGS += $(COMMON_CFLAGS) $(GCC_CFLAGS)
    295292        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    296293endif
    297294
    298295ifeq ($(COMPILER),icc)
    299         CFLAGS += $(ICC_CFLAGS)
     296        CFLAGS += $(COMMON_CFLAGS) $(ICC_CFLAGS)
    300297        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    301298endif
    302299
    303300ifeq ($(COMPILER),clang)
    304         CFLAGS += $(CLANG_CFLAGS)
     301        CFLAGS += $(COMMON_CFLAGS) $(CLANG_CFLAGS)
    305302        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    306303endif
     304
     305LIB_CFLAGS = $(CFLAGS) -fPIC
     306LIB_LFLAGS = $(LFLAGS) -shared -soname $(LSONAME) --whole-archive
    307307
    308308ifneq ($(MAKECMDGOALS),clean)
    309309-include $(DEPEND)
    310310endif
     311
     312AS_CFLAGS := $(addprefix -Xassembler ,$(AFLAGS))
     313LD_CFLAGS := $(addprefix -Xlinker ,$(LFLAGS))
    311314
    312315OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
     
    372375
    373376%.o: %.S $(DEPEND)
    374         $(GCC) $(DEFS) $(GCC_CFLAGS) $(EXTRA_CFLAGS) -D__ASM__ -c $< -o $@
     377        $(CC) $(DEFS) $(CFLAGS) $(EXTRA_CFLAGS) $(AS_CFLAGS) -D__ASM__ -c $< -o $@
    375378ifeq ($(PRECHECK),y)
    376379        $(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $(CFLAGS) $(EXTRA_CFLAGS) -D__ASM__
     
    378381
    379382%.o: %.s $(DEPEND)
    380         $(AS) $(AFLAGS) -o $@ $<
     383        $(CC) $(DEFS) $(CFLAGS) $(EXTRA_CFLAGS) $(AS_CFLAGS) -D__ASM__ -c $< -o $@
    381384ifeq ($(PRECHECK),y)
    382385        $(JOBFILE) $(JOB) $< $@ as asm
     
    396399
    397400%.lo: %.S $(DEPEND)
    398         $(CC) $(DEFS) $(LIB_CFLAGS) $(EXTRA_CFLAGS) -D__ASM__ -c $< -o $@
     401        $(CC) $(DEFS) $(LIB_CFLAGS) $(EXTRA_CFLAGS) $(AS_CFLAGS) -D__ASM__ -c $< -o $@
    399402ifeq ($(PRECHECK),y)
    400403        $(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $(LIB_CFLAGS) $(EXTRA_CFLAGS) -D__ASM__
     
    402405
    403406%.lo: %.s $(DEPEND)
    404         $(AS) $(AFLAGS) -o $@ $<
     407        $(CC) $(DEFS) $(LIB_CFLAGS) $(EXTRA_CFLAGS) $(AS_CFLAGS) -D__ASM__ -c $< -o $@
    405408ifeq ($(PRECHECK),y)
    406409        $(JOBFILE) $(JOB) $< $@ as asm
  • 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.