-
Notifications
You must be signed in to change notification settings - Fork 53
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
aws-lc/crypto/err/err.c:186:17: error: implicit declaration of function ‘strdup’; #610
Comments
For context why I'm trying this: rust-lang/rustup#4094 |
Hello!
This looks like an error that occurs when the git submodules are not initialized. Are you building directly from the git repository? If so, you can initialize the submodules like this:
(The Makefile in the root of our repo has a useful target for this operation.) I'm not sure what else might cause an error like this. I don't think we have any tests setup specifically for Solaris. I might need to spin up a Solaris host to investigate. |
Thank you!
Now it fails like:
And if I rerun it I get undefined symbols as I reported here: rust-lang/rustup#4094 (comment) I will try to look at this closely next week.. |
This is interesting. The code it's complaining about is here. I didn't realize that strdup is not a C99 function, and has only officially been available since C23. 🤯 The proper way to use this in C99 code (assuming the compiler supports it at all) is apparently to define a macro prior to including "string.h". (I found this here: https://en.cppreference.com/w/c/experimental/dynamic/strdup)
As a workaround, you might be able to fix this by setting
I'm a little surprised that this issue had not been fixed previously. We'll take a look at what changes we need to make upstream for this. Thanks for the report! |
FYI -- I updated the title of the issue to indicate the problem that needs to be addressed. |
Oh.. I just looked through that output again. There were a couple more errors.
Note that the second one only affects a FIPS build. As our FIPS build has a lot of custom logic for MacOS/Linux/Windows, it's possible that our FIPS build will never succeed for a Solaris target. I would recommend not enabling the "fips" feature when building for Solaris. |
The Solaris man pages indicate that nanosleep should be available. It's defined in "time.h", which that source file includes. I'm wondering if some of these compile errors are specific to the AWS-LC-FIPS v2.0 module. (We will soon to releasing the v3.0 module, which should resolve a lot of failures for the FIPS build.) Would you try a non-FIPS build for Solaris to see whether you get the same errors? You can post any build errors that occur here if you'd like. Thanks! |
### Issues: Addresses: * aws/aws-lc-rs#610 ### Description of changes: `strdup` was only officially [added to libc in C23](https://en.cppreference.com/w/c/string/byte/strdup). Platforms we support may require the `__STDC_WANT_LIB_EXT2__` or `_POSIX_C_SOURCE` macros to be defined prior to the inclusion of the "string.h" header. ### Call-outs: * Reference: https://en.cppreference.com/w/c/experimental/dynamic/strdup By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.
Yes, I have in my ws:
For this one. I have so far:
I have few more fixes but |
For typical consumers of If you've cloned the aws-lc-rs git repo locally, then |
For this, you also need to setup macros that define |
I have created following pull request: aws/aws-lc#2035 This allows build on Solaris. With these changes FIPS module isn't build. |
Hello again! We just released aws-lc-rs v1.12.0. 🎉 We believe our latest release resolves the issue reported here. This issue will now be closed. If you continue to see this or other problems after upgrading, feel free to re-open this issue or open a new one. Thanks for your help in improving our library! |
Problem:
Build on Solaris fails:
rustc 1.82.0 (f6e511eec 2024-10-15) (built from a source tarball)
SunOS 5.11 11.4.78.184.0 i86pc i386 i86pc non-virtualized
The text was updated successfully, but these errors were encountered: