boostorg / boostorg/program_options
symbol visibility problem on macOS
- Ngôn ngữ chính
- C++
- Star
- 136
- Fork
- 117
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
When I compile with gcc-9, gcc-10, clang-9, clang-10 or the Xcode clang I have this problem. I do not see it under Linux (Ubuntu 18 LTS):
[BUG-REPORT.txt](https://github.com/boostorg/program_options/files/4944925/BUG-REPORT.txt)
I get linkage warnings that suggest possible runtime failure
ld: warning: direct access in function '__ZN5boost10wrapexceptINS_15program_options14unknown_optionEEC1ERKS3_' from file lib/libboost_program_options.a(options_description.o)' to global weak symbol '__ZTVN5boost15program_options5errorE' from file XXX means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
What's weird is that visibility should only apply to dynamic linkage, and I have built the libraries entirely statically.
I was able to get around this by building all of boost by supplying `cxxflags="-fvisibility=default"` to b2. Probably not the right fix but make the problem go away.
Probably incomplete list of symbols causing this problem. I do not have this issue with any other Boost library I use.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Bắt đầu với BUG-REPORT.txt và tái hiện static build trên macOS bằng các phiên bản GCC, Clang hoặc Xcode Clang được liệt kê. So sánh build khi có và không có b2's cxxflags="-fvisibility=default", đồng thời kiểm tra các cảnh báo của linker liên quan đến các symbol của program_options. Được xem là hoàn tất khi các cảnh báo về visibility được giải quyết mà không phụ thuộc vào workaround đó.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- cpp
- Lĩnh vực
- build-system, compilers
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 35/100