mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-25 07:34:05 -06:00
check-software-div: Add a new build check for software divide
Update the build checks to include a check for unexpected software divide operations. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
871637d3f2
commit
4e7fcc2704
2 changed files with 23 additions and 0 deletions
22
scripts/check-software-div.sh
Executable file
22
scripts/check-software-div.sh
Executable file
|
@ -0,0 +1,22 @@
|
||||||
|
#!/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
|
|
@ -56,6 +56,7 @@ for TARGET in test/configs/*.config ; do
|
||||||
make olddefconfig
|
make olddefconfig
|
||||||
make V=1
|
make V=1
|
||||||
size out/*.elf
|
size out/*.elf
|
||||||
|
./scripts/check-software-div.sh .config out/*.elf
|
||||||
finish_test mcu_compile "$TARGET"
|
finish_test mcu_compile "$TARGET"
|
||||||
cp out/klipper.dict ${DICTDIR}/$(basename ${TARGET} .config).dict
|
cp out/klipper.dict ${DICTDIR}/$(basename ${TARGET} .config).dict
|
||||||
done
|
done
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue