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

[Bug]: arm 32 bit compile error #2065

Open
3 tasks done
thomas-roos opened this issue Oct 22, 2024 · 2 comments
Open
3 tasks done

[Bug]: arm 32 bit compile error #2065

thomas-roos opened this issue Oct 22, 2024 · 2 comments
Labels
bug Something isn't working needs-triage v1.11.0

Comments

@thomas-roos
Copy link

Please confirm you have already done the following

  • I have searched the repository for related/existing bug reports
  • I have all the details the issue requires

Please answer the following prompt

  • This issue is replicable using the unmodified sample application

Describe the bug

error.txt

Expected Behavior

Same code (same libs etc) builds just fine with arm64.

Current Behavior

See compile error

Reproduction Steps

MACHINE=qemuarm bitbake amazon-kvs-webrtc-sdk

WebRTC C SDK version being used

1.11.0 / 30f52d1

If it was working in a previous version, which one?

No response

Compiler and Version used

arm-poky-linux-gnueabi-gcc (GCC) 14.2.0

Operating System and version

Ubuntu 22.04 / Yocto

Platform being used

Yocto

@thomas-roos thomas-roos added bug Something isn't working needs-triage labels Oct 22, 2024
@sirknightj
Copy link
Contributor

Could you share more some more details such as:

  • What CMake command and flags you're using or passing in (what's the libsrtp host and destination platforms set to?) (are you building with dependencies off?)
  • What is the error mentioned in your log causing it to stop?
  • Can you write some detailed steps for us to use the same toolchain and reproduce the issue you are seeing from a base Ubuntu image?

@thomas-roos
Copy link
Author

thomas-roos commented Nov 7, 2024

Had a discussion with Hassan (not bug related),but he gave me that pointers: "As you may know in the underlying PIC layer which webrtc c sdk is built on we have our own macros for everything like INT32, SIZE_T, etc. it is very likely the logic is unable to detect 32bit and map one of the macros correctly. This always results in issues like you're saying we call down to the lower level sctp library which expects the correct c types but our macro somehow got messed up, most likely ULONG is mapped to the wrong thing in PIC for your platform. If not that something similar."

Regards your questions:

  1. yes, see here: https://github.com/aws4embeddedlinux/meta-aws/blob/5b36c1a8c4c07a80c904508e77e8280395d2b30b/recipes-sdk/amazon-kvs-webrtc-sdk/amazon-kvs-webrtc-sdk_1.11.0.bb#L54

