PKCS11 cmake configuration giving build errors.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

PKCS11 cmake configuration giving build errors.

3,573 Views
ajitsj3
Contributor II

Hi,

 

I am getting the below mentioned error while doing cmake build in yocto for PKCS11 configuration.

| cc1: error: -Wformat-security ignored without -Wformat [-Werror=format-security]
| cc1: some warnings being treated as errors

 

I have pasted the log with the source code files as mentioned below.

| [128/340] ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc -DFTR_FILE_SYSTEM -DMBEDTLS_USER_CONFIG_FILE=\"sss_x86_mbedtls_config.h\" -DSSS_USE_FTR_FILE -DT1oI2C -Dmbedtls_EXPORTS -DmqttconfigENABLE_METRICS=0 -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/sss/port/default -I. -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/ext/mbedtls/include -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/ext/mbedtls/library -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/sss/plugin/mbedtls -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/sss/inc -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/hostlib/hostLib/libCommon/infra -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/hostlib/hostLib/inc -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/ext/mbedtls/port/ksdk -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/hostlib/hostLib/libCommon/log/. -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/hostlib/hostLib/libCommon/log/../../platform/inc -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/hostlib/hostLib/libCommon/log/../infra -march=armv7-a -mfpu=neon -mfloat-abi=hard -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0=/usr/src/debug/se05x-pkcs11/04.02.00-r0 -fdebug-prefix-map=~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0=/usr/src/debug/se05x-pkcs11/04.02.00-r0 -fdebug-prefix-map=~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot= -fdebug-prefix-map=~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native= -march=armv7-a -mfpu=neon -mfloat-abi=hard -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot -Wno-unused-result -fPIC -fPIC -DNDEBUG -fPIC -Wno-unused-function -Wno-error=pointer-sign -Wno-error=format -Wno-format -Wno-implicit-function-declaration -Wno-error=unused-const-variable -Wno-unused-const-variable -MD -MT ext/CMakeFiles/mbedtls.dir/mbedtls/library/ssl_tls.c.o -MF ext/CMakeFiles/mbedtls.dir/mbedtls/library/ssl_tls.c.o.d -o ext/CMakeFiles/mbedtls.dir/mbedtls/library/ssl_tls.c.o -c ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/ext/mbedtls/library/ssl_tls.c
| FAILED: ext/CMakeFiles/mbedtls.dir/mbedtls/library/ssl_tls.c.o
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc -DFTR_FILE_SYSTEM -DMBEDTLS_USER_CONFIG_FILE=\"sss_x86_mbedtls_config.h\" -DSSS_USE_FTR_FILE -DT1oI2C -Dmbedtls_EXPORTS -DmqttconfigENABLE_METRICS=0 -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/sss/port/default -I. -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/ext/mbedtls/include -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/ext/mbedtls/library -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/sss/plugin/mbedtls -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/sss/inc -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/hostlib/hostLib/libCommon/infra -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/hostlib/hostLib/inc -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/ext/mbedtls/port/ksdk -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/hostlib/hostLib/libCommon/log/. -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/hostlib/hostLib/libCommon/log/../../platform/inc -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/hostlib/hostLib/libCommon/log/../infra -march=armv7-a -mfpu=neon -mfloat-abi=hard -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0=/usr/src/debug/se05x-pkcs11/04.02.00-r0 -fdebug-prefix-map=~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0=/usr/src/debug/se05x-pkcs11/04.02.00-r0 -fdebug-prefix-map=~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot= -fdebug-prefix-map=~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native= -march=armv7-a -mfpu=neon -mfloat-abi=hard -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot -Wno-unused-result -fPIC -fPIC -DNDEBUG -fPIC -Wno-unused-function -Wno-error=pointer-sign -Wno-error=format -Wno-format -Wno-implicit-function-declaration -Wno-error=unused-const-variable -Wno-unused-const-variable -MD -MT ext/CMakeFiles/mbedtls.dir/mbedtls/library/ssl_tls.c.o -MF ext/CMakeFiles/mbedtls.dir/mbedtls/library/ssl_tls.c.o.d -o ext/CMakeFiles/mbedtls.dir/mbedtls/library/ssl_tls.c.o -c ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/ext/mbedtls/library/ssl_tls.c
| cc1: error: -Wformat-security ignored without -Wformat [-Werror=format-security]
| cc1: some warnings being treated as errors
| [129/340] ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc -DFTR_FILE_SYSTEM -DMBEDTLS -DMBEDTLS_USER_CONFIG_FILE=\"sss_x86_mbedtls_config.h\" -DPLATFORM_IMX -DSSS_USE_FTR_FILE -DT1oI2C -DmqttconfigENABLE_METRICS=0 -Dse05x_EXPORTS -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/sss/port/default -I. -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/hostlib/hostLib/se05x/../se05x_03_xx_xx -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/sss/ex/inc -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/sss/inc -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/hostlib/hostLib/se05x/../libCommon/nxScp -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/sss/port/x86 -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/hostlib/hostLib/libCommon/smCom -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/hostlib/hostLib/libCommon/infra -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/hostlib/hostLib/libCommon/../inc -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/hostlib/hostLib/libCommon/../platform/inc -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/hostlib/hostLib/libCommon/../tstUtil -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/hostlib/hostLib/libCommon/../accessManager/inc -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/hostlib/hostLib/libCommon/log -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/hostlib/hostLib/libCommon/smCom/T1oI2C -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/hostlib/hostLib/libCommon/log/. -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/hostlib/hostLib/libCommon/log/../../platform/inc -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/hostlib/hostLib/libCommon/log/../infra -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/ext/mbedtls/include -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/ext/mbedtls/library -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/sss/plugin/mbedtls -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/hostlib/hostLib/inc -I~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/ext/mbedtls/port/ksdk -march=armv7-a -mfpu=neon -mfloat-abi=hard -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0=/usr/src/debug/se05x-pkcs11/04.02.00-r0 -fdebug-prefix-map=~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0=/usr/src/debug/se05x-pkcs11/04.02.00-r0 -fdebug-prefix-map=~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot= -fdebug-prefix-map=~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native= -march=armv7-a -mfpu=neon -mfloat-abi=hard -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot -Wno-unused-result -fPIC -fPIC -DNDEBUG -fPIC -MD -MT hostlib/hostLib/se05x/CMakeFiles/se05x.dir/__/se05x_03_xx_xx/se05x_APDU.c.o -MF hostlib/hostLib/se05x/CMakeFiles/se05x.dir/__/se05x_03_xx_xx/se05x_APDU.c.o.d -o hostlib/hostLib/se05x/CMakeFiles/se05x.dir/__/se05x_03_xx_xx/se05x_APDU.c.o -c ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/simw-top/hostlib/hostLib/se05x_03_xx_xx/se05x_APDU.c

 

