Re: arch/um/include/asm/Kbuild question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 12, 2021 at 3:18 PM Randy Dunlap <rdunlap@xxxxxxxxxxxxx> wrote:
>
> Hi.
>
> I thought that adding
> +generic-y += rwonce.h
>
> to arch/um/include/asm/Kbuild would fix a build problem:
>
>   CC [M]  fs/hostfs/hostfs_user.o
> In file included from ../include/asm-generic/div64.h:27,
>                  from ../fs/hostfs/hostfs_user.c:21:
> include/linux/compiler.h:248:10: fatal error: asm/rwonce.h: No such file or directory
>   248 | #include <asm/rwonce.h>
>       |          ^~~~~~~~~~~~~~
>
>
> but it doesn't seem to be helping.
> Do I need to use mandatory-y instead?
>
> Or is arch/um/ with ARCH=um and SUBARCH=i386 just "different"?


I see

  mandatory-y += rwonce.h

in include/asm-generic/Kbuild.


arch/x86/include/generated/asm/rwonce.h
is generated.


Is it still failing?



>
> The build error is:
> ERROR: modpost: "__divdi3" [fs/hostfs/hostfs.ko] undefined!
>
> and my current patch attempt is below
>
> Thanks.
>
> ---
> From: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
>
> <asm-generic/div64.h> wants rwonce.h, so add rwonce.h to the
> arch/um/include/asm/Kbuild generic-y list of header files.
>
> ERROR: modpost: "__divdi3" [fs/hostfs/hostfs.ko] undefined!
>
> Signed-off-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
> ---
>  arch/um/include/asm/Kbuild |    1 +
>  fs/hostfs/hostfs_user.c    |   13 +++++++++----
>  2 files changed, 10 insertions(+), 4 deletions(-)
>
> --- linux-next-20210511.orig/fs/hostfs/hostfs_user.c
> +++ linux-next-20210511/fs/hostfs/hostfs_user.c
> @@ -17,6 +17,7 @@
>  #include <sys/syscall.h>
>  #include "hostfs.h"
>  #include <utime.h>
> +#include <asm-generic/div64.h>
>
>  static void stat64_to_hostfs(const struct stat64 *buf, struct hostfs_stat *p)
>  {
> @@ -242,17 +243,21 @@ int set_attr(const char *file, struct ho
>                         return err;
>
>                 times[0].tv_sec = st.atime.tv_sec;
> -               times[0].tv_usec = st.atime.tv_nsec / 1000;
> +               times[0].tv_usec = st.atime.tv_nsec;
> +               do_div(times[0].tv_usec, 1000);
>                 times[1].tv_sec = st.mtime.tv_sec;
> -               times[1].tv_usec = st.mtime.tv_nsec / 1000;
> +               times[1].tv_usec = st.mtime.tv_nsec;
> +               do_div(times[1].tv_usec, 1000);
>
>                 if (attrs->ia_valid & HOSTFS_ATTR_ATIME_SET) {
>                         times[0].tv_sec = attrs->ia_atime.tv_sec;
> -                       times[0].tv_usec = attrs->ia_atime.tv_nsec / 1000;
> +                       times[0].tv_usec = attrs->ia_atime.tv_nsec;
> +                       do_div(times[0].tv_usec, 1000);
>                 }
>                 if (attrs->ia_valid & HOSTFS_ATTR_MTIME_SET) {
>                         times[1].tv_sec = attrs->ia_mtime.tv_sec;
> -                       times[1].tv_usec = attrs->ia_mtime.tv_nsec / 1000;
> +                       times[1].tv_usec = attrs->ia_mtime.tv_nsec;
> +                       do_div(times[1].tv_usec, 1000);
>                 }
>
>                 if (fd >= 0) {
> --- linux-next-20210511.orig/arch/um/include/asm/Kbuild
> +++ linux-next-20210511/arch/um/include/asm/Kbuild
> @@ -20,6 +20,7 @@ generic-y += param.h
>  generic-y += pci.h
>  generic-y += percpu.h
>  generic-y += preempt.h
> +generic-y += rwonce.h
>  generic-y += softirq_stack.h
>  generic-y += switch_to.h
>  generic-y += topology.h
>


-- 
Best Regards
Masahiro Yamada



[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux