# crate-type : dylib, proc-macro, cdylib, bin, etc.
# ==========================================================
%build
+%ifarch %{ix86}
+export RUSTC_TARGET_ARCH=x86
+export RUSTC_TARGET_POINTER_WIDTH=32
+%endif
+%ifarch x86_64
+export RUSTC_TARGET_ARCH=x86_64
+export RUSTC_TARGET_POINTER_WIDTH=64
+%endif
+%ifarch armv7l
+export RUSTC_TARGET_ARCH=arm
+export RUSTC_TARGET_POINTER_WIDTH=32
+%endif
+%ifarch aarch64
+export RUSTC_TARGET_ARCH=aarch64
+export RUSTC_TARGET_POINTER_WIDTH=64
+%endif
+%ifarch armv7hl
+export RUSTC_TARGET_ARCH=arm
+export RUSTC_TARGET_POINTER_WIDTH=32
+%endif
%{rustc_std_build} --crate-type=dylib \
--crate-name=%{real_crate_name} \
%{?rustc_edition:--edition=%{rustc_edition}} \
+ --cfg="target_arch=\"$RUSTC_TARGET_ARCH\"" \
+ --cfg="target_pointer_width=\"$RUSTC_TARGET_POINTER_WIDTH\"" \
--cfg='feature="std"' \
--cfg='feature="general"' \
--cfg='feature="errno"' \