diff options
author | Michel Jaouen <michel.jaouen@st.com> | 2021-06-04 17:09:10 +0200 |
---|---|---|
committer | David Hu <david.hu@arm.com> | 2021-06-10 12:03:04 +0200 |
commit | 68cb2a6ffa14860fd630e5f3baa74c87f065da0d (patch) | |
tree | dea9caa4650256383aa2d3abdd1686970003fb92 /platform/ext | |
parent | 0c4ed5d815d7abadf5e0215600256bc839c5df2c (diff) | |
download | trusted-firmware-m-68cb2a6ffa14860fd630e5f3baa74c87f065da0d.tar.gz |
platform: stm: Extend compiler path to all compiler postbuild script
It extends and makes the path optional, to keep compatibility with
user using default compiler name
Change-Id: I848b93940ca40eba0fb19471acc472b4d7b18309
Signed-off-by: Michel Jaouen <michel.jaouen@st.com>
Diffstat (limited to 'platform/ext')
4 files changed, 26 insertions, 6 deletions
diff --git a/platform/ext/target/stm/common/stm32l5xx/boards/scripts/armclang/preprocess.sh b/platform/ext/target/stm/common/stm32l5xx/boards/scripts/armclang/preprocess.sh index a243bc2d8b..52aedc59ae 100644 --- a/platform/ext/target/stm/common/stm32l5xx/boards/scripts/armclang/preprocess.sh +++ b/platform/ext/target/stm/common/stm32l5xx/boards/scripts/armclang/preprocess.sh @@ -14,7 +14,14 @@ # arg1 is the build directory # arg2 is the file to preprocess # arg3 is output file beeing preprocessed +# arg4 is optional, it fixes compiler full path if present + function preprocess ( -armclang --target=arm-arm-none-eabi -march=armv8-m.main -E -P -xc -I$1 $2 -o $3 +local compiler=armclang +if [ $# -eq 4 ]; then + compiler=$4 +fi + +$compiler --target=arm-arm-none-eabi -march=armv8-m.main -E -P -xc -I$1 $2 -o $3 ) diff --git a/platform/ext/target/stm/common/stm32l5xx/boards/scripts/gcc/preprocess.sh b/platform/ext/target/stm/common/stm32l5xx/boards/scripts/gcc/preprocess.sh index 24d8b89db3..789d835258 100644 --- a/platform/ext/target/stm/common/stm32l5xx/boards/scripts/gcc/preprocess.sh +++ b/platform/ext/target/stm/common/stm32l5xx/boards/scripts/gcc/preprocess.sh @@ -16,9 +16,13 @@ # arg1 is the build directory # arg2 is the file to preprocess # arg3 is output file beeing preprocessed -# arg4 is the GCC compiler full path +# arg4 is optional, it fixes the GCC compiler full path if present function preprocess ( -$4 -E -P -xc -I$1 -o$3 $2 +local compiler=arm-none-eabi-gcc +if [ $# -eq 4 ]; then + compiler=$4 +fi +$compiler -E -P -xc -I$1 -o$3 $2 ) diff --git a/platform/ext/target/stm/common/stm32l5xx/boards/scripts/iar/preprocess.sh b/platform/ext/target/stm/common/stm32l5xx/boards/scripts/iar/preprocess.sh index c1ca468937..351607c782 100644 --- a/platform/ext/target/stm/common/stm32l5xx/boards/scripts/iar/preprocess.sh +++ b/platform/ext/target/stm/common/stm32l5xx/boards/scripts/iar/preprocess.sh @@ -14,7 +14,13 @@ # arg1 is the build directory # arg2 is the file to preprocess # arg3 is output file beeing preprocessed +# arg4 is optional, it fixes compiler full path if present + function preprocess ( -iccarm --cpu=Cortex-M33 -I$1 $2 --silent --preprocess=ns $3 +local compiler=iccarm +if [ $# -eq 4 ]; then + compiler=$4 +fi +$compiler --cpu=Cortex-M33 -I$1 $2 --silent --preprocess=ns $3 )
\ No newline at end of file diff --git a/platform/ext/target/stm/common/stm32l5xx/boards/scripts/postbuild.sh b/platform/ext/target/stm/common/stm32l5xx/boards/scripts/postbuild.sh index 6a8f856e3b..fa1ab69c14 100644 --- a/platform/ext/target/stm/common/stm32l5xx/boards/scripts/postbuild.sh +++ b/platform/ext/target/stm/common/stm32l5xx/boards/scripts/postbuild.sh @@ -14,14 +14,17 @@ # * opensource.org/licenses/BSD-3-Clause # * # ****************************************************************************** - +# arg1 is optional, it fixes compiler full path if present # Absolute path to this script SCRIPT=$(readlink -f $0) # Absolute path this script projectdir=`dirname $SCRIPT` source $projectdir/preprocess.sh # Compiler full name & path is passed as argument -compiler_full_path=$1 +compiler_full_path= +if [ $# -eq 1 ]; then + compiler_full_path=$1 +fi # the file to preprocess is generated and present outside of install dir bl2_file_to_preprocess=$projectdir/image_macros_to_preprocess_bl2.c preprocess_bl2_file=$projectdir/image_macros_preprocessed_bl2.c |