Please help me out in resolving this error.

 

Thanks and regards

Ajit S J

Labels (1)
0 Kudos
13 Replies

3,566 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @ajitsj3 ,

 

Are you using the latest MW? Is it possible to have your cmake options for a review? You may run "cmake . -L" in the building folder to have the cmake configuration.

 

Thanks for your patience!

 

Have a great day,
Kan


-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

3,563 Views
ajitsj3
Contributor II

@Kan_Li ,

 

We are using yocto platform to build the pkcs11 engine for se05x. Please find the Cmake configuration below.

-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${exec_prefix} \
-DPTMW_Host=iMXLinux \
-DIOT=None -DPTMW_Applet=SE05X_C -DPTMW_SE05X_Ver=06_00 \
-DOPENSSL_INSTALL_PREFIX=${RECIPE_SYSROOT}/${exec_prefix}/ \
-DOPENSSL_ROOT_DIR=${RECIPE_SYSROOT}/${exec_prefix}/ \
-DSSS_HAVE_LOG_SILENT=1 \

-DPTMW_HostCrypto=MBEDTLS \
-DPTMW_mbedTLS_ALT=SSS \
-DPTMW_RTOS=Default \
-DWithSharedLIB=ON \
-DPTMW_SMCOM=T1oI2C \
-DPTMW_SE05X_Auth=None \
-DPTMW_SCP=None \

And yes, we are using latest MW version "04.02.00"

 

Thanks and regards

Ajit

Tags (2)
0 Kudos

3,559 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @ajitsj3 ,

 

Thanks for the information! Actually IOT option is not used by the MW, maybe you modified somewhere in the MW, but anyway, I tried your configuration based on imx8M, but no such issue met. Please kindly refer to the following for details.

Kan_Li_0-1662452029562.png

