[BUG] Google benchmark doesn't compile on Solaris
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 30/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- cpp
- Lĩnh vực
- build-system, operating-systems
Hướng nghiên cứu
Bắt đầu với src/sysinfo.cc và test/benchmark_setup_teardown_test.cc, sau đó tái tạo bản build Solaris 11.4 bằng lệnh CMake và make được báo cáo. Kiểm tra các chẩn đoán liên quan đến hostname, sysconf, namespace và kstat được mô tả trong issue. Hoàn thành có nghĩa là dự án biên dịch sạch trên Solaris với các toolchain GCC và LLVM được báo cáo.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
benchmark doesn't compile on Solaris 11.4 (neither upstream nor the downstream copies in LLVM).
System
- OS: Solaris 11.4
- Compiler and version: GCC 12.1.0 and LLVM 15.0.0
To reproduce
2. cmake -DCMAKE_BUILD_TYPE=Release -DBENCHMARK_DOWNLOAD_DEPENDENCIES=on <srcdir>
4. make
/vol/llvm/src/llvm-project/benchmark/benchmark.git/src/sysinfo.cc: In function ‘std::string benchmark::{anonymous}::GetSystemName()’:
/vol/llvm/src/llvm-project/benchmark/benchmark.git/src/sysinfo.cc:446:54: note: ‘#pragma message: HOST_NAME_MAX not defined. using 64’
446 | #pragma message("HOST_NAME_MAX not defined. using 64")
|
/vol/llvm/src/llvm-project/benchmark/benchmark.git/test/benchmark_setup_teardown_test.cc:13:11: error: ‘namespace single { }’ redeclared as different kind of entity
13 | namespace single {
| ^~~~~~
In file included from /usr/gcc/12/lib/gcc/x86_64-pc-solaris2.11/12.1.0/include-fixed/math.h:391,
from /usr/gcc/12/include/c++/12.1.0/bits/std_abs.h:40,
from /usr/gcc/12/include/c++/12.1.0/cstdlib:77,
from /vol/llvm/src/llvm-project/benchmark/benchmark.git/test/benchmark_setup_teardown_test.cc:3:
/usr/include/floatingpoint.h:69:15: note: previous declaration ‘typedef float single’
69 | typedef float single;
| ^~~~~~
/vol/llvm/src/llvm-project/benchmark/benchmark.git/test/benchmark_setup_teardown_test.cc: In function ‘void DoSetup1(const benchmark::State&)’:
/vol/llvm/src/llvm-project/benchmark/benchmark.git/test/benchmark_setup_teardown_test.cc:18:5: error: ‘single’ is not a class, namespace, or enumeration
18 | ++single::setup_call;
| ^~~~~~
/vol/llvm/src/llvm-project/benchmark/benchmark.git/test/benchmark_setup_teardown_test.cc: In function ‘void DoTeardown1(const benchmark::State&)’:
/vol/llvm/src/llvm-project/benchmark/benchmark.git/test/benchmark_setup_teardown_test.cc:25:5: error: ‘single’ is not a class, namespace, or enumeration
25 | ++single::teardown_call;
| ^~~~~~
In file included from /usr/gcc/12/include/c++/12.1.0/cassert:44,
from /vol/llvm/src/llvm-project/benchmark/benchmark.git/include/benchmark/benchmark.h:180,
from /vol/llvm/src/llvm-project/benchmark/benchmark.git/test/benchmark_setup_teardown_test.cc:9:
/vol/llvm/src/llvm-project/benchmark/benchmark.git/test/benchmark_setup_teardown_test.cc: In function ‘int main(int, char**)’:
/vol/llvm/src/llvm-project/benchmark/benchmark.git/test/benchmark_setup_teardown_test.cc:137:10: error: ‘single’ is not a class, namespace, or enumeration
137 | assert(single::setup_call == 4);
| ^~~~~~
/vol/llvm/src/llvm-project/benchmark/benchmark.git/test/benchmark_setup_teardown_test.cc:138:10: error: ‘single’ is not a class, namespace, or enumeration
138 | assert(single::teardown_call == 4);
| ^~~~~~
The llvm-project in-tree benchmark used to compile with -Wcast-qual added, which produces additional errors:
/vol/llvm/src/llvm-project/benchmark/benchmark-rorth.git/src/sysinfo.cc:658:42: error: cast from 'const char *' to 'char *' drops const qualifier [-Werror,-Wcast-qual]
kstat_t* ksp = kstat_lookup(kc, (char*)"cpu_info", -1, (char*)"cpu_info0");
^
/vol/llvm/src/llvm-project/benchmark/benchmark-rorth.git/src/sysinfo.cc:658:65: error: cast from 'const char *' to 'char *' drops const qualifier [-Werror,-Wcast-qual]
kstat_t* ksp = kstat_lookup(kc, (char*)"cpu_info", -1, (char*)"cpu_info0");
^
/vol/llvm/src/llvm-project/benchmark/benchmark-rorth.git/src/sysinfo.cc:668:53: error: cast from 'const char *' to 'char *' drops const qualifier [-Werror,-Wcast-qual]
(kstat_named_t*)kstat_data_lookup(ksp, (char*)"current_clock_Hz");
^
3 errors generated.
Expected behavior
The code should compile cleanly.
Additional context
- Solaris needs to include
<netdb.h>forMAXHOSTNAMELEN. Also,sysconf(3C)returnslong. - Solaris
<floatingpoint.h>has a conflictingsingletypedef. Rename the namespace tosinglethreadedto avoid the conflict and reflect what's actually meant here.
I have a patch to fix these issues and mean to post a pull request once the CLA issue is sorted out (I should have one in place from golang work).
- Ngôn ngữ chính
- C++
- Star
- 10.5k
- Fork
- 1.8k
- Merge trung bình
- 1 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 28
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của google/benchmark
-
[BUG] Confusing title in docs/platform_specific_build_instructions.mdCó thể đã có người làm @skryabae đã nhận 30 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] Memory manager counts allocations not part of benchmarkCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
google/benchmark#2149 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[FR] Add native Zig bindings via top-level `bindings/zig`Có thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 42/100
google/benchmark#2266 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
google/benchmark#2235 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
google/benchmark#2195 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của google/benchmark
Issue tương tự
-
[yugabyted] xcluster set_up and add_to_replication fail for database names containing - . or (Đang mởkind/bug priority/medium qa_automation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
yugabyte/yugabyte-db#37324 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
CharlotteCross1998/awesome-game-decompilations#61 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
godotengine/godot#125240 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
rombios: CMD needs to be a WORDĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
new issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
llvm/llvm-project#240065 ·
Maintainer thường phản hồi trong vòng 1 ngày