Message ID | 1441111142-8561-1-git-send-email-brendanheading@gmail.com |
---|---|
State | Superseded, archived |
Headers | show |
>>>>> "Brendan" == Brendan Heading <brendanheading@gmail.com> writes: > Fixes: > http://autobuild.buildroot.net/results/1b6cb1b40431bf484db2d99bfdc8237cbae6a9d7/ > http://autobuild.buildroot.net/results/20e669d6e4bc3d872a355ef658ddad8f34676624/ > Include a more appropriate header file to pick up the definition of HZ > from the kernel headers. > Signed-off-by: Brendan Heading <brendanheading@gmail.com> > --- > v1 - This looks a bit hacky, but it seems to compile fine against > the uclibc, glibc and musl toolchain combos without any other packages > enabled. Comments welcome. Looking at the implementation I see we end up using the times(2) interface, which returns clock_t values. The kernel defines clock_t in terms of USER_HZ which is always 100 (see kernel/time/time.c::jiffies_to_clock_t()). So it is simpler to just pass -DHZ=100 to dhrystone. So I have committed a fix to do so instead, thanks.
diff --git a/package/dhrystone/0002-HZ.patch b/package/dhrystone/0002-HZ.patch index e3b8a0e..9572b59 100644 --- a/package/dhrystone/0002-HZ.patch +++ b/package/dhrystone/0002-HZ.patch @@ -2,6 +2,11 @@ Get HZ value from system rather than requiring via CPPFLAGS Patch by Robin Getz <rgetz@blackfin.uclinux.org> +Tweaked by Brendan Heading <brendanheading@gmail.com> - musl +doesn't define HZ within sys/param.h (and strictly speaking +it's not wise to depend on the glibc def either). Changed it +here to grab the kernel version. + --- a/dhry.h +++ b/dhry.h @@ -359,6 +359,10 @@ @@ -9,7 +14,7 @@ Patch by Robin Getz <rgetz@blackfin.uclinux.org> #endif +#ifndef HZ -+#include <sys/param.h> ++#include <linux/param.h> +#endif + #define Mic_secs_Per_Second 1000000.0
Fixes: http://autobuild.buildroot.net/results/1b6cb1b40431bf484db2d99bfdc8237cbae6a9d7/ http://autobuild.buildroot.net/results/20e669d6e4bc3d872a355ef658ddad8f34676624/ Include a more appropriate header file to pick up the definition of HZ from the kernel headers. Signed-off-by: Brendan Heading <brendanheading@gmail.com> --- v1 - This looks a bit hacky, but it seems to compile fine against the uclibc, glibc and musl toolchain combos without any other packages enabled. Comments welcome. --- package/dhrystone/0002-HZ.patch | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)