❗ Build Failure: BL2_BASE – "invalid suffix 'x' on integer constant"

I’m working on building the img for the LX2162A Clearfog board using the lx2160a_build setup.
https://github.com/SolidRun/lx2160a_build/blob/develop-lsdk-21.08/README.md
I’ve set the TARGET as LX2162A_SOM_CLEARFOG_18_9_0 and am running the build with the correct environment variables.

However, the build fails with the following compiler error:

plat/nxp/common/setup/ls_bl2_el3_setup.c: In function ‘ls_bl2_el3_plat_arch_setup’:
<command-line>: error: invalid suffix "x" on integer constant
plat/nxp/common/setup/ls_bl2_el3_setup.c:189:31: note: in expansion of macro ‘BL2_BASE’
  189 |                               BL2_BASE,
      |                               ^~~~~~~~
<command-line>: error: invalid suffix "x" on integer constant
plat/nxp/common/setup/ls_bl2_el3_setup.c:190:63: note: in expansion of macro ‘BL2_BASE’
  190 |                               (unsigned long)(&__BL2_END__) - BL2_BASE,
      |                                                               ^~~~~~~~

I’m building natively on the board (Ubuntu 22.04) using the runme.sh script.

./runme.sh SERDES=LX2162A_CLEARFOG_18_9_0

Any help or insight is appreciated.
Thanks!

Do you have the bc command installed on your build machine?

When it’s not installed, you get errors like the one you’re seeing above.

Alternatively, there is a pull request in the GitHub repository (#92) which patches the Makefiles so that they don’t require bc anymore.