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

Fix compilation on macOS without apple-clang #8874

Merged
merged 2 commits into from
Mar 29, 2024

Conversation

stevenwdv
Copy link
Contributor

@stevenwdv stevenwdv commented Feb 29, 2024

Description

When installing llvm using homebrew (brew install llvm) and using that version instead of the normal Apple clang, llvm-ranlib (instead of Apple's version) complains that it doesn't know -no_warning_for_no_symbols.

This fix was taken from:
https://github.com/conan-io/conan-center-index/blob/76cc54bb433968dbcfc9e37d7c7ad927d701da95/recipes/libsvtav1/all/patches/llvm-clang-macos.patch#L11

Error log

[79/99] Linking C static library library/libmbedcrypto.a
FAILED: library/libmbedcrypto.a 
: && /usr/local/Cellar/cmake/3.28.3/bin/cmake -E rm -f library/libmbedcrypto.a && /usr/bin/ar Scr library/libmbedcrypto.a  library/CMakeFiles/mbedcrypto.dir/aes.c.o library/CMakeFiles/mbedcrypto.dir/aesni.c.o library/CMakeFiles/mbedcrypto.dir/arc4.c.o library/CMakeFiles/mbedcrypto.dir/aria.c.o library/CMakeFiles/mbedcrypto.dir/asn1parse.c.o library/CMakeFiles/mbedcrypto.dir/asn1write.c.o library/CMakeFiles/mbedcrypto.dir/base64.c.o library/CMakeFiles/mbedcrypto.dir/bignum.c.o library/CMakeFiles/mbedcrypto.dir/blowfish.c.o library/CMakeFiles/mbedcrypto.dir/camellia.c.o library/CMakeFiles/mbedcrypto.dir/ccm.c.o library/CMakeFiles/mbedcrypto.dir/chacha20.c.o library/CMakeFiles/mbedcrypto.dir/chachapoly.c.o library/CMakeFiles/mbedcrypto.dir/cipher.c.o library/CMakeFiles/mbedcrypto.dir/cipher_wrap.c.o library/CMakeFiles/mbedcrypto.dir/constant_time.c.o library/CMakeFiles/mbedcrypto.dir/cmac.c.o library/CMakeFiles/mbedcrypto.dir/ctr_drbg.c.o library/CMakeFiles/mbedcrypto.dir/des.c.o library/CMakeFiles/mbedcrypto.dir/dhm.c.o library/CMakeFiles/mbedcrypto.dir/ecdh.c.o library/CMakeFiles/mbedcrypto.dir/ecdsa.c.o library/CMakeFiles/mbedcrypto.dir/ecjpake.c.o library/CMakeFiles/mbedcrypto.dir/ecp.c.o library/CMakeFiles/mbedcrypto.dir/ecp_curves.c.o library/CMakeFiles/mbedcrypto.dir/entropy.c.o library/CMakeFiles/mbedcrypto.dir/entropy_poll.c.o library/CMakeFiles/mbedcrypto.dir/error.c.o library/CMakeFiles/mbedcrypto.dir/gcm.c.o library/CMakeFiles/mbedcrypto.dir/havege.c.o library/CMakeFiles/mbedcrypto.dir/hkdf.c.o library/CMakeFiles/mbedcrypto.dir/hmac_drbg.c.o library/CMakeFiles/mbedcrypto.dir/md.c.o library/CMakeFiles/mbedcrypto.dir/md2.c.o library/CMakeFiles/mbedcrypto.dir/md4.c.o library/CMakeFiles/mbedcrypto.dir/md5.c.o library/CMakeFiles/mbedcrypto.dir/memory_buffer_alloc.c.o library/CMakeFiles/mbedcrypto.dir/mps_reader.c.o library/CMakeFiles/mbedcrypto.dir/mps_trace.c.o library/CMakeFiles/mbedcrypto.dir/nist_kw.c.o library/CMakeFiles/mbedcrypto.dir/oid.c.o library/CMakeFiles/mbedcrypto.dir/padlock.c.o library/CMakeFiles/mbedcrypto.dir/pem.c.o library/CMakeFiles/mbedcrypto.dir/pk.c.o library/CMakeFiles/mbedcrypto.dir/pk_wrap.c.o library/CMakeFiles/mbedcrypto.dir/pkcs12.c.o library/CMakeFiles/mbedcrypto.dir/pkcs5.c.o library/CMakeFiles/mbedcrypto.dir/pkparse.c.o library/CMakeFiles/mbedcrypto.dir/pkwrite.c.o library/CMakeFiles/mbedcrypto.dir/platform.c.o library/CMakeFiles/mbedcrypto.dir/platform_util.c.o library/CMakeFiles/mbedcrypto.dir/poly1305.c.o library/CMakeFiles/mbedcrypto.dir/psa_crypto.c.o library/CMakeFiles/mbedcrypto.dir/psa_crypto_aead.c.o library/CMakeFiles/mbedcrypto.dir/psa_crypto_cipher.c.o library/CMakeFiles/mbedcrypto.dir/psa_crypto_client.c.o library/CMakeFiles/mbedcrypto.dir/psa_crypto_driver_wrappers.c.o library/CMakeFiles/mbedcrypto.dir/psa_crypto_ecp.c.o library/CMakeFiles/mbedcrypto.dir/psa_crypto_hash.c.o library/CMakeFiles/mbedcrypto.dir/psa_crypto_mac.c.o library/CMakeFiles/mbedcrypto.dir/psa_crypto_rsa.c.o library/CMakeFiles/mbedcrypto.dir/psa_crypto_se.c.o library/CMakeFiles/mbedcrypto.dir/psa_crypto_slot_management.c.o library/CMakeFiles/mbedcrypto.dir/psa_crypto_storage.c.o library/CMakeFiles/mbedcrypto.dir/psa_its_file.c.o library/CMakeFiles/mbedcrypto.dir/ripemd160.c.o library/CMakeFiles/mbedcrypto.dir/rsa.c.o library/CMakeFiles/mbedcrypto.dir/rsa_internal.c.o library/CMakeFiles/mbedcrypto.dir/sha1.c.o library/CMakeFiles/mbedcrypto.dir/sha256.c.o library/CMakeFiles/mbedcrypto.dir/sha512.c.o library/CMakeFiles/mbedcrypto.dir/threading.c.o library/CMakeFiles/mbedcrypto.dir/timing.c.o library/CMakeFiles/mbedcrypto.dir/version.c.o library/CMakeFiles/mbedcrypto.dir/version_features.c.o library/CMakeFiles/mbedcrypto.dir/xtea.c.o && /usr/local/opt/llvm/bin/llvm-ranlib -no_warning_for_no_symbols -c library/libmbedcrypto.a && /usr/local/Cellar/cmake/3.28.3/bin/cmake -E touch library/libmbedcrypto.a && :
/usr/local/opt/llvm/bin/llvm-ranlib: error: Invalid option: '-no_warning_for_no_symbols'

PR checklist

Please tick as appropriate and edit the reasons (e.g.: "backport: not needed because this is a new feature")

Signed-off-by: Steven WdV <swdv@cs.ru.nl>
@minosgalanakis minosgalanakis added needs-review Every commit must be reviewed by at least two team members, component-platform Portability layer and build scripts needs-ci Needs to pass CI tests needs-reviewer This PR needs someone to pick it up for review labels Mar 4, 2024
@minosgalanakis minosgalanakis added the priority-medium Medium priority - this can be reviewed as time permits label Mar 4, 2024
Signed-off-by: Steven WdV <swdv@cs.ru.nl>
@paul-elliott-arm paul-elliott-arm self-assigned this Mar 19, 2024
Copy link
Member

@paul-elliott-arm paul-elliott-arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@davidhorstmann-arm davidhorstmann-arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@paul-elliott-arm paul-elliott-arm added approved Design and code approved - may be waiting for CI or backports and removed needs-review Every commit must be reviewed by at least two team members, needs-ci Needs to pass CI tests needs-reviewer This PR needs someone to pick it up for review labels Mar 21, 2024
@paul-elliott-arm paul-elliott-arm added this pull request to the merge queue Mar 29, 2024
Merged via the queue into Mbed-TLS:development with commit 30978ec Mar 29, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Design and code approved - may be waiting for CI or backports component-platform Portability layer and build scripts priority-medium Medium priority - this can be reviewed as time permits
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants