for one app, note it gets a -L..<target>/usr/lib.
(suspect this comes from pkg-config --libs for lua?)
ccache_cc plugin_tool.o modbus_support.o plugin_device_handler.o plugin_device_reader.o plugin_lua_functions.o utils.o constants.o -L/home/karlp/src/openwrt-git/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-8.4.0_musl_eabi/usr/lib -L/home/karlp/src/openwrt-git/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-8.4.0_musl_eabi/lib -znow -zrelro  -lm -ldl -luglylogging -lmodbus -L/home/karlp/src/openwrt-git/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/usr/lib -llua -lm  -L../../libs/dist64 -o plugin_tool


another app, _doesn't_ only has -L for the toolchain lib dirs?
ccache_cc main.o mbhelpers.o -L/home/karlp/src/openwrt-git/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-8.4.0_musl_eabi/usr/lib -L/home/karlp/src/openwrt-git/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-8.4.0_musl_eabi/lib -znow -zrelro  -luglylogging -lmodbus -L../../libs/dist64 -o modbus_debugger
../../libs/dist64/libuglylogging.so: file not recognized: file format not recognized

mips on 1907 passes the <target>/usr/lib path...
ccache_cc main.o mbhelpers.o -L/home/karlp/src/smartgate_firmware/owrt-1907/staging_dir/target-mips_24kc_musl/usr/lib -L/home/karlp/src/smartgate_firmware/owrt-1907/staging_dir/target-mips_24kc_musl/lib -L/home/karlp/src/smartgate_firmware/owrt-1907/staging_dir/toolchain-mips_24kc_gcc-7.5.0_musl/usr/lib -L/home/karlp/src/smartgate_firmware/owrt-1907/staging_dir/toolchain-mips_24kc_gcc-7.5.0_musl/lib -znow -zrelro  -luglylogging -lmodbus -L../../libs/dist64 -o modbus_debugger

and mips on master justt works around it?  (is the <target>/usr/lib implicit?)
ccache_cc main.o mbhelpers.o -L/home/karlp/src/smartgate_firmware/owrt-master/staging_dir/toolchain-mips_24kc_gcc-8.4.0_musl/usr/lib -L/home/karlp/src/smartgate_firmware/owrt-master/staging_dir/toolchain-mips_24kc_gcc-8.4.0_musl/lib -znow -zrelro  -luglylogging -lmodbus -L../../libs/dist64 -o modbus_debugger
/home/karlp/src/smartgate_firmware/owrt-master/staging_dir/toolchain-mips_24kc_gcc-8.4.0_musl/lib/gcc/mips-openwrt-linux-musl/8.4.0/../../../../mips-openwrt-linux-musl/bin/ld: skipping incompatible ../../libs/dist64/libuglylogging.so when searching for -luglylogging
rebuilding....