commit d1edce71135cc6d98c0a4b5729774542b676e769 Author: sophgo-forum-service <forum_service@sophgo.com> Date: Fri Mar 15 16:07:33 2024 +0800 [fix] recommend using ssh method to clone repo. [fix] fix sensor driver repo branch name.
28 lines
885 B
Bash
Executable File
28 lines
885 B
Bash
Executable File
#!/bin/bash
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
set -e
|
|
set -o pipefail
|
|
|
|
# To debug, uncomment the following line
|
|
# set -x
|
|
|
|
# -mprofile-kernel is only supported on 64le, so this should not be invoked
|
|
# for other targets. Therefore we can pass in -m64 and -mlittle-endian
|
|
# explicitly, to take care of toolchains defaulting to other targets.
|
|
|
|
# Test whether the compile option -mprofile-kernel exists and generates
|
|
# profiling code (ie. a call to _mcount()).
|
|
echo "int func() { return 0; }" | \
|
|
$* -m64 -mlittle-endian -S -x c -O2 -p -mprofile-kernel - -o - \
|
|
2> /dev/null | grep -q "_mcount"
|
|
|
|
# Test whether the notrace attribute correctly suppresses calls to _mcount().
|
|
|
|
echo -e "#include <linux/compiler.h>\nnotrace int func() { return 0; }" | \
|
|
$* -m64 -mlittle-endian -S -x c -O2 -p -mprofile-kernel - -o - \
|
|
2> /dev/null | grep -q "_mcount" && \
|
|
exit 1
|
|
|
|
exit 0
|