make.sh: Introduce RUSTFLAGS

Message ID 20191207183045.4244-1-stefan.schantl@ipfire.org
State Accepted
Commit 8245498310fb727b2ed23c2c1a210b18ebe205a1
Headers
Series make.sh: Introduce RUSTFLAGS |

Commit Message

Stefan Schantl Dec. 7, 2019, 6:30 p.m. UTC
  This allows to set arch-specific FLAGS when dealing with
software written in rust.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
---
 make.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
  

Comments

Michael Tremer Dec. 9, 2019, 3:20 p.m. UTC | #1
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>

> On 7 Dec 2019, at 18:30, Stefan Schantl <stefan.schantl@ipfire.org> wrote:
> 
> This allows to set arch-specific FLAGS when dealing with
> software written in rust.
> 
> Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
> ---
> make.sh | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/make.sh b/make.sh
> index 771c5ff89..2cdbe154a 100755
> --- a/make.sh
> +++ b/make.sh
> @@ -174,6 +174,7 @@ configure_build() {
> 			CROSSTARGET="${build_arch}-cross-linux-gnueabi"
> 			BUILD_PLATFORM="arm"
> 			CFLAGS_ARCH="-march=armv5te -mfloat-abi=soft -fomit-frame-pointer"
> +			RUSTFLAGS="-Ccodegen-units=1"
> 			;;
> 
> 		*)
> @@ -462,7 +463,7 @@ prepareenv() {
> 	# Setup environment
> 	set +h
> 	LC_ALL=POSIX
> -	export LFS LC_ALL CFLAGS CXXFLAGS DEFAULT_PARALLELISM
> +	export LFS LC_ALL CFLAGS CXXFLAGS DEFAULT_PARALLELISM RUSTFLAGS
> 	unset CC CXX CPP LD_LIBRARY_PATH LD_PRELOAD
> 
> 	# Make some extra directories
> @@ -547,6 +548,7 @@ enterchroot() {
> 		CONFIG_ROOT="${CONFIG_ROOT}" \
> 		CFLAGS="${CFLAGS} ${HARDENING_CFLAGS}" \
> 		CXXFLAGS="${CXXFLAGS} ${HARDENING_CFLAGS}" \
> +		RUSTFLAGS="${RUSTFLAGS}" \
> 		BUILDTARGET="${BUILDTARGET}" \
> 		CROSSTARGET="${CROSSTARGET}" \
> 		BUILD_ARCH="${BUILD_ARCH}" \
> -- 
> 2.20.1
>
  

Patch

diff --git a/make.sh b/make.sh
index 771c5ff89..2cdbe154a 100755
--- a/make.sh
+++ b/make.sh
@@ -174,6 +174,7 @@  configure_build() {
 			CROSSTARGET="${build_arch}-cross-linux-gnueabi"
 			BUILD_PLATFORM="arm"
 			CFLAGS_ARCH="-march=armv5te -mfloat-abi=soft -fomit-frame-pointer"
+			RUSTFLAGS="-Ccodegen-units=1"
 			;;
 
 		*)
@@ -462,7 +463,7 @@  prepareenv() {
 	# Setup environment
 	set +h
 	LC_ALL=POSIX
-	export LFS LC_ALL CFLAGS CXXFLAGS DEFAULT_PARALLELISM
+	export LFS LC_ALL CFLAGS CXXFLAGS DEFAULT_PARALLELISM RUSTFLAGS
 	unset CC CXX CPP LD_LIBRARY_PATH LD_PRELOAD
 
 	# Make some extra directories
@@ -547,6 +548,7 @@  enterchroot() {
 		CONFIG_ROOT="${CONFIG_ROOT}" \
 		CFLAGS="${CFLAGS} ${HARDENING_CFLAGS}" \
 		CXXFLAGS="${CXXFLAGS} ${HARDENING_CFLAGS}" \
+		RUSTFLAGS="${RUSTFLAGS}" \
 		BUILDTARGET="${BUILDTARGET}" \
 		CROSSTARGET="${CROSSTARGET}" \
 		BUILD_ARCH="${BUILD_ARCH}" \