Aws Lambda: C++ custom runtime - /usr/bin/ld: cannot find /usr/lib64/libc_nonshared.a
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- aws, cpp, linux
- Domain
- build-system, cloud
Research direction
Start with the reported execl invocation and the AWS Lambda layer paths under /opt/gpp3, then inspect why the linker searches /usr/lib64 instead of the layer directory. Reproduce the g++48 command and verify that libc_nonshared.a is resolved from /opt/gpp3/usr/lib64; the issue is done when the sample compilation succeeds in the Lambda environment.
Written by the indexing model from the issue text.
Description
I am trying to add g++ inside AWS Lambda C++ custom runtime.
Now g++ requires .so (shared libraries) files as well as .a (static libraries).
For this, I installed g++ inside chroot directory (directory gpp) on the Amazon Linux machine.
Now, I created another directory that has bin, usr, lib, and lib64 directories (taken from chroot directory). I created a zip of this directory, uploaded to s3 (as it is more than 50MB), and created a Lambda layer using this zip directory.
Now, after adding this layer in the lambda function, I am trying to run.
execl("/opt/usr/bin/g++48", "/opt/usr/bin/g++48", "-Wall", "/tmp/hello.cpp","-o", "/tmp/hello.o",
"-I/opt/gpp3/usr/include/", (char *) 0)
Using the above g++ is able to find shared libraries as well as header files but it is not able to find the static library.
/usr/bin/ld: cannot find /usr/lib64/libc_nonshared.a
collect2: error: ld returned 1 exit status
libc_nonshared.a exists inside /opt/gpp3/usr/lib64/ but it is searching in /usr/lib64/.
I tried providing full path in g++ command as -L/opt/gpp3/usr/lib64/libc_nonshared.a and
-L/opt/gpp3/usr/lib64/libc_nonshared and -L/opt/gpp3/usr/lib64/
But none of them works. Any help is deeply appreciated.
- Dominant language
- C++
- Stars
- 465
- Forks
- 98
- Avg merge
- 1h 16m
- Merged PRs (30d)
- 2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from awslabs/aws-lambda-cpp
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
awslabs/aws-lambda-cpp#205 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
awslabs/aws-lambda-cpp#196 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
awslabs/aws-lambda-cpp#195 · 11 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
awslabs/aws-lambda-cpp#194 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
awslabs/aws-lambda-cpp#188 ·
All issues in awslabs/aws-lambda-cpp
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·