My configuration is as below:

root@imx8mqevk:~/se05x_mw_v04.02.00_20220527_125816/simw-top_build/imx_native_se050_t1oi2c# cmake . -L
-- BUILD_TYPE: Release
-- Found: /usr/lib/libssl.so/usr/lib/libcrypto.so
-- CMAKE_CXX_COMPILER_ID = GNU
-- CMAKE_SYSTEM_NAME = Linux
-- PTMW_SE05X_Auth - None
-- Could not detect git directories. Using STUB Values for GIT Version
accessManager is not copied to default binary directory upon install
-- Configuring done
-- Generating done
-- Build files have been written to: /home/root/se05x_mw_v04.02.00_20220527_125816/simw-top_build/imx_native_se050_t1oi2c
-- Cache values
CMAKE_BUILD_TYPE:STRING=Release
CMAKE_INSTALL_PREFIX:PATH=/usr/local
LIB_ANL:FILEPATH=/usr/lib/libanl.so
NXPInternal:BOOL=OFF
OPENSSL_ROOT_DIR:PATH=
PAHO_BUILD_DEB_PACKAGE:BOOL=FALSE
PAHO_BUILD_DOCUMENTATION:BOOL=FALSE
PAHO_BUILD_SAMPLES:BOOL=FALSE
PAHO_BUILD_SHARED:BOOL=TRUE
PAHO_BUILD_STATIC:BOOL=FALSE
PAHO_ENABLE_CPACK:BOOL=TRUE
PAHO_ENABLE_TESTING:BOOL=FALSE
PAHO_WITH_SSL:BOOL=TRUE
PTMW_A71CH_AUTH:STRING=None
PTMW_Applet:STRING=SE05X_C
PTMW_FIPS:STRING=None
PTMW_Host:STRING=iMXLinux
PTMW_HostCrypto:STRING=MBEDTLS
PTMW_Log:STRING=Default
PTMW_RTOS:STRING=Default
PTMW_SBL:STRING=None
PTMW_SCP:STRING=None
PTMW_SE05X_Auth:STRING=None
PTMW_SE05X_Ver:STRING=06_00
PTMW_SMCOM:STRING=T1oI2C
PTMW_mbedTLS_ALT:STRING=SSS
SSSFTR_SE05X_AES:BOOL=ON
SSSFTR_SE05X_AuthECKey:BOOL=ON
SSSFTR_SE05X_AuthSession:BOOL=ON
SSSFTR_SE05X_CREATE_DELETE_CRYPTOOBJ:BOOL=ON
SSSFTR_SE05X_ECC:BOOL=ON
SSSFTR_SE05X_KEY_GET:BOOL=ON
SSSFTR_SE05X_KEY_SET:BOOL=ON
SSSFTR_SE05X_RSA:BOOL=ON
SSSFTR_SW_AES:BOOL=ON
SSSFTR_SW_ECC:BOOL=ON
SSSFTR_SW_KEY_GET:BOOL=ON
SSSFTR_SW_KEY_SET:BOOL=ON
SSSFTR_SW_RSA:BOOL=ON
SSSFTR_SW_TESTCOUNTERPART:BOOL=ON
WithAccessMgr_UnixSocket:BOOL=OFF
WithCodeCoverage:BOOL=OFF
WithExtCustomerTPMCode:BOOL=OFF
WithNXPNFCRdLib:BOOL=OFF
WithOPCUA_open62541:BOOL=OFF
WithSharedLIB:BOOL=ON

 

Maybe it is due to complier toolchain? gcc (GCC) 9.2.0 is used from here, what about yours?

 

Have a great day,
Kan


-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

3,551 Views
ajitsj3
Contributor II

Hi @Kan_Li ,

 

The GCC version that we are using is "8.3.0".

Is there a minimum GCC version requirement to build PKCS11?

Because we are able to build the accessManager and JRCPV1 clients and demos with the same "8.3.0" version of GCC. We are facing issue only for this pkcs11 configuration.

 

 

 

Thanks and regards,

Ajit S J

0 Kudos

3,543 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @ajitsj3 ,

 

I am sorry, but I have no info regarding this topic, while referring to the guide , only gcc 9.2 is mentioned,  maybe you can use it as a reference.

Kan_Li_0-1662690722706.png

 

Have a great day,
Kan


-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

