Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate configuration files for clang/clang++ #1548

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ XLEN := $(shell echo $(WITH_ARCH) | tr A-Z a-z | sed 's/.*rv\([0-9]*\).*/\1/')
ifneq ($(XLEN),32)
XLEN := 64
endif
MARCH := $(shell echo $(WITH_ARCH) | tr A-Z a-z | sed 's/.*--with-arch=\(.*\).*/\1/')
MABI := $(shell echo $(WITH_ABI) | tr A-Z a-z | sed 's/.*--with-abi=\(.*\).*/\1/')
MTUNE := $(shell echo $(WITH_TUNE) | tr A-Z a-z | sed 's/.*--with-tune=\(.*\).*/\1/')

make_tuple = riscv$(1)-unknown-$(2)
LINUX_TUPLE ?= $(call make_tuple,$(XLEN),linux-gnu)
Expand Down Expand Up @@ -1201,6 +1204,8 @@ stamps/build-llvm-linux: $(LLVM_SRCDIR) $(LLVM_SRC_GIT) $(BINUTILS_SRCDIR) $(BIN
cp $(notdir $@)/lib/riscv$(XLEN)-unknown-linux-gnu/libc++* $(SYSROOT)/lib
cp $(notdir $@)/lib/LLVMgold.$(SHARED_LIB_SUFFIX) $(INSTALL_DIR)/lib
cd $(INSTALL_DIR)/bin && ln -s -f clang $(LINUX_TUPLE)-clang && ln -s -f clang++ $(LINUX_TUPLE)-clang++
echo "-march=${MARCH} -mabi=${MABI} -mtune=${MTUNE}" > $(INSTALL_DIR)/bin/$(LINUX_TUPLE)-clang.cfg
echo "-march=${MARCH} -mabi=${MABI} -mtune=${MTUNE}" > $(INSTALL_DIR)/bin/$(LINUX_TUPLE)-clang++.cfg
mkdir -p $(dir $@) && touch $@

stamps/build-llvm-newlib: $(LLVM_SRCDIR) $(LLVM_SRC_GIT) $(BINUTILS_SRCDIR) $(BINUTILS_SRC_GIT) \
Expand All @@ -1222,6 +1227,8 @@ stamps/build-llvm-newlib: $(LLVM_SRCDIR) $(LLVM_SRC_GIT) $(BINUTILS_SRCDIR) $(BI
cp $(notdir $@)/lib/LLVMgold.$(SHARED_LIB_SUFFIX) $(INSTALL_DIR)/lib
cd $(INSTALL_DIR)/bin && ln -s -f clang $(NEWLIB_TUPLE)-clang && \
ln -s -f clang++ $(NEWLIB_TUPLE)-clang++
echo "-march=${MARCH} -mabi=${MABI} -mtune=${MTUNE}" > $(INSTALL_DIR)/bin/$(NEWLIB_TUPLE)-clang.cfg
echo "-march=${MARCH} -mabi=${MABI} -mtune=${MTUNE}" > $(INSTALL_DIR)/bin/$(NEWLIB_TUPLE)-clang++.cfg
mkdir -p $(dir $@) && touch $@

stamps/build-dejagnu: $(DEJAGNU_SRCDIR) $(DEJAGNU_SRC_GIT) $(PREPARATION_STAMP)
Expand Down
Loading