Skip to content

Commit 50e9c67

Browse files
committed
scripts: Add a test case for Ubuntu 18.04 compiler error
Attempt to detect a bad build of Klipper and report an error. Signed-off-by: Kevin O'Connor <[email protected]>
1 parent 2a74ffd commit 50e9c67

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ $(OUT)compile_time_request.o: $(patsubst %.c, $(OUT)src/%.o.ctr,$(src-y)) ./scri
8686
$(OUT)klipper.elf: $(patsubst %.c, $(OUT)src/%.o,$(src-y)) $(OUT)compile_time_request.o
8787
@echo " Linking $@"
8888
$(Q)$(CC) $^ $(CFLAGS_klipper.elf) -o $@
89+
$(Q)scripts/check-gcc.sh $@ $(OUT)compile_time_request.o
8990

9091
################ Kconfig rules
9192

scripts/check-gcc.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/sh
2+
# This script checks for a broken Ubuntu 18.04 arm-none-eabi-gcc compile
3+
4+
f1="$1"
5+
f2="$2"
6+
7+
s1=`readelf -A "$f1" | grep "Tag_ARM_ISA_use"`
8+
s2=`readelf -A "$f2" | grep "Tag_ARM_ISA_use"`
9+
10+
if [ "$s1" != "$s2" ]; then
11+
echo ""
12+
echo "ERROR: The compiler failed to correctly compile Klipper"
13+
echo "It will be necessary to upgrade the compiler"
14+
echo "See: https://bugs.launchpad.net/ubuntu/+source/newlib/+bug/1767223"
15+
echo ""
16+
rm -f "$f1"
17+
exit 99
18+
fi

0 commit comments

Comments
 (0)