]> Git Repo - uclibc-ng.git/commitdiff
sh: Add 64-bit time types from kernel
authorGeoffrey Le Gourriérec <[email protected]>
Tue, 26 Jan 2021 21:54:57 +0000 (22:54 +0100)
committerWaldemar Brodkorb <[email protected]>
Wed, 27 Jan 2021 04:33:39 +0000 (05:33 +0100)
Building uclibc 1.0.37 for SuperH architecture with linux-headers 5.10.7
fails at libpthread level due to missing time-related data structures,
usually defined by the kernel.

Define those missing data structures in SuperH-specific kernel_types.h.

Context: building for sh4eb-r2d[1] and sh4-r2d[1] boards emulations for
QEMU using the buildroot image generation tool.

Regarding the issue, a patch[3] was already issued in the kernel some
time ago, which aimed to solve precisely this problem. After coming up
with a quick and dirty patch for buildroot modifying Linux headers[4],
some discussion was sparked on the subject with Linux folks[5]. Some
analyzing later, conclusion was that:
1) Previously mentioned patch[4] was fixing the symptom, not the ill
2) SuperH-specific code in uclibc could be patched instead, to solve
   the problem for other use cases (e.g. building just a toolchain)

[1] https://git.buildroot.net/buildroot/tree/configs/qemu_sh4eb_r2d_defconfig?h=2020.02.9
[2] https://git.buildroot.net/buildroot/tree/configs/qemu_sh4_r2d_defconfig?h=2020.02.9
[3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fc94cf2092c7c1267fa2deb8388d624f50eba808
[4] https://git.buildroot.net/buildroot/commit/?id=742f37de8d0e3797698411dfc6a63bd7e98aafe2
[5] https://patchwork.kernel.org/project/linux-sh/patch/20210123165652[email protected]/

Signed-off-by: Geoffrey Le Gourriérec <[email protected]>
libc/sysdeps/linux/sh/bits/kernel_types.h

index ac97261e69b2594ea48330fe565bb6dacb917cdc..90b2e66b60a87b008fa664fe939c6794179b0457 100644 (file)
@@ -21,6 +21,7 @@ typedef unsigned int  __kernel_size_t;
 typedef int            __kernel_ssize_t;
 typedef int            __kernel_ptrdiff_t;
 typedef long           __kernel_time_t;
+typedef long long      __kernel_time64_t;
 typedef long           __kernel_suseconds_t;
 typedef long           __kernel_clock_t;
 typedef int            __kernel_daddr_t;
@@ -33,6 +34,7 @@ typedef unsigned short        __kernel_old_uid_t;
 typedef unsigned short __kernel_old_gid_t;
 typedef __kernel_dev_t __kernel_old_dev_t;
 typedef long           __kernel_long_t;
+typedef __kernel_long_t        __kernel_old_time_t;
 typedef unsigned long  __kernel_ulong_t;
 typedef long long      __kernel_loff_t;
 
This page took 0.027634 seconds and 4 git commands to generate.