Skip to contentSkip to conversation

package/dhrystone: fix musl compilation issue

PATCH New Brendan Heading 2 participants 2 messages Sep 1, 2015 – Sep 13, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/dhrystone: fix musl compilation issue

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.

---
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(-)
package/dhrystone/0002-HZ.patch +6 -1
index e3b8a0e..9572b59 100644
@@ -2,6 +2,11 @@ Get HZ value from system rather than requiring via CPPFLAGS
 
 Patch by Robin Getz <[email protected]>
 
+Tweaked by Brendan Heading <[email protected]> - 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 <[email protected]>
  #endif
  
 +#ifndef HZ
-+#include <sys/param.h>
++#include <linux/param.h>
 +#endif
 +
  #define Mic_secs_Per_Second     1000000.0
Signature · 1 line
2.4.3
#1 lore raw

PATCH 1/1 package/dhrystone: fix musl compilation issue

Quoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Brendan" == Brendan Heading <[email protected]> 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.

Quoted 6 lines

---
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.

Signature · 1 line
Bye, Peter Korsgaard