-
Notifications
You must be signed in to change notification settings - Fork 91
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
faq: adds section about linkers errors when using linkers incompatibl… #163
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -214,6 +214,8 @@ curl_easy_setopt(curl_handle, CURLOPT_CAINFO, "/etc/pki/tls/certs/ca-bundle.crt" | |
- You can try hitting the non-TLS version of the endpoint if available. (Not Recommended). | ||
1. **No known conversion between `std::string` and `Aws::String`** | ||
- Either turn off custom memory management in the AWS C++ SDK or build it as a static library (`-DBUILD_SHARED_LIBS=OFF`) | ||
1. **I'm getting wierd linking errors like `/usr/bin/ld: /home/<...>bin/lib/libaws-lambda-runtime.a: error adding symbols: file format not recognized clang: error: linker command failed with exit code 1 (use -v to see invocation)`** | ||
- By default this project enables _link-time optimization (LTO)_ (configurable with `ENABLE_LTO` _cmake_ option). This tells compilers to delay optimizations until the linking phase. For some compilers (like _clang_) this means that each compilation unit should be compiled down only to intermediate representations (_e.g._ _clang_ uses _LLVM IR_) instead of directly to native object files. As a side-effect, library archives (like _aws-lambda-runtime_) would also contain only _IR_ code. This may result in linker errors like the above if you use a linker incompatible with the _IR_ code generated by your compiler (e.g. _GNU ld_ linker doesn't support _LLVM IR_). In order for the linking step to succeed with _LTO_ you must either use an appropriate linker with something like `-DCMAKE_CXX_FLAGS="-fuse-ld=lld"` (_GNU ld_ for _gcc_ and _lld_ for _clang_ are known to work) or disable _LTO_ (`-DENABLE_LTO=OFF`). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Moreover, I'd rather avoid making such claims on how the linker/compiler works because:
I think it's better to suggest turning off LTO and keep it succinct. That's assuming the problem exists, which I'm not yet sure is that case. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Totally agreeded. You're right. I'm gonna try to rephrase that tomorrow. This became too assertive. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure. Working on it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. The dockerfile is on the issue #151 |
||
|
||
## License | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hbobenicio can you fix this typo wierd -> weird.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woops :)
Nice catch!