Skip to content

Commit e1b2d5c

Browse files
committed
tests/cryptoauthlib: blacklist native boards
Native boards fail to link due to an upstream bug in cryptoauthlib's test infrastructure. The file build/pkg/cryptoauthlib/test/cmd-processor.c has incorrect conditional compilation logic: #if defined(_WIN32) || defined(__linux__) || defined(__APPLE__) int main(int argc, char* argv[]) { ... } #elif defined(RIOT_APPLICATION) int atca_run_cmd(char *command, size_t len) { ... } #endif On native boards, __linux__ is defined, so the code compiles a main() function instead of atca_run_cmd(). This conflicts with RIOT's main() and causes linker errors: - multiple definition of 'main' - undefined reference to 'atca_run_cmd' On ARM boards, none of these platform macros are defined, so the code correctly falls through to the RIOT_APPLICATION branch and compiles atca_run_cmd() instead. The fix would require patching cryptoauthlib to check RIOT_APPLICATION before checking platform macros, or reporting this upstream to Microchip. Signed-off-by: Gilles DOFFE <[email protected]>
1 parent 71a0dbc commit e1b2d5c

File tree

1 file changed

+7
-0
lines changed
  • tests/pkg/cryptoauthlib_internal-tests

1 file changed

+7
-0
lines changed

tests/pkg/cryptoauthlib_internal-tests/Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ CFLAGS += -DTHREAD_STACKSIZE_MAIN=\(3*THREAD_STACKSIZE_DEFAULT\)
88
# is also defined in board header files
99
BOARD_BLACKLIST := stk3200 stk3600 stk3700
1010

11+
# Native boards are blacklisted due to a bug in cryptoauthlib's cmd-processor.c
12+
# The file checks for __linux__ before checking for RIOT_APPLICATION, causing it
13+
# to compile a main() function instead of atca_run_cmd(), which conflicts with
14+
# RIOT's main(). This is an upstream bug in cryptoauthlib test infrastructure.
15+
# See: build/pkg/cryptoauthlib/test/cmd-processor.c lines 233-278
16+
BOARD_BLACKLIST += native native32 native64
17+
1118
# due to memory constrains we ignore the cert test
1219
CFLAGS += -DDO_NOT_TEST_CERT
1320
USEPKG += cryptoauthlib

0 commit comments

Comments
 (0)