Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MbedTLS tests fails to cross compile for arm cortex m33 #4530

Closed
maulik-arm opened this issue May 18, 2021 · 4 comments · Fixed by #4532
Closed

MbedTLS tests fails to cross compile for arm cortex m33 #4530

maulik-arm opened this issue May 18, 2021 · 4 comments · Fixed by #4532
Labels
bug component-platform Portability layer and build scripts

Comments

@maulik-arm
Copy link
Contributor

maulik-arm commented May 18, 2021


Description

  • Type: Bug
  • Priority: Minor

Bug

OS
Host : Linux

mbed TLS build:
Version: 2.26.0
OS version: 18.04
Configuration: please attach config.h file where possible
Added ns_mbedtls_config.h file which is passed for default configuration.
ns_mbedtls_config.h.gz

Compiler and options (if you used a pre-built binary, please indicate how you obtained it): arm-none-eabi-gcc (GNU Arm Embedded Toolchain 9-2020-q2-update) 9.3.1 20200408 (release)
Additional environment information:
Cross-compiling for arm mps2 an521

Expected behavior
While trying to cross-compile mbedtls for embedded mps2 an521 target on host Linux Ubuntu 18.04 machine, all test suites should compile at least.

Actual behavior
Compile error as mentioned below:
[ 44%] Building C object app/mbedtls226/tests/CMakeFiles/test_suite_ssl.dir/test_suite_ssl.o
arm-none-eabi-gcc -D_POSIX_C_SOURCE=200809L -I/mbedtls226/tests/include -I/mbedtls226/tests/../library -I/mbedtls226/include -mcpu=cortex-m33+nodsp -Wall -Wextra -Wwrite-strings -Wformat=2 -Wno-format-nonliteral -Wvla -Wlogical-op -Wshadow -Wformat-overflow=2 -Wformat-truncation=2 -Wno-unused-function -O2 --specs=nano.specs -Wall -Wno-format -Wno-return-type -Wno-unused-but-set-variable -c -fdata-sections -ffunction-sections -fno-builtin -fshort-enums -funsigned-char -mthumb -nostdlib -std=c99 -msoft-float -o CMakeFiles/test_suite_ssl.dir/test_suite_ssl.o -c /home/maupat01/workspace/ns-tls/3931/tf-m/build/app/mbedtls226/tests/test_suite_ssl.c
suites/host_test.function: In function 'convert_params':
suites/host_test.function:299:43: warning: passing argument 2 of 'get_expression' from incompatible pointer type [-Wincompatible-pointer-types]
299 | if ( get_expression ( exp_id, int_params_store ) == 0 )
| ^~~~~~~~~~~~~~~~
| |
| int *
suites/main_test.function:80:47: note: expected 'int32_t *' {aka 'long int *'} but argument is of type 'int *'
80 | int get_expression( int32_t exp_id, int32_t * out_value )

@gilles-peskine-arm gilles-peskine-arm added bug component-platform Portability layer and build scripts Product Backlog labels May 18, 2021
gilles-peskine-arm added a commit to gilles-peskine-arm/mbedtls that referenced this issue May 18, 2021
Fix a pointer mismatch when int32_t is not int, for example on Cortex-M where
in32_t is long int. Fix Mbed-TLS#4530

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
gilles-peskine-arm added a commit to gilles-peskine-arm/mbedtls that referenced this issue May 18, 2021
Fix a pointer mismatch when int32_t is not int, for example on Cortex-M where
in32_t is long int. Fix Mbed-TLS#4530

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
gilles-peskine-arm added a commit to gilles-peskine-arm/mbedtls that referenced this issue May 18, 2021
Fix a pointer mismatch when int32_t is not int, for example on Cortex-M where
in32_t is long int. Fix Mbed-TLS#4530

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
@gilles-peskine-arm
Copy link
Contributor

I've made a PR for a fix, which should get you further: after this, I expect a link failure. How to resolve the link failure depends on the platform you're building for. The test suites need several standard library functions, they don't run on bare metal.

@ronald-cron-arm
Copy link
Contributor

@maulik-arm Please confirm that #4532 fixes this issue.

@maulik-arm
Copy link
Contributor Author

Hi @gilles-peskine-arm , @ronald-cron-arm ,sorry for delayed reply. Yes, I confirm the patch does fixes the compiler warning. Thank you

@ronald-cron-arm
Copy link
Contributor

@maulik-arm thanks for the confirmation. Good to go then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug component-platform Portability layer and build scripts
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants