Build failure for 2.26.4 on artful on arm/arm64

The latest upload of snapd to artful is failing to build on arm/arm64. The error on arm is:

/usr/bin/ld: /lib/arm-linux-gnueabihf/libapparmor.a(kernel.o): relocation R_ARM_THM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC

and on arm64:

/usr/bin/ld: /lib/aarch64-linux-gnu/libapparmor.a(kernel.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against external symbol `__stack_chk_guard@@GLIBC_2.17' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /lib/aarch64-linux-gnu/libapparmor.a(kernel.o)(.text+0x164): unresolvable R_AARCH64_ADR_PREL_PG_HI21 relocation against symbol `__stack_chk_guard@@GLIBC_2.17'
/usr/bin/ld: final link failed: Bad value

The error is slightly surprising because artful and zesty have the same gcc and similar versions of appamor. Plus snapd 2.26.1 (from 2017-05-12) build fine in artful. Given the changes between 2.26.1 and 2.26.4 are very small its mostly likely something external in artful that changed.

I think what’s happening is that the toolchain in armhf/arm64 is now enabling PIE by default. @sbeattie wrote up a wiki page of common build issues that crop up when PIE is enabled on a given platform. See the Relocation Linking Failure section here:

That section suggests that apparmor in artful simply needs a no-change rebuild due to the toolchain changes on armhf/arm64.

Yes, I agree with @tyhicks that it’s likely a no-change rebuild of apparmor would address this.

1 Like

@mvo feel free to upload a no-change rebuild of apparmor in artful to unblock the snapd build issue

Thanks! This is uploaded now.

1 Like