I'm trying to collect information about various build environments in order to incorporate the Rust language into the OpenWrt build environment.
I'm having/choosing to define custom target triples to match the OpenWrt environment, but I need to make a list so I can create the proper reference.
I've created a small Makefile that can be run to report the environment.
If you put the below Makefile
into package/testing/showtriple
and then:
make -j1 V=sc package/testing/showtriple/compile
grommish@norwits:~/openwrt$ make -j1 V=sc package/testing/showtriple/compile
Collecting package info: done
make[2]: Entering directory '/home/grommish/openwrt/scripts/config'
make[2]: 'conf' is up to date.
make[2]: Leaving directory '/home/grommish/openwrt/scripts/config'
make[1]: Entering directory '/home/grommish/openwrt'
make[2]: Entering directory '/home/grommish/openwrt/package/libs/toolchain'
echo "libc" >> /home/grommish/openwrt/staging_dir/target-mips64_octeon3_64_musl/pkginfo/toolchain.default.install
echo "libgcc" >> /home/grommish/openwrt/staging_dir/target-mips64_octeon3_64_musl/pkginfo/toolchain.default.install
echo "libstdcpp" >> /home/grommish/openwrt/staging_dir/target-mips64_octeon3_64_musl/pkginfo/toolchain.default.install
echo "libpthread" >> /home/grommish/openwrt/staging_dir/target-mips64_octeon3_64_musl/pkginfo/toolchain.default.install
echo "librt" >> /home/grommish/openwrt/staging_dir/target-mips64_octeon3_64_musl/pkginfo/toolchain.default.install
make[2]: Leaving directory '/home/grommish/openwrt/package/libs/toolchain'
time: package/libs/toolchain/compile#0.23#0.07#0.28
make[2]: Entering directory '/home/grommish/openwrt/package/testing/showtriple'
Host Arch - x86_64-unknown-linux-gnu, Target Arch - mips64-openwrt-linux-musl
make[2]: Nothing to be done for 'compile'.
make[2]: Leaving directory '/home/grommish/openwrt/package/testing/showtriple'
time: package/testing/showtriple/compile#0.84#0.08#0.93
make[1]: Leaving directory '/home/grommish/openwrt'
This is what I'm after:
Host Arch - x86_64-unknown-linux-gnu, Target Arch - mips64-openwrt-linux-musl
So, if anyone is feeling nice and helpful, and would run this and report the results, I'd be most appreciative
Makefile:
include $(TOPDIR)/rules.mk
PKG_NAME:=showtriple
PKG_VERSION:=1
PKG_RELEASE:=1
include $(INCLUDE_DIR)/package.mk
ifeq ($(CONFIG_arm_v7),y)
RUST_ARCH:=armv7
else
RUST_ARCH:=$(ARCH)
endif
CONFIG_HOST_SUFFIX:=$(shell cut -d"-" -f4 <<<"$(GNU_HOST_NAME)")
RUSTC_ARCH_TARGETS:= \
aarch64-unknown-linux-gnu aarch64-unknown-linux-musl \
\
arm-unknown-linux-gnueabi arm-unknown-linux-gnueabihf \
arm-unknown-linux-musleabi arm-unknown-linux-musleabihf \
\
armv4t-unknown-linux-gnueabi \
\
armv5te-unknown-linux-gnueabi armv5te-unknown-linux-musleabi \
\
armv7-unknown-linux-gnueabi armv7-unknown-linux-gnueabihf \
armv7-unknown-linux-musleabi \
\
hexagon-unknown-linux-musl \
\
i586-unknown-linux-gnu i586-unknown-linux-musl \
\
i686-unknown-linux-gnu i686-unknown-linux-musl \
\
mips-unknown-linux-gnu mips-unknown-linux-musl mips-unknown-linux-uclibc \
\
mips64-unknown-linux-gnuabi64 mips64-unknown-linux-muslabi64 \
\
mips64el-unknown-linux-gnuabi64 mips64el-unknown-linux-muslabi64 \
\
mipsel-unknown-linux-gnu mipsel-unknown-linux-musl \
mipsel-unknown-linux-uclibc \
\
mipsisa32r6-unknown-linux-gnu mipsisa32r6el-unknown-linux-gnu \
\
mipsisa64r6-unknown-linux-gnuabi64 mipsisa64r6el-unknown-linux-gnuabi64 \
\
powerpc-unknown-linux-gnu powerpc-unknown-linux-musl \
\
powerpc64-unknown-linux-gnu powerpc64-unknown-linux-musl \
\
powerpc64le-unknown-linux-gnu powerpc64le-unknown-linux-musl \
\
riscv64gc-unknown-linux-gnu \
\
s390x-unknown-linux-gnu \
\
sparc-unknown-linux-gnu \
\
sparc64-unknown-linux-gnu \
\
thumbv7neon-unknown-linux-gnueabihf thumbv7neon-unknown-linux-musleabihf \
\
x86_64-unknown-linux-gnu x86_64-unknown-linux-musl
RUSTC_HOST_ARCH:= \
$(strip $(foreach \
v, \
$(filter $(HOST_ARCH)-%, $(RUSTC_ARCH_TARGETS)), \
$(if $(findstring -$(CONFIG_HOST_SUFFIX:"%"=%),$v),$v) \
) \
)
# More than one triple-target remains.
ifneq ($(word 2, $(RUSTC_TARGET_ARCH)),)
$(error RUSTC ERROR: Unsupported or Unknown Target Triple: $(RUSTC_TARGET_ARCH))
endif
RUSTC_TARGET_ARCH:=$(REAL_GNU_TARGET_NAME)
define Build/Prepare
true
endef
define Build/Configure
true
endef
define Build/Compile
$(info Host Arch - $(RUSTC_HOST_ARCH), Target Arch - $(RUSTC_TARGET_ARCH))
true
endef
define Package/showtriple
SECTION:=testing
CATEGORY:=Testing
TITLE:=RustC Host and Target Triple Display
URL:=None
endef
define Package/showtriple/description
Show Info About the Build Environment
endef
$(eval $(call BuildPackage,showtriple))