Changes in uspace/Makefile.common [94c5bc1:a41cda7] in mainline


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/Makefile.common

    r94c5bc1 ra41cda7  
    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)
     
    203210endif
    204211
    205 ifeq ($(CONFIG_OPTIMIZE_FOR_SIZE),y)
    206         OPTIMIZATION = s
    207 else
    208         OPTIMIZATION = 3
    209 endif
    210 
    211212# PCUT-based unit tests
    212213ifneq ($(TEST_SOURCES),)
     
    234235        find . -name '*.lo' -follow -exec rm \{\} \;
    235236
    236 GCC_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
    237         -fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) \
    238         -finput-charset=UTF-8 -ffreestanding -fno-builtin -ffunction-sections \
    239         -nostdlib -nostdinc -Wall -Wextra -Wno-clobbered -Wno-unused-parameter \
    240         -Wmissing-prototypes -std=gnu99 -Werror-implicit-function-declaration \
    241         -Wwrite-strings -pipe -ggdb -D__$(ENDIANESS)__
    242 
    243 ICC_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
    244         -fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) \
    245         -finput-charset=UTF-8 -ffreestanding -fno-builtin -nostdlib -nostdinc \
    246         -Wall -Wextra -Wno-clobbered -Wno-unused-parameter -Wmissing-prototypes \
    247         -Werror-implicit-function-declaration -Wwrite-strings \
    248         -pipe -g -D__$(ENDIANESS)__
    249 
    250 # clang does not support following options but I am not sure whether
    251 # something won't break because of that:
    252 # -fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) -finput-charset=UTF-8
    253 CLANG_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
    254         -ffreestanding -fno-builtin -nostdlib -nostdinc \
    255         -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
     250# -Wno-missing-prototypes is there because it warns about main().
     251# This should be fixed elsewhere.
     252CLANG_CFLAGS = -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-typedef-redefinition \
     253        -Wno-missing-prototypes -Wno-unused-command-line-argument \
    256254        -std=gnu99 -Werror-implicit-function-declaration -Wwrite-strings \
    257         -integrated-as -pipe -g -target $(CLANG_TARGET) -D__$(ENDIANESS)__
    258 
    259 LIB_CFLAGS = $(CFLAGS) -fPIC
    260 LIB_LFLAGS = $(LFLAGS) -shared -soname $(LSONAME) --whole-archive
     255        -pipe -fno-stack-protector -fno-PIC
    261256
    262257ifeq ($(CONFIG_DEBUG),y)
    263         GCC_CFLAGS += -Werror
    264         ICC_CFLAGS += -Werror
     258        COMMON_CFLAGS += -Werror
    265259endif
    266260
     
    273267# Prepare for POSIX before including platform specific stuff
    274268ifeq ($(POSIX_COMPAT),y)
    275         CFLAGS = -I$(LIBPOSIX_PREFIX)/include/posix -I$(LIBPOSIX_PREFIX)/include/
     269        CFLAGS += -I$(LIBPOSIX_PREFIX)/include/posix -I$(LIBPOSIX_PREFIX)/include/
    276270        BASE_LIBS = $(LIBPOSIX_PREFIX)/libposixaslibc.a $(LIBPOSIX_PREFIX)/libc4posix.a $(LIBSOFTINT_PREFIX)/libsoftint.a
    277271endif
     
    288282
    289283ifeq ($(COMPILER),gcc_cross)
    290         CFLAGS += $(GCC_CFLAGS)
     284        CFLAGS += $(COMMON_CFLAGS) $(GCC_CFLAGS)
    291285        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    292286endif
    293287
    294288ifeq ($(COMPILER),gcc_helenos)
    295         CFLAGS += $(GCC_CFLAGS)
     289        CFLAGS += $(COMMON_CFLAGS) $(GCC_CFLAGS)
    296290        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    297291endif
    298292
    299293ifeq ($(COMPILER),gcc_native)
    300         CFLAGS += $(GCC_CFLAGS)
     294        CFLAGS += $(COMMON_CFLAGS) $(GCC_CFLAGS)
    301295        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    302296endif
    303297
    304298ifeq ($(COMPILER),icc)
    305         CFLAGS += $(ICC_CFLAGS)
     299        CFLAGS += $(COMMON_CFLAGS) $(ICC_CFLAGS)
    306300        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    307301endif
    308302
    309303ifeq ($(COMPILER),clang)
    310         CFLAGS += $(CLANG_CFLAGS)
     304        CFLAGS += $(COMMON_CFLAGS) $(CLANG_CFLAGS)
    311305        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    312306endif
     307
     308LIB_CFLAGS = $(CFLAGS) -fPIC
     309LIB_LFLAGS = $(LFLAGS) -shared -soname $(LSONAME) --whole-archive
    313310
    314311ifneq ($(MAKECMDGOALS),clean)
    315312-include $(DEPEND)
    316313endif
     314
     315AS_CFLAGS := $(addprefix -Xassembler ,$(AFLAGS))
     316LD_CFLAGS := $(addprefix -Xlinker ,$(LFLAGS))
    317317
    318318OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
     
    378378
    379379%.o: %.S $(DEPEND)
    380         $(GCC) $(DEFS) $(GCC_CFLAGS) $(EXTRA_CFLAGS) -D__ASM__ -c $< -o $@
     380        $(CC) $(DEFS) $(CFLAGS) $(EXTRA_CFLAGS) $(AS_CFLAGS) -D__ASM__ -c $< -o $@
    381381ifeq ($(PRECHECK),y)
    382382        $(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $(CFLAGS) $(EXTRA_CFLAGS) -D__ASM__
     
    384384
    385385%.o: %.s $(DEPEND)
    386         $(AS) $(AFLAGS) -o $@ $<
     386        $(CC) $(DEFS) $(CFLAGS) $(EXTRA_CFLAGS) $(AS_CFLAGS) -D__ASM__ -c $< -o $@
    387387ifeq ($(PRECHECK),y)
    388388        $(JOBFILE) $(JOB) $< $@ as asm
     
    402402
    403403%.lo: %.S $(DEPEND)
    404         $(CC) $(DEFS) $(LIB_CFLAGS) $(EXTRA_CFLAGS) -D__ASM__ -c $< -o $@
     404        $(CC) $(DEFS) $(LIB_CFLAGS) $(EXTRA_CFLAGS) $(AS_CFLAGS) -D__ASM__ -c $< -o $@
    405405ifeq ($(PRECHECK),y)
    406406        $(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $(LIB_CFLAGS) $(EXTRA_CFLAGS) -D__ASM__
     
    408408
    409409%.lo: %.s $(DEPEND)
    410         $(AS) $(AFLAGS) -o $@ $<
     410        $(CC) $(DEFS) $(LIB_CFLAGS) $(EXTRA_CFLAGS) $(AS_CFLAGS) -D__ASM__ -c $< -o $@
    411411ifeq ($(PRECHECK),y)
    412412        $(JOBFILE) $(JOB) $< $@ as asm
Note: See TracChangeset for help on using the changeset viewer.