libboard.a is not generated by make export
Opened this issue · 3 comments
I encountered this issue while calling "make export" immediately after configuring my board application. It appears that "libboard.a" is not being built or copied to the destination folder before generating the export.
How to reproduce
P:➜ nuttx git:(master) ✗ tools/configure.sh -E -l xmc4700-relax:nsh
make: Entering directory '/home/trns1997/nuttxspace/nuttx'
make: Leaving directory '/home/trns1997/nuttxspace/nuttx'
Copy files
Select CONFIG_HOST_LINUX=y
Refreshing...
CP: arch/dummy/Kconfig to /home/trns1997/nuttxspace/nuttx/arch/dummy/dummy_kconfig
CP: boards/dummy/Kconfig to /home/trns1997/nuttxspace/nuttx/boards/dummy/dummy_kconfig
LN: platform/board to /home/trns1997/nuttxspace/apps/platform/dummy
LN: include/arch to arch/arm/include
LN: include/arch/board to /home/trns1997/nuttxspace/nuttx/boards/arm/xmc4/xmc4700-relax/include
LN: drivers/platform to /home/trns1997/nuttxspace/nuttx/drivers/dummy
LN: include/arch/chip to /home/trns1997/nuttxspace/nuttx/arch/arm/include/xmc4
LN: arch/arm/src/chip to /home/trns1997/nuttxspace/nuttx/arch/arm/src/xmc4
LN: arch/arm/src/board to /home/trns1997/nuttxspace/nuttx/boards/arm/xmc4/xmc4700-relax/src
mkkconfig in /home/trns1997/nuttxspace/apps/audioutils
mkkconfig in /home/trns1997/nuttxspace/apps/benchmarks
mkkconfig in /home/trns1997/nuttxspace/apps/boot
mkkconfig in /home/trns1997/nuttxspace/apps/canutils
mkkconfig in /home/trns1997/nuttxspace/apps/crypto
mkkconfig in /home/trns1997/nuttxspace/apps/examples/mcuboot
mkkconfig in /home/trns1997/nuttxspace/apps/examples
mkkconfig in /home/trns1997/nuttxspace/apps/fsutils
mkkconfig in /home/trns1997/nuttxspace/apps/games
mkkconfig in /home/trns1997/nuttxspace/apps/graphics
mkkconfig in /home/trns1997/nuttxspace/apps/industry
mkkconfig in /home/trns1997/nuttxspace/apps/interpreters/luamodules
mkkconfig in /home/trns1997/nuttxspace/apps/interpreters
mkkconfig in /home/trns1997/nuttxspace/apps/logging
mkkconfig in /home/trns1997/nuttxspace/apps/lte
mkkconfig in /home/trns1997/nuttxspace/apps/math
mkkconfig in /home/trns1997/nuttxspace/apps/mlearning
mkkconfig in /home/trns1997/nuttxspace/apps/netutils
mkkconfig in /home/trns1997/nuttxspace/apps/sdr
mkkconfig in /home/trns1997/nuttxspace/apps/system
mkkconfig in /home/trns1997/nuttxspace/apps/testing
mkkconfig in /home/trns1997/nuttxspace/apps/wireless/bluetooth
mkkconfig in /home/trns1997/nuttxspace/apps/wireless/ieee802154
mkkconfig in /home/trns1997/nuttxspace/apps/wireless
mkkconfig in /home/trns1997/nuttxspace/apps
Loaded configuration '.config'
Configuration saved to '.config'
P:➜ nuttx git:(master) ✗ make export
Create version.h
LN: platform/board to /home/trns1997/apps/platform/dummy
Register: nsh
Register: sh
Register: ramtest
Result
P:➜ nuttx git:(master) ✗ tar -xzf nuttx-export-12.2.1.tar.gz && ls nuttx-export-12.2.1/libs
libapps.a libarch.a libbinfmt.a libboards.a libc.a libdrivers.a libfs.a libmm.a libsched.a
libboard.a
is missing in the exported archive.
Current Work around
Call make
before calling make export
P:➜ nuttx git:(master) ✗ tools/configure.sh -E -l xmc4700-relax:nsh
make: Entering directory '/home/trns1997/nuttxspace/nuttx'
make: Leaving directory '/home/trns1997/nuttxspace/nuttx'
Copy files
Select CONFIG_HOST_LINUX=y
Refreshing...
CP: arch/dummy/Kconfig to /home/trns1997/nuttxspace/nuttx/arch/dummy/dummy_kconfig
CP: boards/dummy/Kconfig to /home/trns1997/nuttxspace/nuttx/boards/dummy/dummy_kconfig
LN: platform/board to /home/trns1997/nuttxspace/apps/platform/dummy
LN: include/arch to arch/arm/include
LN: include/arch/board to /home/trns1997/nuttxspace/nuttx/boards/arm/xmc4/xmc4700-relax/include
LN: drivers/platform to /home/trns1997/nuttxspace/nuttx/drivers/dummy
LN: include/arch/chip to /home/trns1997/nuttxspace/nuttx/arch/arm/include/xmc4
LN: arch/arm/src/chip to /home/trns1997/nuttxspace/nuttx/arch/arm/src/xmc4
LN: arch/arm/src/board to /home/trns1997/nuttxspace/nuttx/boards/arm/xmc4/xmc4700-relax/src
mkkconfig in /home/trns1997/nuttxspace/apps/audioutils
mkkconfig in /home/trns1997/nuttxspace/apps/benchmarks
mkkconfig in /home/trns1997/nuttxspace/apps/boot
mkkconfig in /home/trns1997/nuttxspace/apps/canutils
mkkconfig in /home/trns1997/nuttxspace/apps/crypto
mkkconfig in /home/trns1997/nuttxspace/apps/examples/mcuboot
mkkconfig in /home/trns1997/nuttxspace/apps/examples
mkkconfig in /home/trns1997/nuttxspace/apps/fsutils
mkkconfig in /home/trns1997/nuttxspace/apps/games
mkkconfig in /home/trns1997/nuttxspace/apps/graphics
mkkconfig in /home/trns1997/nuttxspace/apps/industry
mkkconfig in /home/trns1997/nuttxspace/apps/interpreters/luamodules
mkkconfig in /home/trns1997/nuttxspace/apps/interpreters
mkkconfig in /home/trns1997/nuttxspace/apps/logging
mkkconfig in /home/trns1997/nuttxspace/apps/lte
mkkconfig in /home/trns1997/nuttxspace/apps/math
mkkconfig in /home/trns1997/nuttxspace/apps/mlearning
mkkconfig in /home/trns1997/nuttxspace/apps/netutils
mkkconfig in /home/trns1997/nuttxspace/apps/sdr
mkkconfig in /home/trns1997/nuttxspace/apps/system
mkkconfig in /home/trns1997/nuttxspace/apps/testing
mkkconfig in /home/trns1997/nuttxspace/apps/wireless/bluetooth
mkkconfig in /home/trns1997/nuttxspace/apps/wireless/ieee802154
mkkconfig in /home/trns1997/nuttxspace/apps/wireless
mkkconfig in /home/trns1997/nuttxspace/apps
Loaded configuration '.config'
Configuration saved to '.config'
P:➜ nuttx git:(master) ✗ make && make export
Create version.h
LN: platform/board to /home/trns1997/apps/platform/dummy
Register: nsh
Register: sh
Register: ramtest
LD: nuttx
CP: nuttx.hex
CP: nuttx.bin
Result
P:➜ nuttx git:(master) ✗ tar -xzf nuttx-export-12.2.1.tar.gz && ls nuttx-export-12.2.1/libs
libapps.a libarch.a libbinfmt.a libboard.a libboards.a libc.a libdrivers.a libfs.a libmm.a libsched.a
As you can see the libboard.a
was correctly generated and packaged in the second case. I will investigate on my end to see what is causing the issue.
@xiaoxiang781216 do you have "make export" in the CI? I think it is important for some customers that aren't using the NuttX building system.
No, ci just invoke make now, it could be changed to "make export" and "make import".
After some investigation, I've identified the reason behind the absence of the libboard.a
packaging. The issue lies within the file tools/mkexport.sh
, specifically at line 354. This script checks for the existence of the libboard.a
file and packages it accordingly.
I looked into the makefiles and found that FlatLibs.mk
requires the CONFIG_ARCH_BOARD_COMMON
option to be set. This addition enables the inclusion of libboard
in the EXPORTLIBS
list. Consequently, I resolved this problem by setting the CONFIG_ARCH_BOARD_COMMON
flag within my board's defconfig
, effectively resolving the issue.
However, I have a query in relation to this matter:
-
Wouldn't it be prudent for all boards in the NuttX project to default to
CONFIG_ARCH_BOARD_COMMON=y
in their respectivedefconfig
files? Such an approach would enable immediate execution of apps on Board X. Should a user possess a custom board utilizing the same MCU, they could then deactivate this flag and furnish the necessary functions for their project's functionality. -
Regarding the behavior where calling
make
prior tomake export
results in the generation oflibboard.a
, leading to the successful discovery and packaging of the file by thetools/mkexport.sh
script: Is this intended behavior? It seems conceivable that a user might inadvertently executemake export
after generatinglibboard.a
, potentially leading to its inclusion in the export. This situation might not align with the intended behavior, especially if theCONFIG_ARCH_BOARD_COMMON
flag is deactivated.
My proposition would be maybe to consider invoking make clean
before make export
. This approach would ensure the export process incorporates the correct libraries, aligning with user expectations. Let me know what you guys think.