mirror of https://github.com/thesofproject/sof.git
build: make builds reproducible.
Add a debug option to include build number, date and time into build. This will be disabled b default so that all builds are reproducible. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
This commit is contained in:
parent
b15b9f350f
commit
08236fcb46
|
@ -65,6 +65,12 @@ if test "x$with_meu" != "xno"; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#check if we should enable debug build
|
||||||
|
AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug],[enable debug, default: no])], enable_debug=$enableval, enable_debug=no)
|
||||||
|
if test "$enable_debug" = "yes"; then
|
||||||
|
AC_DEFINE([DEBUG_BUILD], [1], [Configure to build debug version])
|
||||||
|
fi
|
||||||
|
|
||||||
# check if we are building FW image or library
|
# check if we are building FW image or library
|
||||||
AC_ARG_ENABLE(library, [AS_HELP_STRING([--enable-library],[build library])], have_library=$enableval, have_library=no)
|
AC_ARG_ENABLE(library, [AS_HELP_STRING([--enable-library],[build library])], have_library=$enableval, have_library=no)
|
||||||
if test "$have_library" = "yes"; then
|
if test "$have_library" = "yes"; then
|
||||||
|
|
|
@ -1,13 +1,18 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
SUPPORTED_PLATFORMS=(byt cht bdw hsw apl cnl sue icl skl kbl)
|
SUPPORTED_PLATFORMS=(byt cht bdw hsw apl cnl sue icl skl kbl)
|
||||||
BUILD_RIMAGE=1
|
BUILD_RIMAGE=0
|
||||||
|
BUILD_DEBUG=no
|
||||||
|
|
||||||
pwd=`pwd`
|
pwd=`pwd`
|
||||||
|
|
||||||
if [ "$#" -eq 0 ]
|
if [ "$#" -eq 0 ]
|
||||||
then
|
then
|
||||||
PLATFORMS=${SUPPORTED_PLATFORMS[@]}
|
echo "usage: xtensa-build.sh [options] platform(s)"
|
||||||
|
echo " [-l] Build rimage locally"
|
||||||
|
echo " [-a] Build all platforms"
|
||||||
|
echo " [-d] Enable debug build"
|
||||||
|
echo " Supported platforms ${SUPPORTED_PLATFORMS[@]}"
|
||||||
else
|
else
|
||||||
# parse the args
|
# parse the args
|
||||||
for args in $@
|
for args in $@
|
||||||
|
@ -15,26 +20,18 @@ else
|
||||||
if [[ "$args" == "-l" ]]
|
if [[ "$args" == "-l" ]]
|
||||||
then
|
then
|
||||||
BUILD_LOCAL=1
|
BUILD_LOCAL=1
|
||||||
|
BUILD_RIMAGE=1
|
||||||
# build all images for chosen targets
|
|
||||||
if [ "$#" -eq 1 ]
|
|
||||||
then
|
|
||||||
PLATFORMS=${SUPPORTED_PLATFORMS[@]}
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
elif [[ "$args" == "-lr" ]]
|
|
||||||
then
|
|
||||||
BUILD_LOCAL=1
|
|
||||||
BUILD_RIMAGE=0
|
|
||||||
|
|
||||||
PATH=$pwd/local/bin:$PATH
|
PATH=$pwd/local/bin:$PATH
|
||||||
|
|
||||||
# build all images for chosen targets
|
elif [[ "$args" == "-d" ]]
|
||||||
if [ "$#" -eq 1 ]
|
|
||||||
then
|
then
|
||||||
PLATFORMS=${SUPPORTED_PLATFORMS[@]}
|
BUILD_DEBUG=yes
|
||||||
break
|
|
||||||
fi
|
# Build all platforms
|
||||||
|
elif [[ "$args" == "-a" ]]
|
||||||
|
then
|
||||||
|
PLATFORMS=${SUPPORTED_PLATFORMS[@]}
|
||||||
else
|
else
|
||||||
for i in ${SUPPORTED_PLATFORMS[@]}
|
for i in ${SUPPORTED_PLATFORMS[@]}
|
||||||
do
|
do
|
||||||
|
@ -47,8 +44,12 @@ else
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# check target platform(s) have been passed in
|
||||||
# now build the firmware (depends on rimage)
|
if [ ${#PLATFORMS[@]} -eq 0 ];
|
||||||
|
then
|
||||||
|
echo "Error: No platforms specified. Supported are: ${SUPPORTED_PLATFORMS[@]}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# fail on any errors
|
# fail on any errors
|
||||||
set -e
|
set -e
|
||||||
|
@ -213,8 +214,10 @@ do
|
||||||
# only delete binary related to this build
|
# only delete binary related to this build
|
||||||
rm -fr src/arch/xtensa/sof-$j.*
|
rm -fr src/arch/xtensa/sof-$j.*
|
||||||
|
|
||||||
./configure --with-arch=xtensa --with-platform=$PLATFORM --with-root-dir=$ROOT --host=$HOST \
|
./configure --with-arch=xtensa --with-platform=$PLATFORM \
|
||||||
CC=$XCC OBJCOPY=$XTOBJCOPY OBJDUMP=$XTOBJDUMP --with-dsp-core=$XTENSA_CORE
|
--with-root-dir=$ROOT --host=$HOST --enable-debug=$BUILD_DEBUG \
|
||||||
|
CC=$XCC OBJCOPY=$XTOBJCOPY OBJDUMP=$XTOBJDUMP \
|
||||||
|
--with-dsp-core=$XTENSA_CORE
|
||||||
|
|
||||||
make clean
|
make clean
|
||||||
make
|
make
|
||||||
|
|
|
@ -65,11 +65,14 @@ static const struct sof_ipc_fw_ready ready
|
||||||
},
|
},
|
||||||
/* dspbox is for DSP initiated IPC, hostbox is for host initiated IPC */
|
/* dspbox is for DSP initiated IPC, hostbox is for host initiated IPC */
|
||||||
.version = {
|
.version = {
|
||||||
.build = SOF_BUILD,
|
|
||||||
.minor = SOF_MINOR,
|
.minor = SOF_MINOR,
|
||||||
.major = SOF_MAJOR,
|
.major = SOF_MAJOR,
|
||||||
|
#ifdef DEBUG_BUILD
|
||||||
|
/* only added in debug for reproducability in releases */
|
||||||
|
.build = SOF_BUILD,
|
||||||
.date = __DATE__,
|
.date = __DATE__,
|
||||||
.time = __TIME__,
|
.time = __TIME__,
|
||||||
|
#endif
|
||||||
.tag = SOF_TAG,
|
.tag = SOF_TAG,
|
||||||
.abi_version = SOF_ABI_VERSION,
|
.abi_version = SOF_ABI_VERSION,
|
||||||
},
|
},
|
||||||
|
|
|
@ -64,11 +64,14 @@ static const struct sof_ipc_fw_ready ready
|
||||||
},
|
},
|
||||||
/* dspbox is for DSP initiated IPC, hostbox is for host initiated IPC */
|
/* dspbox is for DSP initiated IPC, hostbox is for host initiated IPC */
|
||||||
.version = {
|
.version = {
|
||||||
.build = SOF_BUILD,
|
|
||||||
.minor = SOF_MINOR,
|
.minor = SOF_MINOR,
|
||||||
.major = SOF_MAJOR,
|
.major = SOF_MAJOR,
|
||||||
|
#ifdef DEBUG_BUILD
|
||||||
|
/* only added in debug for reproducability in releases */
|
||||||
|
.build = SOF_BUILD,
|
||||||
.date = __DATE__,
|
.date = __DATE__,
|
||||||
.time = __TIME__,
|
.time = __TIME__,
|
||||||
|
#endif
|
||||||
.tag = SOF_TAG,
|
.tag = SOF_TAG,
|
||||||
.abi_version = SOF_ABI_VERSION,
|
.abi_version = SOF_ABI_VERSION,
|
||||||
},
|
},
|
||||||
|
|
|
@ -65,11 +65,14 @@ static const struct sof_ipc_fw_ready ready
|
||||||
.size = sizeof(struct sof_ipc_fw_ready),
|
.size = sizeof(struct sof_ipc_fw_ready),
|
||||||
},
|
},
|
||||||
.version = {
|
.version = {
|
||||||
.build = SOF_BUILD,
|
|
||||||
.minor = SOF_MINOR,
|
.minor = SOF_MINOR,
|
||||||
.major = SOF_MAJOR,
|
.major = SOF_MAJOR,
|
||||||
|
#ifdef DEBUG_BUILD
|
||||||
|
/* only added in debug for reproducability in releases */
|
||||||
|
.build = SOF_BUILD,
|
||||||
.date = __DATE__,
|
.date = __DATE__,
|
||||||
.time = __TIME__,
|
.time = __TIME__,
|
||||||
|
#endif
|
||||||
.tag = SOF_TAG,
|
.tag = SOF_TAG,
|
||||||
.abi_version = SOF_ABI_VERSION,
|
.abi_version = SOF_ABI_VERSION,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue