Radix cross Linux Toolchains for ARC architecture

ARC Toolchains for boot loaders components of some SoCs (such as Amlogic System on Chip)

20 Commits   0 Branches   8 Tags
Index: 2020.03.18/Makefile
===================================================================
--- 2020.03.18/Makefile	(nonexistent)
+++ 2020.03.18/Makefile	(revision 5)
@@ -0,0 +1,147 @@
+
+NO_PARALLEL = true
+
+COMPONENT_TARGETS  = $(TOOLCHAIN_S8XX_NEWLIB)
+
+FLAVOURS = headers full
+
+
+include ../../../build-system/config.mk
+
+
+SOURCE_REQUIRES = sources/newlib
+
+ifeq ($(FLAVOUR),headers)
+REQUIRES  = core/binutils/2020.03.18
+endif
+ifeq ($(FLAVOUR),full)
+REQUIRES  = core/gcc/2020.03.16^static
+endif
+
+# ======= __END_OF_REQUIRES__ =======
+
+tar_xz_archive  = $(SRC_PACKAGE_PATH)/newlib/newlib-arc-2020.03.18.tar.xz
+SRC_ARCHIVE     = $(tar_xz_archive)
+SRC_DIR         = $(TARGET_BUILD_DIR)/newlib-arc-2020.03.18
+src_dir_name    = newlib-arc-2020.03.18
+src_done        = $(TARGET_BUILD_DIR)/.source-done
+
+PATCHES       = PATCHES
+
+build_dir       = $(TARGET_BUILD_DIR)/build
+
+install_dir         = $(TOOLCHAIN_PATH)
+headers_install_dir = $(TOOLCHAIN_PATH)/$(TARGET)
+
+headers_target  = $(TARGET_BUILD_DIR)/.headers-installed
+
+build_target    = $(TARGET_BUILD_DIR)/.built
+full_target     = $(TARGET_BUILD_DIR)/.installed
+
+
+
+ifeq ($(FLAVOUR),headers)
+BUILD_TARGETS  = $(headers_target)
+endif
+
+ifeq ($(FLAVOUR),full)
+BUILD_TARGETS  = $(build_target)
+BUILD_TARGETS += $(full_target)
+endif
+
+include ../../../build-system/core.mk
+
+
+environment  = AS="$(TOOLCHAIN_PATH)/bin/$(TARGET)-as"
+environment += LD="$(TOOLCHAIN_PATH)/bin/$(TARGET)-ld"
+environment += CC="$(CCACHE)$(TOOLCHAIN_PATH)/bin/$(TARGET)-gcc"
+environment += AR="$(TOOLCHAIN_PATH)/bin/$(TARGET)-ar"
+environment += RANLIB="$(TOOLCHAIN_PATH)/bin/$(TARGET)-ranlib"
+
+environment += PATH_FIG2DEV="/usr/bin:/usr/X11R6/bin:/usr/share/texmf/bin"
+environment += PATH="$(TOOLCHAIN_PATH)/bin:$(PATH):$(PATH_FIG2DEV)"
+#                                                   =============
+# need for fig2dev and documentation (see: ../.config).
+
+environment += BUILD_CC="$(CCACHE)/usr/bin/gcc"
+environment += TARGET_CFLAGS=""
+
+
+ifeq ($(TOOLCHAIN),$(TOOLCHAIN_S8XX_NEWLIB))
+extra_configure_switches  = --disable-multilib
+extra_configure_switches += --with-cpu=arcem
+extra_configure_switches += --with-endian=little
+
+extra_configure_switches += --with-gnu-as
+extra_configure_switches += --with-gnu-ld
+extra_configure_switches += --enable-newlib-supplied-sycalls
+# extra_configure_switches += --enable-newlib-global-atexit
+
+extra_configure_switches += --enable-newlib-io-c99-formats
+extra_configure_switches += --enable-newlib-io-long-long
+extra_configure_switches += --enable-newlib-io-pos-args
+extra_configure_switches += --enable-newlib-multithread
+endif
+
+
+
+$(src_done): $(SRC_ARCHIVE) $(PATCHES_DEP)
+	$(UNPACK_SRC_ARCHIVE)
+	$(APPLY_PATCHES)
+	@touch $@
+
+$(headers_target): $(src_done)
+	@mkdir -p $(headers_install_dir)
+	@cp -ar $(TARGET_BUILD_DIR)/$(src_dir_name)/newlib/libc/include $(headers_install_dir)/sys-include
+	@if [ -n "`cat $(SRC_DIR)/newlib/configure | grep _NEWLIB_VERSION | cut -f3 -d'"' | sed 's,[^0-9.],,g'`" ] ; then \
+	   version_string="`cat $(SRC_DIR)/newlib/configure | grep _NEWLIB_VERSION | cut -f3 -d'"' | sed 's,[^0-9.],,g'`" ; \
+	   echo "  newlib-$${version_string}$(if $(FLAVOUR),:$(FLAVOUR),)" >> $(TOOLCHAIN_PATH)/README ; \
+	 else \
+	   echo "  $(subst $(TOP_BUILD_DIR_ABS)/,,$(CURDIR))$(if $(FLAVOUR),:$(FLAVOUR),)" >> $(TOOLCHAIN_PATH)/README ; \
+	 fi
+	@touch $@
+
+$(build_target): $(src_done)
+	# =======  Building newlib =======
+	@mkdir -p $(build_dir)
+	@cd $(build_dir) && $(environment) ../$(src_dir_name)/newlib/configure \
+	  --prefix=$(TOOLCHAIN_PATH)       \
+	  --build=$(BUILD)                 \
+	  --host=$(TARGET)                 \
+	  --target=$(TARGET)               \
+	  --infodir=$(TOOLCHAIN_PATH)/share/info \
+	  --mandir=$(TOOLCHAIN_PATH)/share/man   \
+	  $(extra_configure_switches)
+	@$(environment) $(MAKE) -C $(build_dir) all
+	# =======  Building libgloss =======
+	@mkdir -p $(build_dir)/libgloss
+	@cd $(build_dir)/libgloss && $(environment) ../../$(src_dir_name)/libgloss/configure \
+	  --prefix=$(TOOLCHAIN_PATH)       \
+	  --build=$(BUILD)                 \
+	  --host=$(TARGET)                 \
+	  --target=$(TARGET)               \
+	  --infodir=$(TOOLCHAIN_PATH)/share/info \
+	  --mandir=$(TOOLCHAIN_PATH)/share/man   \
+	  $(extra_configure_switches)
+	@$(environment) $(MAKE) -C $(build_dir)/libgloss all info
+	@touch $@
+
+$(full_target): $(build_target)
+	@mkdir -p $(install_dir)
+	@$(environment) $(MAKE) -C $(build_dir) install
+	@$(environment) $(MAKE) -C $(build_dir)/libgloss install
+	@$(environment) $(MAKE) -C $(build_dir) pdf
+	@$(environment) $(MAKE) -C $(build_dir)/libgloss pdf
+	# ======= Install Documentation =======
+	@$(environment) $(MAKE) -C $(build_dir)/libgloss/doc install-info
+	@mkdir -p $(TOOLCHAIN_PATH)/share/doc/newlib
+	@cp $(build_dir)/libc/libc.pdf            $(TOOLCHAIN_PATH)/share/doc/newlib
+	@cp $(build_dir)/libm/libm.pdf            $(TOOLCHAIN_PATH)/share/doc/newlib
+	@cp $(build_dir)/libgloss/doc/porting.pdf $(TOOLCHAIN_PATH)/share/doc/newlib
+	@if [ -n "`cat $(SRC_DIR)/newlib/configure | grep _NEWLIB_VERSION | cut -f3 -d'"' | sed 's,[^0-9.],,g'`" ] ; then \
+	   version_string="`cat $(SRC_DIR)/newlib/configure | grep _NEWLIB_VERSION | cut -f3 -d'"' | sed 's,[^0-9.],,g'`" ; \
+	   echo "  newlib-$${version_string}$(if $(FLAVOUR),:$(FLAVOUR),)" >> $(TOOLCHAIN_PATH)/README ; \
+	 else \
+	   echo "  $(subst $(TOP_BUILD_DIR_ABS)/,,$(CURDIR))$(if $(FLAVOUR),:$(FLAVOUR),)" >> $(TOOLCHAIN_PATH)/README ; \
+	 fi
+	@touch $@
Index: 2020.03.18/PATCHES
===================================================================
Index: 2020.03.18
===================================================================
--- 2020.03.18	(nonexistent)
+++ 2020.03.18	(revision 5)

Property changes on: 2020.03.18
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,34 ##
+
+# Target build dirs
+.noarch/
+.host/
+
+.s8xx-newlib/
+
+# Hidden files (each file)
+.makefile
+
+# Tarballs
+*.gz
+*.bz2
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Default linux config files
+*.defconfig
+
+# Object Files
+*.[ao]
+
+# backup copies
+*~
Index: .
===================================================================
--- .	(nonexistent)
+++ .	(revision 5)

Property changes on: .
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,34 ##
+
+# Target build dirs
+.noarch/
+.host/
+
+.s8xx-newlib/
+
+# Hidden files (each file)
+.makefile
+
+# Tarballs
+*.gz
+*.bz2
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Default linux config files
+*.defconfig
+
+# Object Files
+*.[ao]
+
+# backup copies
+*~