Error "plugin needed to handle lto object" while building CPP runtime for Lambda

Open
#128 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
aws, cmake, cpp

Research direction

Start with the linked AWS C++ Lambda runtime blog post and reproduce the failure using the reported cmake3 configuration and make command. Use the linker output to investigate the LTO plugin and missing-symbol errors; done means the hello executable links successfully.

Written by the indexing model from the issue text.

Description

Following the blog post "https://aws.amazon.com/blogs/compute/introducing-the-c-lambda-runtime/" to create a custom CPP Lambda function, received an error "/usr/bin/ld: runtime.cpp.o: plugin needed to handle lto object"

Complete error -
[ 50%] Building CXX object CMakeFiles/hello.dir/main.cpp.o
[100%] Linking CXX executable hello
/usr/bin/ld: runtime.cpp.o: plugin needed to handle lto object
CMakeFiles/hello.dir/main.cpp.o: In function my_handler(aws::lambda_runtime::invocation_request const&)': main.cpp:(.text+0x3f): undefined reference to aws::lambda_runtime::invocation_response::success(std::string const&, std::string const&)'
CMakeFiles/hello.dir/main.cpp.o: In function main': main.cpp:(.text.startup+0x23): undefined reference to aws::lambda_runtime::run_handler(std::function<aws::lambda_runtime::invocation_response (aws::lambda_runtime::invocation_request const&)> const&)'
collect2: error: ld returned 1 exit status
make[2]: *** [hello] Error 1
make[1]: *** [CMakeFiles/hello.dir/all] Error 2
make: *** [all] Error 2

command executed
$ cmake3 .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=~/out ----> Successful
$ make 3 -----> Errors as above

Dominant language
C++
Stars
465
Forks
98
Avg merge
1h 16m
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from awslabs/aws-lambda-cpp

All issues in awslabs/aws-lambda-cpp

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.