3,526 Views
ajitsj3
Contributor II

@Kan_Li ,

We now have upgraded the GCC compiler version to "9.3.0". But we are still facing the same issue when we build in yocto. I request you to help us resolve this issue ASAP.

 

Thanks and regards,

Ajit S J

Tags (2)
0 Kudos

3,524 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hello @ajitsj3 ,

 

I have no idea about how you updated the GCC from your side, but I am sure the cross tool chain installed in Ubuntu can work well as expected. Please kindly refer to the following for details.

Kan_Li_0-1663049807928.png

arm-linux-gnueabihf-gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

 

You may install this under Ubuntu with the following instruction:

sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf

 

Please refer to https://www.acmesystems.it/arm9_toolchain for more details.

 

Hope that helps,

 

Have a great day,
Kan


-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

 

0 Kudos

3,520 Views
ajitsj3
Contributor II

@Kan_Li ,

 

We are not using ubuntu to cross-compile. We are using yocto build environment to build PKCS11. We upgraded the yocto build environment to get the latest gcc compiler. We have created a recipe for PKCS11 with the below mentioned configuration.

-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${exec_prefix} \
-DPTMW_Host=iMXLinux \
-DIOT=None -DPTMW_Applet=SE05X_C -DPTMW_SE05X_Ver=06_00 \
-DOPENSSL_INSTALL_PREFIX=${RECIPE_SYSROOT}/${exec_prefix}/ \
-DOPENSSL_ROOT_DIR=${RECIPE_SYSROOT}/${exec_prefix}/ \
-DSSS_HAVE_LOG_SILENT=1 \

-DPTMW_HostCrypto=MBEDTLS \
-DPTMW_mbedTLS_ALT=SSS \
-DPTMW_RTOS=Default \
-DWithSharedLIB=ON \
-DPTMW_SMCOM=T1oI2C \
-DPTMW_SE05X_Auth=None \
-DPTMW_SCP=None \

 

Is the configuration mentioned above correct? Or do we need to add anything else?

 

Thanks and regards

Ajit 

0 Kudos

3,513 Views
ajitsj3
Contributor II

I was able to resolve the "-Wformat-security" issue by adding the line "PRIVATE -Wno-error=format-security" to the file "ext/mbedtls.cmake".

I also added the configurations as mentioned by you. Now the updated configurations for pkcs11 is as mentioned below.

-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${exec_prefix} \
-DPTMW_Host=iMXLinux \
-DIOT=None -DPTMW_Applet=SE05X_C -DPTMW_SE05X_Ver=06_00 \
-DOPENSSL_INSTALL_PREFIX=${RECIPE_SYSROOT}${exec_prefix} \
-DOPENSSL_ROOT_DIR=${RECIPE_SYSROOT}${exec_prefix} \
-DSSS_HAVE_LOG_SILENT=1 \

-DPTMW_HostCrypto=MBEDTLS \
-DPTMW_mbedTLS_ALT=SSS \
-DPTMW_RTOS=Default \
-DWithSharedLIB=ON \
-DPTMW_SMCOM=T1oI2C \
-DPTMW_SE05X_Auth=None \
-DPTMW_SCP=None \
-DPAHO_BUILD_DEB_PACKAGE=OFF \
-DPAHO_BUILD_DOCUMENTATION=OFF \
-DPAHO_BUILD_SAMPLES=OFF \
-DPAHO_BUILD_SHARED=OFF \
-DPAHO_BUILD_STATIC=OFF \
-DPAHO_ENABLE_CPACK=ON \
-DPAHO_ENABLE_TESTING=OFF \
-DPAHO_WITH_SSL=ON \
-DSSSFTR_SE05X_AES=ON \
-DSSSFTR_SE05X_AuthECKey=ON \
-DSSSFTR_SE05X_AuthSession=ON \
-DSSSFTR_SE05X_CREATE_DELETE_CRYPTOOBJ=ON \
-DSSSFTR_SE05X_ECC=ON \
-DSSSFTR_SE05X_KEY_GET=ON \
-DSSSFTR_SE05X_KEY_SET=ON \
-DSSSFTR_SE05X_RSA=ON \
-DSSSFTR_SW_AES=ON \
-DSSSFTR_SW_ECC=ON \
-DSSSFTR_SW_KEY_GET=ON \
-DSSSFTR_SW_KEY_SET=ON \
-DSSSFTR_SW_RSA=ON \
-DSSSFTR_SW_TESTCOUNTERPART=ON \
-DWithAccessMgr_UnixSocket=OFF \
-DWithCodeCoverage=OFF \
-DWithExtCustomerTPMCode=OFF \
-DWithNXPNFCRdLib=OFF \
-DWithOPCUA_open62541=OFF \

