You are not logged in.

#1 2022-07-21 10:04:43

13905069
Member
From: China
Registered: 2022-04-21
Posts: 12

[SOLVED]Can't compile OSS(./include/linux/fortify-string.h)

I want to try OSS on my computer,so I run 'yay -S oss-git',it does well.However,when I run 'sudo soundon',here is output:

[MyComputer]# sudo soundon
Relinking OSS kernel modules for "5.18.12-arch1-1 SMP preempt mod_unload "
This may take few moments - please stand by...

OSS build environment set up for REGPARM kernels

Building module osscore
Failed to compile OSS
make -C /usr/lib/modules/5.18.12-arch1-1/build M=/usr/lib/oss/build modules
make[1]: Entering directory '/usr/lib/modules/5.18.12-arch1-1/build'
  CC [M]  /usr/lib/oss/build/osscore_lnk.o
/usr/lib/oss/build/osscore_lnk.c: In function ‘oss_get_time’:
/usr/lib/oss/build/osscore_lnk.c:95:10: warning: returning ‘time64_t (*)(void)’ {aka ‘long long int (*)(void)’} from a function with return type ‘oss_time_t’ {aka ‘long unsigned int’} makes integer from pointer without a cast [-Wint-conversion]
   95 |   return ktime_get_real_seconds;
      |          ^~~~~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/string.h:253,
                 from ./include/linux/bitmap.h:11,
                 from ./include/linux/cpumask.h:12,
                 from ./arch/x86/include/asm/cpumask.h:5,
                 from ./arch/x86/include/asm/msr.h:11,
                 from ./arch/x86/include/asm/processor.h:22,
                 from ./arch/x86/include/asm/timex.h:5,
                 from ./include/linux/timex.h:67,
                 from ./include/linux/time32.h:13,
                 from ./include/linux/time.h:60,
                 from ./include/linux/stat.h:19,
                 from ./include/linux/module.h:13,
                 from /usr/lib/oss/build/osscore_lnk.c:15:
/usr/lib/oss/build/osscore_lnk.c: At top level:
./include/linux/fortify-string.h:358:63: error: expected identifier or ‘(’ before ‘{’ token
  358 |                              p_size_field, q_size_field, op) ({         \
      |                                                               ^
./include/linux/fortify-string.h:373:27: note: in expansion of macro ‘__fortify_memcpy_chk’
  373 | #define memmove(p, q, s)  __fortify_memcpy_chk(p, q, s,                 \
      |                           ^~~~~~~~~~~~~~~~~~~~
/usr/lib/oss/build/osscore_lnk.c:141:7: note: in expansion of macro ‘memmove’
  141 | void *memmove(void *dest, const void *src, size_t n)
      |       ^~~~~~~
make[2]: *** [scripts/Makefile.build:288: /usr/lib/oss/build/osscore_lnk.o] Error 1
make[1]: *** [Makefile:1838: /usr/lib/oss/build] Error 2
make[1]: Leaving directory '/usr/lib/modules/5.18.12-arch1-1/build'
make: *** [Makefile:21: default] Error 2

Relinking the OSS kernel modules failed

I think it's a bug on the latest kernel,because I can compile OSS with Linux-lts successfully .I also found a similar issues but not the same kernel:#53
Any ideas?

Last edited by 13905069 (2022-07-22 03:07:15)

Offline

#2 2022-07-21 13:30:02

loqs
Member
Registered: 2014-03-06
Posts: 15,376

Re: [SOLVED]Can't compile OSS(./include/linux/fortify-string.h)

oss/setup/Linux/oss/build/osscore.c

oss_time_t
oss_get_time (void)
{
#ifdef _LINUX_TIMEKEEPING32_H
  return get_seconds ();
#else
  return ktime_get_real_seconds;
#endif
}

What if you replace

  return ktime_get_real_seconds;

with

  return ktime_get_real_seconds();

So the result of the function is returned rather than a pointer to the function.

Offline

#3 2022-07-21 15:13:03

13905069
Member
From: China
Registered: 2022-04-21
Posts: 12

Re: [SOLVED]Can't compile OSS(./include/linux/fortify-string.h)

loqs wrote:

oss/setup/Linux/oss/build/osscore.c

oss_time_t
oss_get_time (void)
{
#ifdef _LINUX_TIMEKEEPING32_H
  return get_seconds ();
#else
  return ktime_get_real_seconds;
#endif
}

What if you replace

  return ktime_get_real_seconds;

with

  return ktime_get_real_seconds();

So the result of the function is returned rather than a pointer to the function.

However,still can't:

Relinking OSS kernel modules for "5.18.12-arch1-1 SMP preempt mod_unload "
This may take few moments - please stand by...

OSS build environment set up for REGPARM kernels

Building module osscore
Failed to compile OSS
make -C /usr/lib/modules/5.18.12-arch1-1/build M=/usr/lib/oss/build modules
make[1]: Entering directory '/usr/lib/modules/5.18.12-arch1-1/build'
  CC [M]  /usr/lib/oss/build/osscore_lnk.o
In file included from ./include/linux/string.h:253,
                 from ./include/linux/bitmap.h:11,
                 from ./include/linux/cpumask.h:12,
                 from ./arch/x86/include/asm/cpumask.h:5,
                 from ./arch/x86/include/asm/msr.h:11,
                 from ./arch/x86/include/asm/processor.h:22,
                 from ./arch/x86/include/asm/timex.h:5,
                 from ./include/linux/timex.h:67,
                 from ./include/linux/time32.h:13,
                 from ./include/linux/time.h:60,
                 from ./include/linux/stat.h:19,
                 from ./include/linux/module.h:13,
                 from /usr/lib/oss/build/osscore_lnk.c:15:
./include/linux/fortify-string.h:358:63: error: expected identifier or ‘(’ before ‘{’ token
  358 |                              p_size_field, q_size_field, op) ({         \
      |                                                               ^
./include/linux/fortify-string.h:373:27: note: in expansion of macro ‘__fortify_memcpy_chk’
  373 | #define memmove(p, q, s)  __fortify_memcpy_chk(p, q, s,                 \
      |                           ^~~~~~~~~~~~~~~~~~~~
/usr/lib/oss/build/osscore_lnk.c:141:7: note: in expansion of macro ‘memmove’
  141 | void *memmove(void *dest, const void *src, size_t n)
      |       ^~~~~~~
make[2]: *** [scripts/Makefile.build:288: /usr/lib/oss/build/osscore_lnk.o] Error 1
make[1]: *** [Makefile:1838: /usr/lib/oss/build] Error 2
make[1]: Leaving directory '/usr/lib/modules/5.18.12-arch1-1/build'
make: *** [Makefile:21: default] Error 2

Offline

#4 2022-07-21 17:12:39

loqs
Member
Registered: 2014-03-06
Posts: 15,376

Re: [SOLVED]Can't compile OSS(./include/linux/fortify-string.h)

What if you delete the local implementation of memmove in oss/setup/Linux/oss/build/osscore.c

void *memmove(void *dest, const void *src, size_t n)
{
	return oss_memcpy(dest, src, n);
}

Offline

#5 2022-07-21 23:42:50

13905069
Member
From: China
Registered: 2022-04-21
Posts: 12

Re: [SOLVED]Can't compile OSS(./include/linux/fortify-string.h)

loqs wrote:

What if you delete the local implementation of memmove in oss/setup/Linux/oss/build/osscore.c

void *memmove(void *dest, const void *src, size_t n)
{
	return oss_memcpy(dest, src, n);
}

Now can compoile successfully.By the way,this time I did't replace

return ktime_get_real_seconds;

with

return ktime_get_real_seconds();

does it matter?Is this an OSS bug?(no error was reported this time)

Last edited by 13905069 (2022-07-21 23:43:44)

Offline

#6 2022-07-21 23:45:59

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 10,897
Website

Re: [SOLVED]Can't compile OSS(./include/linux/fortify-string.h)

Mod note: moving to AUR Issues


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

#7 2022-07-22 02:33:53

loqs
Member
Registered: 2014-03-06
Posts: 15,376

Re: [SOLVED]Can't compile OSS(./include/linux/fortify-string.h)

13905069 wrote:

Now can compoile successfully.By the way,this time I did't replace

return ktime_get_real_seconds;

with

return ktime_get_real_seconds();

does it matter?Is this an OSS bug?(no error was reported this time)

I suspect it is a bug as the related commit message is

Building osscore.ko will fail as the "get_seconds" function is no longer defined. The attached oss511fix.patch uses "ktime_get_real_seconds" instead when necessary.

the commit does not use ktime_get_real_seconds but returns a pointer to it.  If that does not cause any issues for you I would ignore it.

I suspect the clash between memmove defined in osscore.c and the macro defined in include/linux/fortify-string.h is another bug.

Offline

#8 2022-07-22 03:06:28

13905069
Member
From: China
Registered: 2022-04-21
Posts: 12

Re: [SOLVED]Can't compile OSS(./include/linux/fortify-string.h)

loqs wrote:
13905069 wrote:

Now can compoile successfully.By the way,this time I did't replace

return ktime_get_real_seconds;

with

return ktime_get_real_seconds();

does it matter?Is this an OSS bug?(no error was reported this time)

I suspect it is a bug as the related commit message is

Building osscore.ko will fail as the "get_seconds" function is no longer defined. The attached oss511fix.patch uses "ktime_get_real_seconds" instead when necessary.

the commit does not use ktime_get_real_seconds but returns a pointer to it.  If that does not cause any issues for you I would ignore it.

I suspect the clash between memmove defined in osscore.c and the macro defined in include/linux/fortify-string.h is another bug.

Thanks!

Offline

Board footer

Powered by FluxBB