Open sajattack opened 3 years ago
I would also recommend making the cortex-m dependency an optional dependency behind a feature flag.
So, I tried setting TARGET_CC
to clang
, and TARGET_CFLAGS
to specify a clang target that's compatible, but it looks like TARGET_CFLAGS
also get passed to gcc for linking. I wonder what others do here.
After lots of mucking about with cmake and c flags, I got all the mbedtls .a files built for mips. Now just a few functions missing when I try to link:
= note: rust-lld: error: undefined symbol: strncmp
>>> referenced by x509_create.c
>>> x509_create.c.obj:(mbedtls_x509_string_to_names) in archive ./library/libmbedx509.a
>>> referenced by x509_create.c
>>> x509_create.c.obj:(mbedtls_x509_string_to_names) in archive ./library/libmbedx509.a
>>> referenced by x509_create.c
>>> x509_create.c.obj:(mbedtls_x509_string_to_names) in archive ./library/libmbedx509.a
>>> referenced 21 more times
rust-lld: error: undefined symbol: strstr
>>> referenced by x509_crt.c
>>> x509_crt.c.obj:(mbedtls_x509_crt_parse) in archive ./library/libmbedx509.a
>>> referenced by pem.c
>>> pem.c.obj:(mbedtls_pem_read_buffer) in archive ./library/libmbedcrypto.a
>>> referenced by pem.c
>>> pem.c.obj:(mbedtls_pem_read_buffer) in archive ./library/libmbedcrypto.a
rust-lld: error: undefined symbol: strncpy
>>> referenced by x509write_crt.c
>>> x509write_crt.c.obj:(mbedtls_x509write_crt_set_validity) in archive ./library/libmbedx509.a
>>> referenced by x509write_crt.c
>>> x509write_crt.c.obj:(mbedtls_x509write_crt_set_validity) in archive ./library/libmbedx509.a
rust-lld: error: undefined symbol: strcmp
>>> referenced by cipher.c
>>> cipher.c.obj:(mbedtls_cipher_info_from_string) in archive ./library/libmbedcrypto.a
>>> referenced by ecp.c
>>> ecp.c.obj:(mbedtls_ecp_curve_info_from_name) in archive ./library/libmbedcrypto.a
>>> referenced by ecp.c
>>> ecp.c.obj:(mbedtls_ecp_curve_info_from_name) in archive ./library/libmbedcrypto.a
>>> referenced 20 more times
rust-lld: error: undefined symbol: rand
>>> referenced by rsa.c
>>> rsa.c.obj:(mbedtls_rsa_self_test) in archive ./library/libmbedcrypto.a
>>> referenced by rsa.c
>>> rsa.c.obj:(myrand) in archive ./library/libmbedcrypto.a
Could these be good candidates for inclusion in drogue-ffi-compat?
Hi, I'm working on getting this to compile for MIPS, specifically, mipsel-sony-psp :smile: I've encountered a couple issues, the first of which was
in the build.rs of drogue-tls-sys, which I commented out to get a bit further, resulting in the following linker error:
I did a bit more digging, namely, running
ar x
on the rlibs it mentioned, and thenfile
on the resulting .o, which let me know it was compiled for x86_64.Do I need to supply a MIPS-specific specs file or are the two issues unrelated? How can I tell it to compile for MIPS-2?