Now we are getting undefined reference errors for function definitions. I have pasted a small snippet of the error log below.

| FAILED: bin/mbedtls_ex_orig_ssl_server2
| : && ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc -march=armv7-a -mfpu=neon -mfloat-abi=hard -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0=/usr/src/debug/se05x-pkcs11/04.02.00-r0 -fdebug-prefix-map=~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0=/usr/src/debug/se05x-pkcs11/04.02.00-r0 -fdebug-prefix-map=~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot= -fdebug-prefix-map=~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native= -march=armv7-a -mfpu=neon -mfloat-abi=hard -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot -Wno-unused-result -fPIC -fPIC -DNDEBUG -march=armv7-a -mfpu=neon -mfloat-abi=hard -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now sss/ex/mbedtls/CMakeFiles/mbedtls_ex_orig_ssl_server2.dir/__/__/__/ext/mbedtls/programs/ssl/ssl_server2.c.o sss/ex/mbedtls/CMakeFiles/mbedtls_ex_orig_ssl_server2.dir/__/__/__/ext/mbedtls/programs/test/query_config.c.o sss/ex/mbedtls/CMakeFiles/mbedtls_ex_orig_ssl_server2.dir/__/__/__/ext/mbedtls/tests/src/helpers.c.o sss/ex/mbedtls/CMakeFiles/mbedtls_ex_orig_ssl_server2.dir/__/__/__/ext/mbedtls/programs/ssl/ssl_test_lib.c.o -o bin/mbedtls_ex_orig_ssl_server2 -Wl,-rpath,"\$ORIGIN/../sss:\$ORIGIN/../hostlib/hostLib/se05x:\$ORIGIN/../hostlib/hostLib:\$ORIGIN/../hostlib/hostLib/libCommon:\$ORIGIN/../ext:\$ORIGIN/../hostlib/hostLib/libCommon/log" sss/libSSS_APIs.so hostlib/hostLib/se05x/libse05x.so hostlib/hostLib/liba7x_utils.so hostlib/hostLib/libCommon/libsmCom.so ext/libmbedtls.so hostlib/hostLib/libCommon/log/libmwlog.so ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot/usr/lib/libssl.so ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot/usr/lib/libcrypto.so -lpthread && cd ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/se05x-pkcs11-04.02.00/sss/ex/mbedtls && ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/cmake -E copy ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/se05x-pkcs11-04.02.00/bin/mbedtls_ex_orig_ssl_server2 ~/work/build/workspace/sources/se05x-pkcs11/tools
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `gecc_der_header_224k'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `gecc_der_header_nist192'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `gecc_der_header_bp384'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `der_ecc_224k_header_len'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `der_ecc_bp256_header_len'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `sss_asymmetric_verify_digest'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `sss_key_store_set_key'

I request you to help us resolve this issue ASAP.

Thanks and regards,

Ajit

0 Kudos

3,504 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @ajitsj3 ,

 

Actually I don't think adding the option "-Wno-error=format-security" solves this issue , it just ignores the error and let the building continue, but anyway, the new issue here is not relevant with this option, it looks like some kind of link issue, and as far as I know, some targets have to be built before building PKCS11 lib, such as SSS_APIs.

Kan_Li_0-1663060094139.png

Did you build these targets as well? and since you mentioned Yocto was used in the building, would you please clarify if you followed the steps listed in simw-top/doc/dev-platforms/platform_imx8_linux.html  and simw-top/doc/dev-platforms/platform_imx8_linux.html?highlight=cross#imx8-plugandtrust-recipe ?  Is it possible to share your recipe for a review?

 

Have a great day,
Kan


-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

 

0 Kudos

3,502 Views
ajitsj3
Contributor II

@Kan_Li ,

 

I was able to get rid of the "-Wformat-security" issue by adding the line "PRIVATE -Wno-error=format-security" in the file "ext/mbedtls.cmake".

 

Now I am getting undefined reference errors for some function definitions. I have attached the errors mentioned below.

 

| FAILED: bin/mbedtls_ex_orig_ssl_server2
| : && ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc -march=armv7-a -mfpu=neon -mfloat-abi=hard -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0=/usr/src/debug/se05x-pkcs11/04.02.00-r0 -fdebug-prefix-map=~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0=/usr/src/debug/se05x-pkcs11/04.02.00-r0 -fdebug-prefix-map=~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot= -fdebug-prefix-map=~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native= -march=armv7-a -mfpu=neon -mfloat-abi=hard -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot -Wno-unused-result -fPIC -fPIC -DNDEBUG -march=armv7-a -mfpu=neon -mfloat-abi=hard -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now sss/ex/mbedtls/CMakeFiles/mbedtls_ex_orig_ssl_server2.dir/__/__/__/ext/mbedtls/programs/ssl/ssl_server2.c.o sss/ex/mbedtls/CMakeFiles/mbedtls_ex_orig_ssl_server2.dir/__/__/__/ext/mbedtls/programs/test/query_config.c.o sss/ex/mbedtls/CMakeFiles/mbedtls_ex_orig_ssl_server2.dir/__/__/__/ext/mbedtls/tests/src/helpers.c.o sss/ex/mbedtls/CMakeFiles/mbedtls_ex_orig_ssl_server2.dir/__/__/__/ext/mbedtls/programs/ssl/ssl_test_lib.c.o -o bin/mbedtls_ex_orig_ssl_server2 -Wl,-rpath,"\$ORIGIN/../sss:\$ORIGIN/../hostlib/hostLib/se05x:\$ORIGIN/../hostlib/hostLib:\$ORIGIN/../hostlib/hostLib/libCommon:\$ORIGIN/../ext:\$ORIGIN/../hostlib/hostLib/libCommon/log" sss/libSSS_APIs.so hostlib/hostLib/se05x/libse05x.so hostlib/hostLib/liba7x_utils.so hostlib/hostLib/libCommon/libsmCom.so ext/libmbedtls.so hostlib/hostLib/libCommon/log/libmwlog.so ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot/usr/lib/libssl.so ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot/usr/lib/libcrypto.so -lpthread && cd ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/se05x-pkcs11-04.02.00/sss/ex/mbedtls && ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/cmake -E copy ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/se05x-pkcs11-04.02.00/bin/mbedtls_ex_orig_ssl_server2 ~/work/build/workspace/sources/se05x-pkcs11/tools
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `gecc_der_header_224k'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `gecc_der_header_nist192'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `gecc_der_header_bp384'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `der_ecc_224k_header_len'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `der_ecc_bp256_header_len'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `sss_asymmetric_verify_digest'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `sss_key_store_set_key'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `sss_derive_key_dh'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `gecc_der_header_256k'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `gecc_der_header_bp512'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `der_ecc_bp512_header_len'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `der_ecc_nistp256_header_len'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `sss_derive_key_context_init'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `gecc_der_header_mont_dh_25519'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `gecc_der_header_192k'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `gecc_der_header_nist384'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `sss_key_object_allocate_handle'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `der_ecc_256k_header_len'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `der_ecc_mont_dh_25519_header_len'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `sss_util_asn1_rsa_parse_public'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `gecc_der_header_mont_dh_448'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `der_ecc_nistp192_header_len'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `sss_key_store_get_key'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `der_ecc_192k_header_len'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `gecc_der_header_nist224'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `der_ecc_mont_dh_448_header_len'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `der_ecc_bp384_header_len'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `sss_util_asn1_get_oid_from_sssObj'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `gecc_der_header_nist256'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `sss_key_object_free'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `der_ecc_nistp521_header_len'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `sss_asymmetric_context_init'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `gecc_der_header_nist521'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `sss_asymmetric_sign_digest'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `sss_key_object_init'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `der_ecc_nistp384_header_len'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `der_ecc_nistp224_header_len'
| ~/work/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/se05x-pkcs11/04.02.00-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: ext/libmbedtls.so: undefined reference to `gecc_der_header_bp256'
| collect2: error: ld returned 1 exit status

 

I request you to help us resolve this issue.

 

Thanks and regards

Ajit

 

0 Kudos

1,863 Views
msalvinik
Contributor II

Hi @ajitsj3 @Kan_Li 

I'm building the SE050 middleware with PKCS#11 support, as ajitsj3. I have a Cmake configuration like the ajitsj3's one.

And I get the same "undefined reference" error during linking phase (after fixing the same compiling error about -Wno-error=format-security).

I'm using SE05x-MW v04.03.01 and GCC 11.3.0

Are there some updates about this issue?

Thanks in advance

 

[ 73%] Linking C executable ../../../bin/mbedtls_ex_orig_ssl_server2
/opt/toolchain//sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/ld: ../../../ext/libmbedtls.so: undefined reference to `gecc_der_header_224k'
/opt/toolchain//sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/ld: ../../../ext/libmbedtls.so: undefined reference to `gecc_der_header_nist192'
/opt/toolchain//sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/ld: ../../../ext/libmbedtls.so: undefined reference to `gecc_der_header_bp384'
/opt/toolchain//sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/ld: ../../../ext/libmbedtls.so: undefined reference to `der_ecc_224k_header_len'
/opt/toolchain//sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/ld: ../../../ext/libmbedtls.so: undefined reference to `der_ecc_bp256_header_len'
/opt/toolchain//sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/ld: ../../../ext/libmbedtls.so: undefined reference to `sss_asymmetric_verify_digest'
/opt/toolchain//sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/ld: ../../../ext/libmbedtls.so: undefined reference to `sss_key_store_set_key'
/opt/toolchain//sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/ld: ../../../ext/libmbedtls.so: undefined reference to `sss_derive_key_dh'
/opt/toolchain//sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/ld: ../../../ext/libmbedtls.so: undefined reference to `gecc_der_header_256k'
/opt/toolchain//sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/ld: ../../../ext/libmbedtls.so: undefined reference to `gecc_der_header_bp512'
/opt/toolchain//sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/ld: ../../../ext/libmbedtls.so: undefined reference to `der_ecc_bp512_header_len'
/opt/toolchain//sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/ld: ../../../ext/libmbedtls.so: undefined reference to `der_ecc_nistp256_header_len'
/opt/toolchain//sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/ld: ../../../ext/libmbedtls.so: undefined reference to `sss_derive_key_context_init'
/opt/toolchain//sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/ld: ../../../ext/libmbedtls.so: undefined reference to `gecc_der_header_mont_dh_25519'
/opt/toolchain//sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/ld: ../../../ext/libmbedtls.so: undefined reference to `gecc_der_header_192k'
/opt/toolchain//sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/ld: ../../../ext/libmbedtls.so: undefined reference to `gecc_der_header_nist384'
/opt/toolchain//sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/ld: ../../../ext/libmbedtls.so: undefined reference to `sss_key_object_allocate_handle'
/opt/toolchain//sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/ld: ../../../ext/libmbedtls.so: undefined reference to `der_ecc_256k_header_len'
/opt/toolchain//sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/ld: ../../../ext/libmbedtls.so: undefined reference to `der_ecc_mont_dh_25519_header_len'
/opt/toolchain//sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/ld: ../../../ext/libmbedtls.so: undefined reference to `gecc_der_header_mont_dh_448'
/opt/toolchain//sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/ld: ../../../ext/libmbedtls.so: undefined reference to `der_ecc_nistp192_header_len'
/opt/toolchain//sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/ld: ../../../ext/libmbedtls.so: undefined reference to `sss_key_store_get_key'
/opt/toolchain//sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/ld: ../../../ext/libmbedtls.so: undefined reference to `der_ecc_192k_header_len'
/opt/toolchain//sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/ld: ../../../ext/libmbedtls.so: undefined reference to `gecc_der_header_nist224'
/opt/toolchain//sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/ld: ../../../ext/libmbedtls.so: undefined reference to `der_ecc_mont_dh_448_header_len'
/opt/toolchain//sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/ld: ../../../ext/libmbedtls.so: undefined reference to `der_ecc_bp384_header_len'
/opt/toolchain//sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/ld: ../../../ext/libmbedtls.so: undefined reference to `sss_util_asn1_get_oid_from_sssObj'
/opt/toolchain//sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/ld: ../../../ext/libmbedtls.so: undefined reference to `gecc_der_header_nist256'
/opt/toolchain//sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/ld: ../../../ext/libmbedtls.so: undefined reference to `sss_key_object_free'
/opt/toolchain//sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/ld: ../../../ext/libmbedtls.so: undefined reference to `der_ecc_nistp521_header_len'
/opt/toolchain//sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/ld: ../../../ext/libmbedtls.so: undefined reference to `sss_asymmetric_context_init'
/opt/toolchain//sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/ld: ../../../ext/libmbedtls.so: undefined reference to `gecc_der_header_nist521'
/opt/toolchain//sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/ld: ../../../ext/libmbedtls.so: undefined reference to `sss_asymmetric_sign_digest'
/opt/toolchain//sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/ld: ../../../ext/libmbedtls.so: undefined reference to `sss_key_object_init'
/opt/toolchain//sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/ld: ../../../ext/libmbedtls.so: undefined reference to `der_ecc_nistp384_header_len'
/opt/toolchain//sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/ld: ../../../ext/libmbedtls.so: undefined reference to `der_ecc_nistp224_header_len'
/opt/toolchain//sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/11.3.0/ld: ../../../ext/libmbedtls.so: undefined reference to `gecc_der_header_bp256'
collect2: error: ld returned 1 exit status
gmake[2]: *** [sss/ex/mbedtls/CMakeFiles/mbedtls_ex_orig_ssl_server2.dir/build.make:153: bin/mbedtls_ex_orig_ssl_server2] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:1631: sss/ex/mbedtls/CMakeFiles/mbedtls_ex_orig_ssl_server2.dir/all] Error 2
gmake: *** [Makefile:156: all] Error 2

 

