Build error strace 5.10 and openwrt 21

Hello all,

Despite my best efforts, I've encountered a hurdle while attempting to build OpenWRT 21 with kernel 5.4. Every attempt seems to culminate in a frustrating strace build error. Below, you'll find the traces of my build process. If you've encountered this error before and have insights to share, I would greatly appreciate your feedback and guidance



In file included from rtc.c:21:
xlat/rtc_vl_flags.h:8:37: error: expression in static assertion is not constant
 static_assert((RTC_VL_DATA_INVALID) == ((1 << 0)), "RTC_VL_DATA_INVALID != (1 << 0)");
               ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
xlat/rtc_vl_flags.h:15:35: error: expression in static assertion is not constant
 static_assert((RTC_VL_BACKUP_LOW) == ((1 << 1)), "RTC_VL_BACKUP_LOW != (1 << 1)");
               ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
xlat/rtc_vl_flags.h:22:37: error: expression in static assertion is not constant
 static_assert((RTC_VL_BACKUP_EMPTY) == ((1 << 2)), "RTC_VL_BACKUP_EMPTY != (1 << 2)");
               ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
xlat/rtc_vl_flags.h:29:37: error: expression in static assertion is not constant
 static_assert((RTC_VL_ACCURACY_LOW) == ((1 << 3)), "RTC_VL_ACCURACY_LOW != (1 << 3)");
               ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
xlat/rtc_vl_flags.h:36:38: error: expression in static assertion is not constant
 static_assert((RTC_VL_BACKUP_SWITCH) == ((1 << 4)), "RTC_VL_BACKUP_SWITCH != (1 << 4)");
               ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
In file included from defs.h:381,
                 from rtc.c:10:
xlat.h:64:24: error: initializer element is not constant
 # define XLAT(val)   { (unsigned)(val), #val }
                        ^
xlat/rtc_vl_flags.h:51:2: note: in expansion of macro 'XLAT'
  XLAT(RTC_VL_DATA_INVALID),
  ^~~~
xlat.h:64:24: note: (near initialization for 'rtc_vl_flags_xdata[0].val')
 # define XLAT(val)   { (unsigned)(val), #val }
                        ^
xlat/rtc_vl_flags.h:51:2: note: in expansion of macro 'XLAT'
  XLAT(RTC_VL_DATA_INVALID),
  ^~~~
xlat.h:64:24: error: initializer element is not constant
 # define XLAT(val)   { (unsigned)(val), #val }
                        ^
xlat/rtc_vl_flags.h:54:2: note: in expansion of macro 'XLAT'
  XLAT(RTC_VL_BACKUP_LOW),
  ^~~~
xlat.h:64:24: note: (near initialization for 'rtc_vl_flags_xdata[1].val')
 # define XLAT(val)   { (unsigned)(val), #val }
                        ^
xlat/rtc_vl_flags.h:54:2: note: in expansion of macro 'XLAT'
  XLAT(RTC_VL_BACKUP_LOW),
  ^~~~
xlat.h:64:24: error: initializer element is not constant
 # define XLAT(val)   { (unsigned)(val), #val }
                        ^
xlat/rtc_vl_flags.h:57:2: note: in expansion of macro 'XLAT'
  XLAT(RTC_VL_BACKUP_EMPTY),
  ^~~~
xlat.h:64:24: note: (near initialization for 'rtc_vl_flags_xdata[2].val')
 # define XLAT(val)   { (unsigned)(val), #val }
                        ^
xlat/rtc_vl_flags.h:57:2: note: in expansion of macro 'XLAT'
  XLAT(RTC_VL_BACKUP_EMPTY),
  ^~~~
xlat.h:64:24: error: initializer element is not constant
 # define XLAT(val)   { (unsigned)(val), #val }
                        ^
xlat/rtc_vl_flags.h:60:2: note: in expansion of macro 'XLAT'
  XLAT(RTC_VL_ACCURACY_LOW),
  ^~~~
xlat.h:64:24: note: (near initialization for 'rtc_vl_flags_xdata[3].val')
 # define XLAT(val)   { (unsigned)(val), #val }
                        ^
xlat/rtc_vl_flags.h:60:2: note: in expansion of macro 'XLAT'
  XLAT(RTC_VL_ACCURACY_LOW),
  ^~~~
xlat.h:64:24: error: initializer element is not constant
 # define XLAT(val)   { (unsigned)(val), #val }
                        ^
xlat/rtc_vl_flags.h:63:2: note: in expansion of macro 'XLAT'
  XLAT(RTC_VL_BACKUP_SWITCH),
  ^~~~
xlat.h:64:24: note: (near initialization for 'rtc_vl_flags_xdata[4].val')
 # define XLAT(val)   { (unsigned)(val), #val }
                        ^
xlat/rtc_vl_flags.h:63:2: note: in expansion of macro 'XLAT'
  XLAT(RTC_VL_BACKUP_SWITCH),
  ^~~~
In file included from rtc.c:21:
xlat/rtc_vl_flags.h:74:16: error: initializer element is not constant
  .flags_mask = 0
                ^
xlat/rtc_vl_flags.h:74:16: note: (near initialization for 'rtc_vl_flags[0].flags_mask')
make[7]: *** [Makefile:6394: libstrace_a-rtc.o] Error 1

Which distribution and version are you trying to build on? Even if 21.xx is not that old, you might want to try an operating system version from that era.

However, 21.x is unsupported now and you should try to upgrade.