New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 912432 link

Starred by 1 user

Issue metadata

Status: Untriaged
Owner: ----
Cc:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

Check if {gtest,gmock}-config --ldflags is needed.

Project Member Reported by hidehiko@chromium.org, Dec 6

Issue description

Currently, gtest-config --libs and gmock-config --libs are used to extract linker flags.

https://chromium.git.corp.google.com/chromiumos/platform2/+/a51b89fa44277358cd1d4ca4b0269e74ddb5151c/common-mk/BUILD.gn#147

However, the -config program has --ldflags. According to gtest-config:

 Compilation Flag Queries:
  --cppflags                 compile flags specific to the C-like preprocessors
  --cxxflags                 compile flags appropriate for C++ programs
  --ldflags                  linker flags
  --libs                     libraries for linking

So, --ldflags should be considered.

At the moment, practically it would fail.
--ldflags returns -L/usr/lib64, which is host lib dirs.
Specifically, /usr/lib64 contains host libchrome, which is built with NDEBUG.
However, target binary is built without NDEBUG, so the inconsistency causes an link error (intentional behavior: cf) https://chromium.googlesource.com/aosp/platform/external/libchrome/+/master/base/logging.h#203 )

Currently, the problem isn't hit, because the executable is linked against target libs.
In theory, --ldflags can provide more flags than -L, it's nice to be considered.

 

Sign in to add a comment