0 Kudos

1,771 Views
msalvinik
Contributor II

Replying to myself, and for reference, this is a working configuration for MW 04.03.01 to build pkcs#11 library for SE050C

CMAKE_BUILD_TYPE:STRING=Release
NXPInternal:BOOL=OFF
OPENSSL_ROOT_DIR:PATH=
PAHO_BUILD_DEB_PACKAGE:BOOL=FALSE
PAHO_BUILD_DOCUMENTATION:BOOL=FALSE
PAHO_BUILD_SAMPLES:BOOL=FALSE
PAHO_BUILD_SHARED:BOOL=FALSE
PAHO_BUILD_STATIC:BOOL=TRUE
PAHO_ENABLE_CPACK:BOOL=TRUE
PAHO_ENABLE_TESTING:BOOL=FALSE
PAHO_WITH_SSL:BOOL=TRUE
PTMW_A71CH_AUTH:STRING=None
PTMW_Applet:STRING=SE05X_C
PTMW_FIPS:STRING=None
PTMW_Host:STRING=iMXLinux
PTMW_HostCrypto:STRING=MBEDTLS
PTMW_Log:STRING=Default
PTMW_OpenSSL:STRING=3_0
PTMW_RTOS:STRING=Default
PTMW_SBL:STRING=None
PTMW_SCP:STRING=None
PTMW_SE05X_Auth:STRING=None
PTMW_SE05X_Ver:STRING=03_XX
PTMW_SMCOM:STRING=T1oI2C
PTMW_mbedTLS_ALT:STRING=None
SSSFTR_SE05X_AES:BOOL=ON
SSSFTR_SE05X_AuthECKey:BOOL=ON
SSSFTR_SE05X_AuthSession:BOOL=ON
SSSFTR_SE05X_CREATE_DELETE_CRYPTOOBJ:BOOL=ON
SSSFTR_SE05X_ECC:BOOL=ON
SSSFTR_SE05X_KEY_GET:BOOL=ON
SSSFTR_SE05X_KEY_SET:BOOL=ON
SSSFTR_SE05X_RSA:BOOL=ON
SSSFTR_SW_AES:BOOL=ON
SSSFTR_SW_ECC:BOOL=ON
SSSFTR_SW_KEY_GET:BOOL=ON
SSSFTR_SW_KEY_SET:BOOL=ON
SSSFTR_SW_RSA:BOOL=ON
SSSFTR_SW_TESTCOUNTERPART:BOOL=ON
WithAccessMgr_UnixSocket:BOOL=OFF
WithCodeCoverage:BOOL=OFF
WithExtCustomerTPMCode:BOOL=OFF
WithNXPNFCRdLib:BOOL=OFF
WithOPCUA_open62541:BOOL=OFF
WithSharedLIB:BOOL=ON

0 Kudos