Aws Lambda: C++ custom runtime - /usr/bin/ld: cannot find /usr/lib64/libc_nonshared.a

Đang mở
#96 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
aws, cpp, linux
Lĩnh vực
build-system, cloud

Hướng nghiên cứu

Bắt đầu với lời gọi execl đã được báo cáo và các đường dẫn layer của AWS Lambda dưới /opt/gpp3, sau đó kiểm tra lý do linker tìm kiếm trong /usr/lib64 thay vì thư mục layer. Tái hiện lệnh g++48 và xác minh rằng libc_nonshared.a được resolve từ /opt/gpp3/usr/lib64; issue được hoàn tất khi việc biên dịch mẫu thành công trong môi trường Lambda.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
C++
Star
465
Fork
98
Merge trung bình
1 giờ 16 phút
Pull request đã merge (30 ngày)
2

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của awslabs/aws-lambda-cpp

Tất cả issue của awslabs/aws-lambda-cpp

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.