Skip to content

Commit

Permalink
faq: adds section about linkers errors when using linkers incompatibl…
Browse files Browse the repository at this point in the history
…e with compilers. related awslabs#151
  • Loading branch information
hbobenicio committed Aug 29, 2022
1 parent 9dd0bdf commit bd9c85b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`).
## License
Expand Down

0 comments on commit bd9c85b

Please sign in to comment.