From 7090a2418c31fda63541796a71a0634e0f8788aa Mon Sep 17 00:00:00 2001 From: Abdoulaye Walsimou Gaye Date: Sat, 15 Mar 2014 16:47:19 +0100 Subject: Toolchain: llvm/libcxxrt: move under toolchain/ Signed-off-by: Abdoulaye Walsimou Gaye --- mk/libc++/libc++/Makefile | 98 --------------------------- mk/libc++/libc++/libcxx.mk | 71 -------------------- mk/libc++/libcxxrt/Makefile | 108 ------------------------------ mk/libc++/libcxxrt/libcxxrt.mk | 56 ---------------- mk/llvm/clang.mk | 39 ----------- mk/llvm/compiler-rt/Makefile | 134 ------------------------------------- mk/llvm/compiler-rt/compiler-rt.mk | 81 ---------------------- mk/llvm/llvm.mk | 88 ------------------------ 8 files changed, 675 deletions(-) delete mode 100644 mk/libc++/libc++/Makefile delete mode 100644 mk/libc++/libc++/libcxx.mk delete mode 100644 mk/libc++/libcxxrt/Makefile delete mode 100644 mk/libc++/libcxxrt/libcxxrt.mk delete mode 100644 mk/llvm/clang.mk delete mode 100644 mk/llvm/compiler-rt/Makefile delete mode 100644 mk/llvm/compiler-rt/compiler-rt.mk delete mode 100644 mk/llvm/llvm.mk (limited to 'mk') diff --git a/mk/libc++/libc++/Makefile b/mk/libc++/libc++/Makefile deleted file mode 100644 index da95cab..0000000 --- a/mk/libc++/libc++/Makefile +++ /dev/null @@ -1,98 +0,0 @@ -################################################################################ -# Copyright 2012 Abdoulaye Walsimou GAYE . All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# 1. Redistributions of source code must retain the above copyright notice, -# this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS -# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -################################################################################ - -rootsrc ?= $(shell pwd) -LIBDIR ?= lib - -CXX_SRCS := $(wildcard $(rootsrc)/src/*.cpp) - -OBJS := $(patsubst %.cpp,%.o,$(CXX_SRCS)) -SOBJS := $(patsubst %.o,%.So,$(OBJS)) - -__HEADERS := $(wildcard $(rootsrc)/include/*) -HEADERS := $(filter-out $(rootsrc)/include/support,$(__HEADERS)) - -CC ?= gcc -CXX ?= g++ - -LIB := c++ -SHAREDLIB := $(LIB) -SHAREDLIB_NAME := lib$(SHAREDLIB).so.1 -SHAREDLIB_LINK := lib$(SHAREDLIB).so -SHAREDLIB_SONAME := $(SHAREDLIB_NAME) - -override LDFLAGS := $(LDFLAGS) -shared -Wl,--warn-shared-textrel -Wl,-x - -override CXXFLAGS := $(CXXFLAGS) $(CFLAGS) -nostdinc++ -std=c++11 -override CPPFLAGS := $(CPPFLAGS) -I$(rootsrc)/include -override CPPFLAGS += -DLIBCXXRT -DNO_CATGETS_SUPPORT - -LDADD := $(shell $(CC) --print-file-name=libcxxrt_pic.a) -LDADD += -lpthread -lrt -ldl -lc - -ARFLAGS := rvs - -define __lib_install - $(if $(SYSROOT), - mkdir -p $(SYSROOT)/usr - mkdir -p $(SYSROOT)/usr/include - mkdir -p $(SYSROOT)/usr/include/c++ - mkdir -p $(SYSROOT)/usr/include/c++/v1 - cp -R $(HEADERS) $(SYSROOT)/usr/include/c++/v1 - chmod 755 $(SYSROOT)/usr/include/c++/v1 - chmod 644 $(SYSROOT)/usr/include/c++/v1/* - chmod 755 $(SYSROOT)/usr/include/c++/v1/ext - chmod 644 $(SYSROOT)/usr/include/c++/v1/ext/* - mkdir -p $(SYSROOT)/$(LIBDIR) - tar -cf - *.so* | tar -xf - -C $(SYSROOT)/$(LIBDIR)/ - cp lib$(LIB)_nonshared.a $(SYSROOT)/usr/$(LIBDIR)/) -endef - -all: lib$(LIB)_nonshared.a $(SHAREDLIB_NAME) - $(Q)true - -install: all - $(Q)$(__lib_install) - $(Q)true - -$(SHAREDLIB_NAME): $(SOBJS) - $(Q)$(CC) $(LDFLAGS) -o $@ \ - -Wl,-soname,$(SHAREDLIB_SONAME) $(SOBJS) $(LDADD) - $(Q)ln -fs $(SHAREDLIB_NAME) $(SHAREDLIB_LINK) - -lib$(LIB)_nonshared.a: $(OBJS) - $(Q)$(AR) $(ARFLAGS) $@ $(OBJS) - -%.o: %.cpp - $(Q)$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $< -o $@ - -%.So: %.cpp - $(Q)$(CXX) -fPIC $(CXXFLAGS) $(CPPFLAGS) -c $< -o $@ - -clean: - $(Q)rm -rf $(OBJS) $(SOBJS) lib$(LIB).a - $(Q)rm -rf $(SHAREDLIB_NAME) $(SHAREDLIB_LINK) - diff --git a/mk/libc++/libc++/libcxx.mk b/mk/libc++/libc++/libcxx.mk deleted file mode 100644 index c3e14af..0000000 --- a/mk/libc++/libc++/libcxx.mk +++ /dev/null @@ -1,71 +0,0 @@ -################################################################################ -# Embtoolkit -# Copyright(C) 2012-2014 Abdoulaye Walsimou GAYE . -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -################################################################################ -# -# \file libcxx.mk -# \brief libcxx.mk of Embtoolkit -# \author Abdoulaye Walsimou GAYE -# \date December 2012 -################################################################################ - -LIBCXX_NAME := libcxx -LIBCXX_VERSION := $(call embtk_get_pkgversion,libcxx) -LIBCXX_SITE := ftp://ftp.embtoolkit.org/embtoolkit.org/packages-mirror/$(LIBCXX_VERSION) -#LIBCXX_GIT_SITE := http://llvm.org/git/libcxx.git -LIBCXX_GIT_SITE := git://www.embtoolkit.org/libcxx.git -LIBCXX_PACKAGE := libcxx-$(LIBCXX_VERSION).tar.bz2 -LIBCXX_SRC_DIR := $(embtk_toolsb)/libcxx-$(LIBCXX_VERSION) -LIBCXX_BUILD_DIR := $(call __embtk_pkg_srcdir,libcxx) - -LIBCXX_KEEP_SRC_DIR := y - -LIBCXX_DEPS := libcxxrt_install - -__embtk_libcxx_cflags := $(TARGET_CFLAGS) -__embtk_libcxx_cflags += -I$(embtk_sysroot)/usr/include/c++/v1 - -LIBCXX_MAKE_OPTS := CC="$(TARGETCC)" CFLAGS="$(__embtk_libcxx_cflags)" -LIBCXX_MAKE_OPTS += CXX="$(TARGETCXX)" LIBDIR=$(LIBDIR) -LIBCXX_MAKE_OPTS += AR=$(TARGETAR) RANLIB=$(TARGETRANLIB) -LIBCXX_MAKE_OPTS += SYSROOT="$(embtk_sysroot)" - -define embtk_install_libcxx - $(call embtk_makeinstall_pkg,libcxx) -endef - -define embtk_beforeinstall_libcxx - ln -sf $(EMBTK_ROOT)/mk/libc++/libc++/Makefile \ - $(LIBCXX_BUILD_DIR)/Makefile -endef - -__embtk_staticlibcxx := $(embtk_sysroot)/usr/$(LIBDIR)/libc++.a -define __embtk_postinstall_staticlibcxx - (echo "GROUP(libc++_nonshared.a libcxxrt.a libpthread.a librt.a libdl.a)" \ - > $(__embtk_staticlibcxx)) -endef - -define embtk_postinstallonce_libcxx - $(__embtk_postinstall_staticlibcxx) -endef - -define embtk_cleanup_libcxx - if [ -e $(LIBCXXRT_BUILD_DIR)/Makefile ]; then \ - $(MAKE) -C $(LIBCXXRT_BUILD_DIR) clean; \ - fi - rm -rf $(LIBCXXRT_BUILD_DIR)/Makefile -endef diff --git a/mk/libc++/libcxxrt/Makefile b/mk/libc++/libcxxrt/Makefile deleted file mode 100644 index d7fa28b..0000000 --- a/mk/libc++/libcxxrt/Makefile +++ /dev/null @@ -1,108 +0,0 @@ -################################################################################ -# Copyright 2012 Abdoulaye Walsimou GAYE . All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# 1. Redistributions of source code must retain the above copyright notice, -# this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS -# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -################################################################################ - -rootsrc ?= $(shell pwd) -LIBDIR ?= lib - -__NO_C_SRCS := $(addprefix $(rootsrc)/src/,cxa_atexit.c cxa_finalize.c) -C_SRCS := $(wildcard $(rootsrc)/src/*.c) -C_SRCS := $(filter-out $(__NO_C_SRCS),$(C_SRCS)) - -CXX_SRCS := $(wildcard $(rootsrc)/src/*.cc) - -__HEADERS := cxxabi.h unwind-arm.h unwind.h unwind-itanium.h -HEADERS := $(addprefix $(rootsrc)/src/,$(__HEADERS)) - -OBJS := $(patsubst %.c,%.o,$(C_SRCS)) -OBJS += $(patsubst %.cc,%.o,$(CXX_SRCS)) -POBJS := $(patsubst %.o,%.po,$(OBJS)) -SOBJS := $(patsubst %.o,%.So,$(OBJS)) - -LIB := cxxrt -SHAREDLIB := $(LIB) -SHAREDLIB_NAME := lib$(SHAREDLIB).so.1 -SHAREDLIB_LINK := lib$(SHAREDLIB).so -SHAREDLIB_SONAME := $(SHAREDLIB_NAME) - -CC ?= gcc -CXX ?= g++ - -ARFLAGS := rvs - -override CFLAGS := $(CFLAGS) -I$(rootsrc)/src -D_GNU_SOURCE -override CXXFLAGS := $(CXXFLAGS) $(CFLAGS) - -define __lib_install - $(if $(SYSROOT), - mkdir -p $(SYSROOT)/$(LIBDIR) - mkdir -p $(SYSROOT)/usr - mkdir -p $(SYSROOT)/usr/include - mkdir -p $(SYSROOT)/usr/include/c++ - mkdir -p $(SYSROOT)/usr/include/c++/v1 - cp lib$(LIB).a $(SYSROOT)/usr/$(LIBDIR)/ - cp lib$(LIB)_pic.a $(SYSROOT)/usr/$(LIBDIR)/ - cp lib$(LIB)_p.a $(SYSROOT)/usr/$(LIBDIR)/ - cp $(HEADERS) $(SYSROOT)/usr/include/c++/v1/) -endef - -all: lib$(LIB).a lib$(LIB)_p.a lib$(LIB)_pic.a - $(Q)true - -install: all - $(Q)$(__lib_install) - $(Q)true - -lib$(LIB).a: $(OBJS) - $(Q)$(AR) $(ARFLAGS) $@ $(OBJS) $(ARADD) - -lib$(LIB)_p.a: $(POBJS) - $(Q)$(AR) $(ARFLAGS) $@ $(POBJS) $(ARADD) - -lib$(LIB)_pic.a: $(SOBJS) - $(Q)$(AR) $(ARFLAGS) $@ $(SOBJS) $(ARADD) - -%.o: %.c - $(Q)$(CC) $(CFLAGS) -c $< -o $@ - -%.o: %.cc - $(Q)$(CXX) $(CXXFLAGS) -c $< -o $@ - -%.po: %.c - $(Q)$(CC) $(CFLAGS) -pg -c $< -o $@ - -%.po: %.cc - $(Q)$(CXX) $(CXXFLAGS) -pg -c $< -o $@ - -%.So: %.c - $(Q)$(CC) -fPIC -DPIC $(CFLAGS) -c $< -o $@ - -%.So: %.cc - $(Q)$(CXX) $(CXXFLAGS) -fPIC -DPIC $(CXXFLAGS) -c $< -o $@ - -clean: - $(Q)rm -rf $(OBJS) $(SOBJS) $(POBJS) - $(Q)rm -rf lib$(LIB).a lib$(LIB)_p.a lib$(LIB)_pic.a - diff --git a/mk/libc++/libcxxrt/libcxxrt.mk b/mk/libc++/libcxxrt/libcxxrt.mk deleted file mode 100644 index bf12ecf..0000000 --- a/mk/libc++/libcxxrt/libcxxrt.mk +++ /dev/null @@ -1,56 +0,0 @@ -################################################################################ -# Embtoolkit -# Copyright(C) 2012 Abdoulaye Walsimou GAYE . -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -################################################################################ -# -# \file libcxxrt.mk -# \brief libcxxrt.mk of Embtoolkit -# \author Abdoulaye Walsimou GAYE -# \date December 2012 -################################################################################ - -LIBCXXRT_NAME := libcxxrt -LIBCXXRT_VERSION := $(call embtk_get_pkgversion,libcxxrt) -LIBCXXRT_SITE := ftp://ftp.embtoolkit.org/embtoolkit.org/packages-mirror/$(LIBCXXRT_VERSION) -#LIBCXXRT_GIT_SITE := git://github.com/pathscale/libcxxrt.git -LIBCXXRT_GIT_SITE := git://www.embtoolkit.org/libcxxrt.git -LIBCXXRT_PACKAGE := libcxxrt-$(LIBCXXRT_VERSION).tar.bz2 -LIBCXXRT_SRC_DIR := $(embtk_toolsb)/libcxxrt-$(LIBCXXRT_VERSION) -LIBCXXRT_BUILD_DIR := $(call __embtk_pkg_srcdir,libcxxrt) - -__embtk_libcxxrt_cflags := $(TARGET_CFLAGS) - -LIBCXXRT_MAKE_OPTS := CC="$(TARGETCC)" CFLAGS="$(__embtk_libcxxrt_cflags)" -LIBCXXRT_MAKE_OPTS += CXX="$(TARGETCXX)" LIBDIR=$(LIBDIR) -LIBCXXRT_MAKE_OPTS += AR=$(TARGETAR) RANLIB=$(TARGETRANLIB) -LIBCXXRT_MAKE_OPTS += SYSROOT="$(embtk_sysroot)" - -define embtk_install_libcxxrt - $(call embtk_makeinstall_pkg,libcxxrt) -endef - -define embtk_beforeinstall_libcxxrt - ln -sf $(EMBTK_ROOT)/mk/libc++/libcxxrt/Makefile \ - $(LIBCXXRT_BUILD_DIR)/Makefile -endef - -define embtk_cleanup_libcxxrt - if [ -e $(LIBCXXRT_BUILD_DIR)/Makefile ]; then \ - $(MAKE) -C $(LIBCXXRT_BUILD_DIR) clean; \ - fi - rm -rf $(LIBCXXRT_BUILD_DIR)/Makefile -endef diff --git a/mk/llvm/clang.mk b/mk/llvm/clang.mk deleted file mode 100644 index 0a5484b..0000000 --- a/mk/llvm/clang.mk +++ /dev/null @@ -1,39 +0,0 @@ -################################################################################ -# Embtoolkit -# Copyright(C) 2012 Abdoulaye Walsimou GAYE . -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -################################################################################ -# -# \file clang.mk -# \brief clang.mk of Embtoolkit -# \author Abdoulaye Walsimou GAYE -# \date October 2012 -################################################################################ - -CLANG_NAME := clang -CLANG_VERSION := $(call embtk_get_pkgversion,clang) -CLANG_SITE := http://llvm.org/releases/$(CLANG_VERSION) -#CLANG_GIT_SITE := http://llvm.org/git/clang.git -CLANG_GIT_SITE := git://www.embtoolkit.org/clang.git -CLANG_PACKAGE := clang-$(CLANG_VERSION).src.tar.gz -CLANG_SRC_DIR := $(embtk_toolsb)/clang-$(CLANG_VERSION).src -CLANG_BUILD_DIR := $(embtk_toolsb)/clang-build - -define embtk_install_clang - $(call embtk_pinfo,"Compile/Install of clang will be done within llvm...") - $(call embtk_download_pkg,clang) - $(call embtk_decompress_pkg,clang) -endef diff --git a/mk/llvm/compiler-rt/Makefile b/mk/llvm/compiler-rt/Makefile deleted file mode 100644 index e4a18ba..0000000 --- a/mk/llvm/compiler-rt/Makefile +++ /dev/null @@ -1,134 +0,0 @@ -################################################################################ -# Copyright 2013 Abdoulaye Walsimou GAYE . All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# 1. Redistributions of source code must retain the above copyright notice, -# this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS -# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -################################################################################ - -rootsrc/ ?= -LIBDIR ?= lib - -# -# Sanitizer common part -# -SANCOMMON := sanitizer_common -SANCOMMON_CXXSRCS := $(wildcard $(rootsrc/)lib/sanitizer_common/*.cc) -SANCOMMON_CXXSRCS += $(wildcard $(rootsrc/)lib/interception/*.cc) -SANCOMMON_CSRCS := $(wildcard $(rootsrc/)lib/sanitizer_common/*.c) -SANCOMMON_CSRCS += $(wildcard $(rootsrc/)lib/interception/*.c) - -SANCOMMON_OBJS := $(patsubst %.cc,%.o,$(SANCOMMON_CXXSRCS)) -SANCOMMON_OBJS += $(patsubst %.c,%.o,$(SANCOMMON_CSRCS)) - -SANCOMMON_EXTRA_CFLAGS := -fno-rtti - -# -# Address sanitizer part -# -ASAN := asan -ASAN_CXXSRCS := $(wildcard $(rootsrc/)lib/asan/*.cc) -ASAN_CSRCS := $(wildcard $(rootsrc/)lib/asan/*.c) - -ASAN_OBJS := $(patsubst %.cc,%.o,$(ASAN_CXXSRCS)) -ASAN_OBJS += $(patsubst %.c,%.o,$(ASAN_CSRCS)) - -ASAN_EXTRA_CFLAGS := -fno-rtti - -# -# Thread sanitizer part -# -TSAN := tsan -TSAN_CXXSRCS := $(wildcard $(rootsrc/)lib/tsan/rtl/*.cc) -TSAN_CSRCS := $(wildcard $(rootsrc/)lib/tsan/rtl/*.c) -TSAN_OBJS := $(patsubst %.cc,%.o,$(TSAN_CXXSRCS)) -TSAN_OBJS += $(patsubst %.c,%.o,$(TSAN_CSRCS)) - -# -# Undefined behavior sanitizer part -# -UBSAN := ubsan -UBSAN_CXXSRCS := $(wildcard $(rootsrc/)lib/ubsan/*.cc) -UBSAN_CSRCS := $(wildcard $(rootsrc/)lib/ubsan/*.c) - -UBSAN_OBJS := $(patsubst %.cc,%.o,$(UBSAN_CXXSRCS)) -UBSAN_OBJS += $(patsubst %.c,%.o,$(UBSAN_CSRCS)) - -# -# Common part -# -CC ?= gcc -CXX ?= g++ - -SANCOMMON_CFLAGS := -W -Wall -fPIC -fno-builtin -fno-exceptions -SANCOMMON_CFLAGS += -fomit-frame-pointer -funwind-tables -SANCOMMON_CFLAGS += -fno-stack-protector -fvisibility=hidden -g -# -# FIXME: remove this avec full merge of compiler-rt/llvm/clang-3.3. -# The copy of compiler-rt shipped with EmbToolkit was in the middle of -# compiler-rt-3.3 development. -# -SANCOMMON_CFLAGS += -DASAN_ALLOCATOR_VERSION=1 - -ARFLAGS := rvs - -override CFLAGS := $(CFLAGS) $(SANCOMMON_CFLAGS) -override CPPFLAGS := $(CPPFLAGS) -I$(rootsrc/)include -I$(rootsrc/)lib -override CXXFLAGS := $(CXXFLAGS) $(CFLAGS) - -define __lib_install - $(if $(SYSROOT), - mkdir -p $(SYSROOT)/usr - mkdir -p $(SYSROOT)/usr/$(LIBDIR) - cp lib$(SANCOMMON).a $(SYSROOT)/usr/$(LIBDIR) - cp lib$(ASAN).a $(SYSROOT)/usr/$(LIBDIR) - cp lib$(UBSAN).a $(SYSROOT)/usr/$(LIBDIR)) -endef - -all: lib$(SANCOMMON).a lib$(ASAN).a lib$(UBSAN).a - $(Q)true - -install: all - $(Q)$(__lib_install) - -lib$(SANCOMMON).a: EXTRA_CFLAGS = $(SANCOMMON_EXTRA_CFLAGS) -lib$(SANCOMMON).a: $(SANCOMMON_OBJS) - $(Q)$(AR) $(ARFLAGS) $@ $(SANCOMMON_OBJS) - -lib$(ASAN).a: EXTRA_CFLAGS = $(ASAN_EXTRA_CFLAGS) -lib$(ASAN).a: $(ASAN_OBJS) - $(Q)$(AR) $(ARFLAGS) $@ $(ASAN_OBJS) - -lib$(TSAN).a: $(TSAN_OBJS) - $(Q)$(AR) $(ARFLAGS) $@ $(TSAN_OBJS) - -lib$(UBSAN).a: $(UBSAN_OBJS) - $(Q)$(AR) $(ARFLAGS) $@ $(UBSAN_OBJS) - -%.o: %.c - $(Q)$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CPPFLAGS) -c $< -o $@ - -%.o: %.cc - $(Q)$(CXX) $(CXXFLAGS) $(EXTRA_CFLAGS) $(CPPFLAGS) -c $< -o $@ - -clean: - $(Q)rm -rf $(SANCOMMON_OBJS) $(ASAN_OBJS) $(TSAN_OBJS) $(UBSAN_OBJS) - $(Q)rm -rf lib$(SANCOMMON).a lib$(ASAN).a lib$(TSAN).a lib$(UBSAN).a diff --git a/mk/llvm/compiler-rt/compiler-rt.mk b/mk/llvm/compiler-rt/compiler-rt.mk deleted file mode 100644 index 1e8ed7c..0000000 --- a/mk/llvm/compiler-rt/compiler-rt.mk +++ /dev/null @@ -1,81 +0,0 @@ -################################################################################ -# Embtoolkit -# Copyright(C) 2012-2013 Abdoulaye Walsimou GAYE . -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -################################################################################ -# -# \file compiler-rt.mk -# \brief compiler-rt.mk of Embtoolkit -# \author Abdoulaye Walsimou GAYE -# \date October 2012 -################################################################################ - -COMPILER-RT_NAME := compiler-rt -COMPILER-RT_VERSION := $(call embtk_get_pkgversion,compiler-rt) -COMPILER-RT_SITE := ftp://ftp.embtoolkit.org/embtoolkit.org/packages-mirror -#COMPILER-RT_GIT_SITE := http://llvm.org/git/compiler-rt.git -COMPILER-RT_GIT_SITE := git://www.embtoolkit.org/compiler-rt.git -COMPILER-RT_PACKAGE := compiler-rt-$(COMPILER-RT_VERSION).tar.bz2 -COMPILER-RT_SRC_DIR := $(embtk_toolsb)/compiler-rt-$(COMPILER-RT_VERSION) -COMPILER-RT_BUILD_DIR := $(call __embtk_pkg_srcdir,compiler-rt) - -__embtk_compiler-rt_cflags := $(TARGET_CFLAGS) -# -# FIXME: remove this when c++ exceptions handling fully supported in ARM -# -ifeq ($(TARGETCXX),$(TARGETGCXX)) -__embtk_compiler-rt_cflags := $(filter-out $(__clang_cflags),$(__embtk_compiler-rt_cflags)) -endif - -ifeq ($(CONFIG_EMBTK_CLANG_VERSION_3_3),y) -__embtk_compiler-rt_cflags += -DASAN_INTERFACE_VERSION=3 -endif - -ifeq ($(CONFIG_EMBTK_CLIB_MUSL),y) -__embtk_compiler-rt_cflags += -D_FILE_OFFSET_BITS=64 -D__MUSL__ -endif - -COMPILER-RT_MAKE_OPTS := CC="$(TARGETCC)" CFLAGS="$(__embtk_compiler-rt_cflags)" -COMPILER-RT_MAKE_OPTS += CXX="$(TARGETCXX)" LIBDIR="$(LIBDIR)" -COMPILER-RT_MAKE_OPTS += AR=$(TARGETAR) RANLIB=$(TARGETRANLIB) -COMPILER-RT_MAKE_OPTS += SYSROOT="$(embtk_sysroot)" - -define embtk_install_compiler-rt - $(call embtk_makeinstall_pkg,compiler-rt) -endef - -define embtk_beforeinstall_compiler-rt - ln -sf $(EMBTK_ROOT)/mk/llvm/compiler-rt/Makefile \ - $(COMPILER-RT_BUILD_DIR)/Makefile -endef - -__embtk_libasan := libclang_rt.asan-$(__embtk_clang_arch).a -__embtk_libubsan := libclang_rt.ubsan-$(__embtk_clang_arch).a -define embtk_postinstallonce_compiler-rt - echo "GROUP(libasan.a libsanitizer_common.a)" \ - > $(__embtk_clang_libdir)/$(__embtk_libasan) - echo "GROUP(libubsan.a libsanitizer_common.a)" \ - > $(__embtk_clang_libdir)/$(__embtk_libubsan) - cp -R $(call __embtk_pkg_srcdir,compiler-rt)/include/* \ - $(__embtk_clang_incdir)/ -endef - -define embtk_cleanup_compiler-rt - if [ -e $(COMPILER-RT_BUILD_DIR)/Makefile ]; then \ - $(MAKE) -C $(COMPILER-RT_BUILD_DIR) clean; \ - fi - rm -rf $(COMPILER-RT_BUILD_DIR)/Makefile -endef diff --git a/mk/llvm/llvm.mk b/mk/llvm/llvm.mk deleted file mode 100644 index 12f0fbc..0000000 --- a/mk/llvm/llvm.mk +++ /dev/null @@ -1,88 +0,0 @@ -################################################################################ -# Embtoolkit -# Copyright(C) 2012 Abdoulaye Walsimou GAYE . -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -################################################################################ -# -# \file llvm.mk -# \brief llvm.mk of Embtoolkit -# \author Abdoulaye Walsimou GAYE -# \date October 2012 -################################################################################ - -LLVM_NAME := llvm -LLVM_VERSION := $(call embtk_get_pkgversion,llvm) -LLVM_SITE := http://llvm.org/releases/$(LLVM_VERSION) -#LLVM_GIT_SITE := http://llvm.org/git/llvm.git -LLVM_GIT_SITE := git://www.embtoolkit.org/llvm.git -LLVM_PACKAGE := llvm-$(LLVM_VERSION).src.tar.gz -LLVM_SRC_DIR := $(embtk_toolsb)/llvm-$(LLVM_VERSION).src -LLVM_BUILD_DIR := $(embtk_toolsb)/llvm-build - -LLVM_DEPS := binutils_install clang_install - -LLVM_WITH_HASHSTYLE := $(if $(CONFIG_EMBTK_CLIB_UCLIBC),--with-default-hash-style=sysv) - -__embtk_binutils_inc := $(call __embtk_pkg_srcdir,binutils)/include - -LLVM_CONFIGURE_OPTS := --target=$(STRICT_GNU_TARGET) -LLVM_CONFIGURE_OPTS += --enable-targets=$(LINUX_ARCH),x86 -LLVM_CONFIGURE_OPTS += $(LLVM_WITH_CPU) $(LLVM_WITH_ABI) -LLVM_CONFIGURE_OPTS += $(LLVM_WITH_FLOAT) $(LLVM_WITH_FPU) -LLVM_CONFIGURE_OPTS += $(LLVM_WITH_HASHSTYLE) -LLVM_CONFIGURE_OPTS += --with-default-sysroot=$(embtk_sysroot) -LLVM_CONFIGURE_OPTS += --enable-optimized --disable-jit --disable-zlib -LLVM_CONFIGURE_OPTS += --with-bug-report-url=$(EMBTK_BUGURL) -LLVM_CONFIGURE_OPTS += --with-binutils-include=$(__embtk_binutils_inc) - -LLVM_MAKE_OPTS := NO_UNITTESTS=1 -LLVM_MAKE_OPTS += CLANG_VENDOR="EmbToolkit(v$(EMBTK_VERSION))" - -LLVM_PREFIX := $(embtk_tools) - -__embtk_clang_arch := $(firstword $(subst -, ,$(STRICT_GNU_TARGET))) -__embtk_clang_rversion = `ls $(embtk_tools)/lib/clang/` -__embtk_clang_libdir = $(embtk_tools)/lib/clang/$(__embtk_clang_rversion)/lib/linux -__embtk_clang_incdir = $(embtk_tools)/lib/clang/$(__embtk_clang_rversion)/include - -define embtk_install_llvm - $(call __embtk_install_hostpkg,llvm) -endef - -define embtk_beforeinstall_llvm - [ -e $(call __embtk_pkg_srcdir,llvm)/tools/clang ] || \ - ln -sf $(call __embtk_pkg_srcdir,clang) \ - $(call __embtk_pkg_srcdir,llvm)/tools/clang - mkdir -p $(embtk_tools)/bin/clang-scan-build - cp -R $(call __embtk_pkg_srcdir,llvm)/tools/clang/tools/scan-build/* \ - $(embtk_tools)/bin/clang-scan-build - mkdir -p $(embtk_tools)/bin/clang-scan-view - cp -R $(call __embtk_pkg_srcdir,llvm)/tools/clang/tools/scan-view/* \ - $(embtk_tools)/bin/clang-scan-view -endef - -define embtk_postinstallonce_llvm - mkdir -p $(embtk_tools)/lib/bfd-plugins - cd $(embtk_tools)/lib/bfd-plugins; \ - ln -sf ../libLTO.so libLTO.so; \ - ln -sf ../LLVMgold.so LLVMgold.so - mkdir -p $(embtk_tools)/lib/clang/$(__embtk_clang_rversion)/lib - mkdir -p $(embtk_tools)/lib/clang/$(__embtk_clang_rversion)/lib/linux -endef - -define embtk_cleanup_llvm - $(Q)rm -rf $(LLVM_BUILD_DIR) -endef -- cgit v1.2.3