google / google/googletest

bazel build fails on FreeBSD with "undefined symbol: ceilf"

Open
#2,190 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
39.5k
Forks
10.9k
Avg merge
6d 13h
Merged PRs (30d)
1

Description

The latest master fails to build on FreeBSD because bazel doesn't use `-lm` when building googletest-printers-test.cc:

```
bazel --output_user_root=/tmp/googletest build --curses=no --sandbox_debug //...:all
Loading:
Loading: 0 packages loaded
Analyzing: 64 targets (0 packages loaded, 0 targets configured)
INFO: Analysed 64 targets (0 packages loaded, 0 targets configured).
INFO: Found 64 targets...
[0 / 4] [-----] BazelWorkspaceStatusAction stable-status.txt
ERROR: /usr/home/somers/src/github/google/googletest/googletest/test/BUILD.bazel:38:1: Linking of rule '//googletest/test:gtest_all_test' failed (Exit 1) process-wrapper failed: error executing command
(cd /tmp/googletest/2cf661df848944827730f6d001863d27/sandbox/processwrapper-sandbox/1/execroot/com_google_googletest && \
exec env - \
PATH=/bin:/usr/bin/:/usr/local/bin \
PWD=/proc/self/cwd \
TMPDIR=/tmp \
/tmp/googletest/install/f87e147311f717bac250eff8d1b892cf/_embedded_binaries/process-wrapper '--timeout=0' '--kill_delay=15' /usr/bin/clang -o bazel-out/freebsd-fastbuild/bin/googletest/test/gtest_all_test '-Wl,-rpath,$ORIGIN/../../_solib_freebsd/' -Lbazel-out/freebsd-fastbuild/bin/_solib_freebsd bazel-out/freebsd-fastbuild/bin/googletest/test/_objs/gtest_all_test/googletest-death-test-test.pic.o bazel-out/freebsd-fastbuild/bin/googletest/test/_objs/gtest_all_test/googletest-filepath-test.pic.o bazel-out/freebsd-fastbuild/bin/googletest/test/_objs/gtest_all_test/googletest-message-test.pic.o bazel-out/freebsd-fastbuild/bin/googletest/test/_objs/gtest_all_test/googletest-options-test.pic.o bazel-out/freebsd-fastbuild/bin/googletest/test/_objs/gtest_all_test/googletest-param-test2-test.pic.o bazel-out/freebsd-fastbuild/bin/googletest/test/_objs/gtest_all_test/googletest-port-test.pic.o bazel-out/freebsd-fastbuild/bin/googletest/test/_objs/gtest_all_test/googletest-printers-test.pic.o bazel-out/freebsd-fastbuild/bin/googletest/test/_objs/gtest_all_test/googletest-test-part-test.pic.o bazel-out/freebsd-fastbuild/bin/googletest/test/_objs/gtest_all_test/googletest-test2_test.pic.o bazel-out/freebsd-fastbuild/bin/googletest/test/_objs/gtest_all_test/gtest-typed-test2_test.pic.o bazel-out/freebsd-fastbuild/bin/googletest/test/_objs/gtest_all_test/gtest-typed-test_test.pic.o -llibgtest_Umain -llibgtest -pthread -pthread -Wl,-S -lstdc++ -Wl,-z,relro,-z,now -no-canonical-prefixes)
ld: error: undefined symbol: ceilf
>>> referenced by googletest-printers-test.cc
>>> bazel-out/freebsd-fastbuild/bin/googletest/test/_objs/gtest_all_test/googletest-printers-test.pic.o:(ceil(float))
clang: error: linker command failed with exit code 1 (use -v to see invocation)
INFO: Elapsed time: 0.518s, Critical Path: 0.06s
INFO: 0 processes.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully
```

Contributor guide

Open the contributing guide

Research direction

Start with googletest/test/BUILD.bazel and googletest-printers-test.cc, then reproduce the reported bazel build command on FreeBSD. Trace the link settings for gtest_all_test and verify that the build completes successfully without the undefined ceilf symbol.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.