3.8: Beagle: merge Pantelis Antoniou's build fixes, to quite 0-day build reports

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>