packages/utils/mhz/Makefile
Robert Marko 6c28f46f37 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: 89123b308f ("mhz: add new package")
Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-09-03 10:43:57 +02:00

33 lines
794 B
Makefile

include $(TOPDIR)/rules.mk
PKG_NAME:=mhz
PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=https://github.com/wtarreau/mhz.git
PKG_SOURCE_DATE:=2023-06-17
PKG_SOURCE_VERSION:=11aac2399780a1f7ea9f007b14af0464797d5cf1
PKG_MIRROR_HASH:=b3ea0c9e6f111755c4207addef0ea210ace86bc6910c959c6fc489026897676f
PKG_MAINTAINER:=Robert Marko <robimarko@gmail.com>
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
define Package/mhz
SECTION:=utils
CATEGORY:=Utilities
TITLE:=CPU frequency measurement utility
endef
define Package/mhz/description
Tool to mathematically calculate the current CPU frequency.
endef
define Package/mhz/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/mhz $(1)/usr/sbin/mhz
endef
$(eval $(call BuildPackage,mhz))