From 9abf1ee695f16b9f16ee126d8593d10d21570019 Mon Sep 17 00:00:00 2001 From: Daniel Llewellyn Date: Mon, 26 Oct 2020 15:56:10 +0000 Subject: [PATCH] Update GCC Wrapper scripts for portable build The wrapper scripts incorrectly unwrapped arguments with spaces making them appear to be multiple individual arguments instead of one quoted argument. ref: https://github.com/OpenDroneMap/ODM/pull/1170#issuecomment-716607868 Signed-off-by: Daniel Llewellyn --- docker/g++ | 8 ++++---- docker/gcc | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docker/g++ b/docker/g++ index ffdb9a14..7a4a0a4a 100755 --- a/docker/g++ +++ b/docker/g++ @@ -1,12 +1,12 @@ #!/bin/bash -args="" +declare -a args for i in "$@" do - if [[ $i != -march* ]]; then - args="$args $i" + if [[ "$i" != -march* ]]; then + args+=("$i") fi done -/usr/bin/g++_real -march=nehalem $args +/usr/bin/g++_real -march=nehalem "${args[@]}" diff --git a/docker/gcc b/docker/gcc index c2d09701..70fb53d5 100755 --- a/docker/gcc +++ b/docker/gcc @@ -1,12 +1,12 @@ #!/bin/bash -args="" +declare -a args for i in "$@" do - if [[ $i != -march* ]]; then - args="$args $i" + if [[ "$i" != -march* ]]; then + args+=("$i") fi done -/usr/bin/gcc_real -march=nehalem $args +/usr/bin/gcc_real -march=nehalem "${args[@]}"