mirror of
https://github.com/andreili/klipper.git
synced 2025-08-23 11:24:06 +02:00
Update the build checks to include a check for unexpected software divide operations. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
23 lines
525 B
Bash
Executable File
23 lines
525 B
Bash
Executable File
#!/bin/bash
|
|
# Check if a binary appears to have a software library divide operator
|
|
|
|
CFGFILE="$1"
|
|
ELFOBJ="$2"
|
|
OBJDUMP=objdump
|
|
|
|
objdump -t ${ELFOBJ} | grep -Eq '\<(__[a-z0-9]*div|__[a-z0-9]*mod)'
|
|
if [ $? -eq 0 ]; then
|
|
|
|
if grep -Eq '^CONFIG_HAVE_SOFTWARE_DIVIDE_REQUIRED=y$' ${CFGFILE}; then
|
|
echo ""
|
|
echo "Software divide detected and that is normal for this chip"
|
|
echo ""
|
|
exit 0
|
|
fi
|
|
|
|
echo ""
|
|
echo "ERROR: A software run-time divide operation was found"
|
|
echo ""
|
|
exit 99
|
|
fi
|