Build static px4 executable

I would like to make cross build, however, the exec running on target platform prints

./bin/px4: /lib/arm-linux-gnueabihf/libm.so.6: version `GLIBC_2.27’ not found (required by ./bin/px4)

I think all would be fine if only I could build px4 as a static executable. Unfortunately px4 build system seems to ignore flags

export CFLAGS=-static
export CXXFLAGS=-static

because result is still dynamic. How can I build static executable for beaglebone_blue_cross?