mhz: respect CC and CFLAGS passed by buildsystem
authorRobert Marko <robimarko@gmail.com>
Sat, 2 Sep 2023 15:46:46 +0000 (17:46 +0200)
committerJosef Schlehofer <pepe.schlehofer@gmail.com>
Sun, 3 Sep 2023 08:43:57 +0000 (10:43 +0200)
commit6c28f46f37d35dce06c320d9ac7f256c113aea22
treea51ed9470a8f399684a0d0b747b1b3c4c0549474
parent635a702255e77b211c77e4a5bcd513abe6041721
mhz: respect CC and CFLAGS passed by buildsystem

It seems that the Makefile has both CC and CFLAGS hardcoded and does not
allow overriding them by ones being passed by the buildsystem.

This works fine until CONFIG_PKG_ASLR_PIE_ALL is selected, then building
will fail with:
arm-openwrt-linux-muslgnueabi/bin/ld.bfd: mhz.o: relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
arm-openwrt-linux-muslgnueabi/bin/ld.bfd: mhz.o(.text+0x75c): unresolvable R_ARM_CALL relocation against symbol `__aeabi_l2d@@GCC_3.5

So, lets add a patch pending upstream that allows both CC and CFLAGS to be
overriden so that ones passed by the buildsystem are actually respected.

Fixes: 89123b308f98 ("mhz: add new package")
Signed-off-by: Robert Marko <robimarko@gmail.com>
utils/mhz/Makefile
utils/mhz/patches/0001-Makefile-allow-overriding-CC-and-CFLAGS.patch [new file with mode: 0644]