| FAILED: CMakeFiles/kvsWebrtcClient.dir/src/source/Sctp/Sctp.c.o | /home/ubuntu/data/yocto_master/build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/amazon-kvs-webrtc-sdk/1.11.0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc --sysroot=/home/ubuntu/data/yocto_master/build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/amazon-kvs-webrtc-sdk/1.11.0/recipe-sysroot -DCMAKE_DETECTED_CACERT_PATH -DDETECTED_GIT_HASH -DENABLE_AWS_SDK_IN_TESTS -DENABLE_DATA_CHANNEL -DKVS_CA_CERT_PATH=\"/home/ubuntu/data/yocto_master/build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/amazon-kvs-webrtc-sdk/1.11.0/git/certs/cert.pem\" -DKVS_USE_OPENSSL -DSDK_VERSION=\"30f52d18e647747de1ec29ad6f6d3f62128f5494\" -DVERSION_STRING=\"1.11.0\" -DkvsWebrtcClient_EXPORTS -I/home/ubuntu/data/yocto_master/build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/amazon-kvs-webrtc-sdk/1.11.0/git/open-source/include -I/home/ubuntu/data/yocto_master/build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/amazon-kvs-webrtc-sdk/1.11.0/git/src/include -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a15 -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=/home/ubuntu/data/yocto_master/build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/amazon-kvs-webrtc-sdk/1.11.0/recipe-sysroot -O2 -g -fcanon-prefix-map -fmacro-prefix-map=/home/ubuntu/data/yocto_master/build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/amazon-kvs-webrtc-sdk/1.11.0/git=/usr/src/debug/amazon-kvs-webrtc-sdk/1.11.0 -fdebug-prefix-map=/home/ubuntu/data/yocto_master/build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/amazon-kvs-webrtc-sdk/1.11.0/git=/usr/src/debug/amazon-kvs-webrtc-sdk/1.11.0 -fmacro-prefix-map=/home/ubuntu/data/yocto_master/build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/amazon-kvs-webrtc-sdk/1.11.0/build=/usr/src/debug/amazon-kvs-webrtc-sdk/1.11.0 -fdebug-prefix-map=/home/ubuntu/data/yocto_master/build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/amazon-kvs-webrtc-sdk/1.11.0/build=/usr/src/debug/amazon-kvs-webrtc-sdk/1.11.0 -fdebug-prefix-map=/home/ubuntu/data/yocto_master/build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/amazon-kvs-webrtc-sdk/1.11.0/recipe-sysroot= -fmacro-prefix-map=/home/ubuntu/data/yocto_master/build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/amazon-kvs-webrtc-sdk/1.11.0/recipe-sysroot= -fdebug-prefix-map=/home/ubuntu/data/yocto_master/build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/amazon-kvs-webrtc-sdk/1.11.0/recipe-sysroot-native= -fmacro-prefix-map=/home/ubuntu/data/yocto_master/build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/amazon-kvs-webrtc-sdk/1.11.0/recipe-sysroot-native= -pipe -Wl,-Bsymbolic -fPIC -g -fPIC -MD -MT CMakeFiles/kvsWebrtcClient.dir/src/source/Sctp/Sctp.c.o -MF CMakeFiles/kvsWebrtcClient.dir/src/source/Sctp/Sctp.c.o.d -o CMakeFiles/kvsWebrtcClient.dir/src/source/Sctp/Sctp.c.o -c /home/ubuntu/data/yocto_master/build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/amazon-kvs-webrtc-sdk/1.11.0/git/src/source/Sctp/Sctp.c | /home/ubuntu/data/yocto_master/build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/amazon-kvs-webrtc-sdk/1.11.0/git/src/source/Sctp/Sctp.c: In function 'initSctpSession': | /home/ubuntu/data/yocto_master/build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/amazon-kvs-webrtc-sdk/1.11.0/git/src/source/Sctp/Sctp.c:62:31: error: passing argument 2 of 'usrsctp_init_nothreads' from incompatible pointer type [-Wincompatible-pointer-types] | 62 | usrsctp_init_nothreads(0, &onSctpOutboundPacket, NULL); | | ^~~~~~~~~~~~~~~~~~~~~ | | | | | INT32 (*)(void *, void *, ULONG, UINT8, UINT8) {aka int (*)(void *, void *, long unsigned int, unsigned char, unsigned char)} | In file included from /home/ubuntu/data/yocto_master/build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/amazon-kvs-webrtc-sdk/1.11.0/git/src/source/Sctp/../Include_i.h:53, | from /home/ubuntu/data/yocto_master/build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/amazon-kvs-webrtc-sdk/1.11.0/git/src/source/Sctp/Sctp.c:2: | /home/ubuntu/data/yocto_master/build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/amazon-kvs-webrtc-sdk/1.11.0/recipe-sysroot/usr/include/usrsctp.h:905:24: note: expected 'int (*)(void *, void *, size_t, uint8_t, uint8_t)' {aka 'int (*)(void *, void *, unsigned int, unsigned char, unsigned char)'} but argument is of type 'INT32 (*)(void *, void *, ULONG, UINT8, UINT8)' {aka 'int (*)(void *, void *, long unsigned int, unsigned char, unsigned char)'} | 905 | int (*)(void *addr, void *buffer, size_t length, uint8_t tos, uint8_t set_df), | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | In file included from /home/ubuntu/data/yocto_master/build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/amazon-kvs-webrtc-sdk/1.11.0/recipe-sysroot/usr/include/com/amazonaws/kinesis/video/client/Include.h:13, | from /home/ubuntu/data/yocto_master/build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/amazon-kvs-webrtc-sdk/1.11.0/git/src/include/com/amazonaws/kinesis/video/webrtcclient/Include.h:20, | from /home/ubuntu/data/yocto_master/build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/amazon-kvs-webrtc-sdk/1.11.0/git/src/source/Sctp/../Include_i.h:27: | /home/ubuntu/data/yocto_master/build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/amazon-kvs-webrtc-sdk/1.11.0/git/src/source/Sctp/Sctp.c: In function 'createSctpSession': | /home/ubuntu/data/yocto_master/build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/amazon-kvs-webrtc-sdk/1.11.0/git/src/source/Sctp/Sctp.c:102:84: error: passing argument 4 of 'usrsctp_socket' from incompatible pointer type [-Wincompatible-pointer-types] | 102 | CHK((pSctpSession->socket = usrsctp_socket(AF_CONN, SOCK_STREAM, IPPROTO_SCTP, onSctpInboundPacket, NULL, 0, pSctpSession)) != NULL, | | ^~~~~~~~~~~~~~~~~~~ | | | | | INT32 (*)(struct socket *, union sctp_sockstore, void *, ULONG, struct sctp_rcvinfo, INT32, void *) {aka int (*)(struct socket *, union sctp_sockstore, void *, long unsigned int, struct sctp_rcvinfo, int, void *)} | /home/ubuntu/data/yocto_master/build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/amazon-kvs-webrtc-sdk/1.11.0/recipe-sysroot/usr/include/usrsctp.h:910:22: note: expected 'int (*)(struct socket *, union sctp_sockstore, void *, size_t, struct sctp_rcvinfo, int, void *)' {aka 'int (*)(struct socket *, union sctp_sockstore, void *, unsigned int, struct sctp_rcvinfo, int, void *)'} but argument is of type 'INT32 (*)(struct socket *, union sctp_sockstore, void *, ULONG, struct sctp_rcvinfo, INT32, void *)' {aka 'int (*)(struct socket *, union sctp_sockstore, void *, long unsigned int, struct sctp_rcvinfo, int, void *)'} | 910 | int (*receive_cb)(struct socket *sock, union sctp_sockstore addr, void *data, | | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 911 | size_t datalen, struct sctp_rcvinfo, int flags, void *ulp_info), | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | [3/18] /home/ubuntu/data/yocto_master/build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/amazon-kvs-webrtc-sdk/1.11.0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++ --sysroot=/home/ubuntu/data/yocto_master/build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/amazon-kvs-webrtc-sdk/1.11.0/recipe-sysroot -DAWS_AUTH_USE_IMPORT_EXPORT -DAWS_CAL_USE_IMPORT_EXPORT -DAWS_CHECKSUMS_USE_IMPORT_EXPORT -DAWS_COMMON_USE_IMPORT_EXPORT -DAWS_COMPRESSION_USE_IMPORT_EXPORT -DAWS_CRT_CPP_USE_IMPORT_EXPORT -DAWS_EVENT_STREAM_USE_IMPORT_EXPORT -DAWS_HTTP_USE_IMPORT_EXPORT -DAWS_IO_USE_IMPORT_EXPORT -DAWS_MQTT_USE_IMPORT_EXPORT -DAWS_S3_USE_IMPORT_EXPORT -DAWS_SDKUTILS_USE_IMPORT_EXPORT -DAWS_SDK_VERSION_MAJOR=1 -DAWS_SDK_VERSION_MINOR=11 -DAWS_SDK_VERSION_PATCH=431 -DAWS_USE_EPOLL -DCMAKE_DETECTED_CACERT_PATH -DDETECTED_GIT_HASH -DENABLE_AWS_SDK_IN_TESTS -DENABLE_DATA_CHANNEL -DINSTRUMENTED_ALLOCATORS -DKVS_CA_CERT_PATH=\"/home/ubuntu/data/yocto_master/build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/amazon-kvs-webrtc-sdk/1.11.0/git/certs/cert.pem\" -DKVS_USE_OPENSSL -DSDK_VERSION=\"30f52d18e647747de1ec29ad6f6d3f62128f5494\" -DUSE_IMPORT_EXPORT=1 -DVER

  1. Easiest would be following what we do in our CI (https://github.com/aws4embeddedlinux/meta-aws/blob/master/.github/workflows/build-test-recipe.yml):
mkdir yocto_master
cd yocto_master/
git clone git://git.yoctoproject.org/poky 
git clone https://github.com/aws4embeddedlinux/meta-aws.git
git clone https://github.com/openembedded/meta-openembedded.git
source poky/oe-init-build-env build
bitbake-layers add-layer ../meta-openembedded/meta-oe
bitbake-layers add-layer ../meta-openembedded/meta-python
bitbake-layers add-layer ../meta-openembedded/meta-multimedia
bitbake-layers add-layer ../meta-openembedded/meta-networking
bitbake-layers add-layer ../meta-aws
MACHINE=qemuarm bitbake amazon-kvs-webrtc-sdk

That are the requirements on the Ubuntu.
https://docs.yoctoproject.org/brief-yoctoprojectqs/index.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage v1.11.0
Projects
None yet
Development

No branches or pull requests

2 participants