STRIP_FLAGS ?= -x -R .note -R .comment
-## unused? if yes, remove after 0.9.31
-## UNIFDEF := $(top_builddir)extra/scripts/unifdef
-
# Select the compiler needed to build binaries for your development system
HOSTCC = gcc
BUILD_CFLAGS = -Os
# Now config hard core
-MAJOR_VERSION := 0
-MINOR_VERSION := 9
-SUBLEVEL := 34
+MAJOR_VERSION := 1
+MINOR_VERSION := 0
+SUBLEVEL := 0
EXTRAVERSION :=-git
VERSION := $(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL)
ABI_VERSION := $(MAJOR_VERSION)
endif
interp := $(top_builddir)lib/interp.os
ldso := $(top_builddir)lib/$(UCLIBC_LDSO)
-headers_dep := $(top_builddir)include/bits/sysnum.h
+headers_dep := $(top_builddir)include/bits/sysnum.h \
+ $(top_builddir)include/bits/uClibc_config.h
sub_headers := $(headers_dep)
#LIBS :=$(interp) -L$(top_builddir)lib -lc
check_as=$(shell \
if $(CC) -Wa,$(1) -Wa,-Z -c -o /dev/null -xassembler /dev/null > /dev/null 2>&1; \
then echo "-Wa,$(1)"; fi)
-# FIXME: filter -fuse-ld=% and pass that, too!!
check_ld=$(shell \
- if $(CC) -Wl,$(1) $(CFLAG_-nostdlib) -o /dev/null -Wl,-b,binary /dev/null > /dev/null 2>&1; \
+ if $(CC) $(LDFLAG-fuse-ld) $(CFLAG_-Wl--no-warn-mismatch) -Wl,$(1) $(CFLAG_-nostdlib) -o /dev/null -Wl,-b,binary /dev/null > /dev/null 2>&1; \
then echo "$(1)"; fi)
# Use variable indirection here so that we can have variable
# Note: The check for -nostdlib has to be before all calls to check_ld
$(eval $(call check-gcc-var,-nostdlib))
+$(eval $(call check-gcc-var,-nostartfiles))
+# deliberately not named CFLAG-fuse-ld since unchecked and from user
+LDFLAG-fuse-ld := $(filter -fuse-ld=%,$(call qstrip,$(UCLIBC_EXTRA_CFLAGS)))
+# failed to merge target specific data of file /dev/null
+# Could use -Wl,--script,$(top_srcdir)extra/scripts/none.lds as well.
+$(eval $(call check-ld-var,--no-warn-mismatch))
+
+$(eval $(call cache-output-var,GCC_VER,$(CC) -dumpversion))
+GCC_VER := $(subst ., ,$(GCC_VER))
+GCC_MAJOR_VER ?= $(word 1,$(GCC_VER))
+GCC_MINOR_VER ?= $(word 2,$(GCC_VER))
# Flags in OPTIMIZATION are used only for non-debug builds
OPTIMIZATION:=
+OPTIMIZATION-$(GCC_MAJOR_VER):=
+OPTIMIZATION-$(GCC_MAJOR_VER).$(GCC_MINOR_VER):=
+
# Use '-Os' optimization if available, else use -O2, allow Config to override
$(eval $(call check-gcc-var,-Os))
ifneq ($(CFLAG_-Os),)
endif
# Use the gcc 3.4 -funit-at-a-time optimization when available
$(eval $(call check-gcc-var,-funit-at-a-time))
-OPTIMIZATION += $(CFLAG_-funit-at-a-time)
-# shrinks code by about 0.1%
-$(eval $(call check-gcc-var,-fmerge-all-constants))
+OPTIMIZATION-3.4 += $(CFLAG_-funit-at-a-time)
$(eval $(call check-gcc-var,-fstrict-aliasing))
-OPTIMIZATION += $(CFLAG_-fmerge-all-constants) $(CFLAG_-fstrict-aliasing)
-
-$(eval $(call cache-output-var,GCC_VER,$(CC) -dumpversion))
-GCC_VER := $(subst ., ,$(GCC_VER))
-GCC_MAJOR_VER ?= $(word 1,$(GCC_VER))
-#GCC_MINOR_VER ?= $(word 2,$(GCC_VER))
-
-ifneq ($(TARGET_ARCH),arc)
-ifeq ($(GCC_MAJOR_VER),4)
-# shrinks code, results are from 4.0.2
-# 0.36%
-$(eval $(call check-gcc-var,-fno-tree-loop-optimize))
-OPTIMIZATION += $(CFLAG_-fno-tree-loop-optimize)
-# 0.34%
-$(eval $(call check-gcc-var,-fno-tree-dominator-opts))
-OPTIMIZATION += $(CFLAG_-fno-tree-dominator-opts)
-# 0.1%
-$(eval $(call check-gcc-var,-fno-strength-reduce))
-OPTIMIZATION += $(CFLAG_-fno-strength-reduce)
-endif
-endif
+OPTIMIZATION += $(CFLAG_-fstrict-aliasing)
# CPU_CFLAGS-y contain options which are not warnings,
# not include or library paths, and not optimizations.
$(eval $(call check-gcc-var,-fno-asm))
CPU_CFLAGS-y += $(CFLAG_-fno-asm)
+$(eval $(call check-gcc-var,-fmerge-all-constants))
+CPU_CFLAGS-y += $(CFLAG_-fmerge-all-constants)
LDADD_LIBFLOAT=
ifeq ($(UCLIBC_HAS_SOFT_FLOAT),y)
-# If -msoft-float isn't supported, we want an error anyway.
-# Hmm... might need to revisit this for arm since it has 2 different
-# soft float encodings.
-ifneq ($(TARGET_ARCH),nios)
+ifneq ($(TARGET_ARCH),bfin)
+ifneq ($(TARGET_ARCH),lm32)
ifneq ($(TARGET_ARCH),nios2)
ifneq ($(TARGET_ARCH),sh)
ifneq ($(TARGET_ARCH),c6x)
+ifneq ($(TARGET_ARCH),h8300)
CPU_CFLAGS-y += -msoft-float
endif
endif
endif
endif
-ifeq ($(TARGET_ARCH),arm)
-# No longer needed with current toolchains, but leave it here for now.
-# If anyone is actually still using gcc 2.95 (say), they can uncomment it.
-# LDADD_LIBFLOAT=-lfloat
+endif
endif
endif
PICFLAG := $(PICFLAG-y)
PIEFLAG_NAME:=-fPIE
+$(eval $(call check-gcc-var,-fdata-sections))
+$(eval $(call check-gcc-var,-ffunction-sections))
+
# Some nice CPU specific optimizations
ifeq ($(TARGET_ARCH),i386)
$(eval $(call check-gcc-var,-fomit-frame-pointer))
ifeq ($(TARGET_ARCH),mips)
OPTIMIZATION+=-mno-split-addresses
- CPU_CFLAGS-$(CONFIG_MIPS_ISA_1)+=-mips1
- CPU_CFLAGS-$(CONFIG_MIPS_ISA_2)+=-mips2 -mtune=mips2
- CPU_CFLAGS-$(CONFIG_MIPS_ISA_3)+=-mips3 -mtune=mips3
- CPU_CFLAGS-$(CONFIG_MIPS_ISA_4)+=-mips4 -mtune=mips4
- CPU_CFLAGS-$(CONFIG_MIPS_ISA_MIPS32)+=-mips32 -mtune=mips32
- CPU_CFLAGS-$(CONFIG_MIPS_ISA_MIPS32R2)+=-march=mips32r2 -mtune=mips32r2
- CPU_CFLAGS-$(CONFIG_MIPS_ISA_MIPS64)+=-mips64 -mtune=mips32
- CPU_CFLAGS-$(CONFIG_MIPS_ISA_MIPS64R2)+=-mips64r2 -mtune=mips64r2
- ifeq ($(strip $(ARCH_BIG_ENDIAN)),y)
- CPU_LDFLAGS-$(CONFIG_MIPS_N64_ABI)+=-Wl,-melf64btsmip
- CPU_LDFLAGS-$(CONFIG_MIPS_O32_ABI)+=-Wl,-melf32btsmip
- endif
- ifeq ($(strip $(ARCH_LITTLE_ENDIAN)),y)
- CPU_LDFLAGS-$(CONFIG_MIPS_N64_ABI)+=-Wl,-melf64ltsmip
- CPU_LDFLAGS-$(CONFIG_MIPS_O32_ABI)+=-Wl,-melf32ltsmip
- endif
CPU_CFLAGS-$(CONFIG_MIPS_N64_ABI)+=-mabi=64
CPU_CFLAGS-$(CONFIG_MIPS_O32_ABI)+=-mabi=32
CPU_CFLAGS-$(CONFIG_MIPS_N32_ABI)+=-mabi=n32
-endif
-
-ifeq ($(TARGET_ARCH),nios)
- OPTIMIZATION+=-funaligned-struct-hack
- CPU_LDFLAGS-y+=-Wl,-m32
- CPU_CFLAGS-y+=-Wl,-m32
+ CPU_LDFLAGS-y += $(CPU_CFLAGS)
endif
ifeq ($(TARGET_ARCH),sh)
ifeq ($(UCLIBC_HAS_FPU),y)
CPU_CFLAGS-$(CONFIG_SH2A)+=-m2a
CPU_CFLAGS-$(CONFIG_SH4)+=-m4
+ CPU_CFLAGS-$(CONFIG_SH4A)+=-m4a
else
CPU_CFLAGS-$(CONFIG_SH2A)+=-m2a-nofpu
CPU_CFLAGS-$(CONFIG_SH4)+=-m4-nofpu
+ CPU_CFLAGS-$(CONFIG_SH4A)+=-m4a-nofpu
endif
endif
-ifeq ($(TARGET_ARCH),sh64)
- CPU_CFLAGS-$(ARCH_LITTLE_ENDIAN):=-ml
- CPU_CFLAGS-$(ARCH_BIG_ENDIAN):=-mb
- CPU_CFLAGS-$(CONFIG_SH5)+=-m5-32media
-endif
-
ifeq ($(TARGET_ARCH),h8300)
- SYMBOL_PREFIX=_
- CPU_LDFLAGS-$(CONFIG_H8300H)+= -Wl,-ms8300h
- CPU_LDFLAGS-$(CONFIG_H8S) += -Wl,-ms8300s
CPU_CFLAGS-$(CONFIG_H8300H) += -mh -mint32
CPU_CFLAGS-$(CONFIG_H8S) += -ms -mint32
endif
OPTIMIZATION+=-mh -mint32 #-fsigned-char
endif
-ifeq ($(TARGET_ARCH),e1)
- OPTIMIZATION+=-mgnu-param
-endif
-
ifeq ($(TARGET_ARCH),cris)
CPU_LDFLAGS-$(CONFIG_CRIS)+=-Wl,-mcrislinux
CPU_LDFLAGS-$(CONFIG_CRISV32)+=-Wl,-mcrislinux
ifeq ($(TARGET_ARCH),arc)
CPU_CFLAGS-y += -mlock -mswape
CPU_CFLAGS-$(CONFIG_ARC_CPU_700) += -mA7
+ CPU_CFLAGS-$(CONFIG_ARC_CPU_HS) += -mcpu=archs
CPU_LDFLAGS-y += $(CPU_CFLAGS) -marclinux
endif
-Wshadow \
-Wundef
# Works only w/ gcc-3.4 and up, can't be checked for gcc-3.x w/ check_gcc()
-WARNING_FLAGS-gcc-4 += -Wdeclaration-after-statement
+#WARNING_FLAGS-gcc-4 += -Wdeclaration-after-statement
endif
WARNING_FLAGS += $(WARNING_FLAGS-gcc-$(GCC_MAJOR_VER))
$(foreach w,$(WARNING_FLAGS),$(eval $(call check-gcc-var,$(w))))
-I$(top_srcdir)libc/sysdeps/linux \
-I$(top_srcdir)ldso/ldso/$(TARGET_ARCH) \
-I$(top_srcdir)ldso/include -I.
-ifneq ($(strip $(UCLIBC_EXTRA_CFLAGS)),"")
-CFLAGS += $(call qstrip,$(UCLIBC_EXTRA_CFLAGS))
-endif
# We need this to be checked within libc-symbols.h
ifneq ($(HAVE_SHARED),y)
$(eval $(call check-ld-var,--warn-once))
$(eval $(call check-ld-var,--sort-common))
$(eval $(call check-ld-var,--discard-all))
-LDFLAGS_NOSTRIP:=$(CPU_LDFLAGS-y) -shared \
+LDFLAGS_NOSTRIP:=$(LDFLAG-fuse-ld) $(CPU_LDFLAGS-y) -shared \
-Wl,--warn-common $(CFLAG_-Wl--warn-once) -Wl,-z,combreloc
# binutils-2.16.1 warns about ignored sections, 2.16.91.0.3 and newer are ok
#$(eval $(call check-ld-var,--gc-sections))
#LDFLAGS_NOSTRIP += $(LDFLAG_--gc-sections)
-$(eval $(call check-gcc-var,-fdata-sections))
-$(eval $(call check-gcc-var,-ffunction-sections))
-
ifeq ($(UCLIBC_BUILD_RELRO),y)
LDFLAGS_NOSTRIP+=-Wl,-z,relro
endif
endif
endif
-LDFLAGS:=$(LDFLAGS_NOSTRIP) -Wl,-z,defs
ifeq ($(DODEBUG),y)
CFLAGS += -O0 -g3 -DDEBUG
else
CFLAGS += $(OPTIMIZATION)
+CFLAGS += $(OPTIMIZATION-$(GCC_MAJOR_VER))
+CFLAGS += $(OPTIMIZATION-$(GCC_MAJOR_VER).$(GCC_MINOR_VER))
+$(eval $(call check-ld-var,-O2))
+LDFLAGS_NOSTRIP += $(CFLAG_-Wl-O2)
endif
+
+LDFLAGS:=$(LDFLAGS_NOSTRIP) -Wl,-z,defs
+
ifeq ($(DOSTRIP),y)
LDFLAGS += -Wl,-s
else
STRIPTOOL := true -Stripping_disabled
endif
-ifneq ($(strip $(UCLIBC_EXTRA_CFLAGS)),"")
-CFLAGS += $(call qstrip,$(UCLIBC_EXTRA_CFLAGS))
-endif
ifeq ($(DOMULTI),y)
# we try to compile all sources at once into an object (IMA), but
DOMULTI:=n
endif
+ifneq ($(strip $(UCLIBC_EXTRA_CFLAGS)),"")
+CFLAGS += $(call qstrip,$(UCLIBC_EXTRA_CFLAGS))
+endif
ifneq ($(strip $(UCLIBC_EXTRA_LDFLAGS)),"")
LDFLAGS += $(call qstrip,$(UCLIBC_EXTRA_LDFLAGS))
endif
+ifeq ($(UCLIBC_HAS_STDIO_FUTEXES),y)
+CFLAGS += -D__USE_STDIO_FUTEXES__
+endif
+
ifeq ($(UCLIBC_HAS_THREADS),y)
ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
PTNAME := nptl
- CFLAGS += -DHAVE_FORCED_UNWIND
-else
-ifeq ($(LINUXTHREADS_OLD),y)
- PTNAME := linuxthreads.old
+ CFLAGS += -DHAVE_FORCED_UNWIND -D_LIBC_REENTRANT
else
+ifeq ($(UCLIBC_HAS_LINUXTHREADS),y)
PTNAME := linuxthreads
endif
endif
ifeq ($(UCLIBC_BUILD_NOEXECSTACK),y)
$(eval $(call check-as-var,--noexecstack))
endif
-ASFLAGS = $(ASFLAG_--noexecstack)
+ASFLAGS += $(ASFLAG_--noexecstack)
LIBGCC_CFLAGS ?= $(CFLAGS) $(CPU_CFLAGS-y)
$(eval $(call cache-output-var,LIBGCC,$(CC) $(LIBGCC_CFLAGS) -print-libgcc-file-name))
-$(eval $(call cache-output-var,LIBGCC_EH,$(CC) $(LIBGCC_CFLAGS) -print-file-name=libgcc_eh.a))
-# with -O0 we (e.g. lockf) might end up with references to
-# _Unwind_Resume, so pull in gcc_eh in this case..
LIBGCC_DIR:=$(dir $(LIBGCC))
-LIBGCC += $(if $(DODEBUG),$(LIBGCC_EH))
# moved from libpthread/linuxthreads
ifeq ($(UCLIBC_CTOR_DTOR),y)