Using command line flags declared in content from chrome_paths*.cc

12 views
Skip to first unread message

Julian Pastarmov

unread,
Dec 5, 2011, 10:45:41 AM12/5/11
to Chromium-dev
Hi Chromium devs,
I have the following issue and will be grateful for some advice on it.

I added some code to check that the profile folder is only being
accessed from non-sandboxed processes on windows. To do that I query
the kProcessType command line switch and compare it with the proper
types in chrome\common\common_paths.cc: PathProvider. All those
constants I need are defined in content\public\common\content_switches.
[cc|h]. Chromium and almost all other targets compile and link fine
because they link against content_common but chrome_content_win64
doesn't and respectively crash_reporter_win64 also fails with the
following linker error (sanitized for easier readability):

common_constants_win64.lib(chrome_paths.obj) :error LNK2019:
unresolved external symbol "char const * const
switches::kProcessType" referenced in function "bool __cdecl
chrome::PathProvider(int,class FilePath *)"

common_constants_win64.lib(chrome_paths_win.obj) :error LNK2019:
unresolved external symbol "char const * const
switches::kServiceProcess" referenced in function "bool __cdecl
chrome::CheckIfProcessNeedsProfileDir(class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > const &)"

..\build\Release\crash_service64.exe : fatalerror LNK1120: 2
unresolved externals

full log is here : http://build.chromium.org/p/tryserver.chromium/builders/win_rel/builds/3464/steps/compile/logs/stdio

So my question is what would be the proper way to solve this
dependency or make it explicit without having to create full 64 bit
version of the content_common library which is not needed anyway.

The CL in question is : http://codereview.chromium.org/8463020/

I am sorry if I am repeating a question already asked but I couldn't
find a search formulation that would return any useful information.

Best,
Julian

Jói Sigurðsson

unread,
Dec 5, 2011, 12:23:27 PM12/5/11
to pasta...@chromium.org, Chromium-dev
Hi Julian,

If I understand correctly, those are special processes for 64-bit that
we only want to link in a limited amount of stuff. In this case it
seems fine to just add the source file
(content/public/common/content_switches.cc) directly to the target in
question e.g. crash_service_win64.

Cheers,
Jói

> --
> Chromium Developers mailing list: chromi...@chromium.org
> View archives, change email options, or unsubscribe:
>    http://groups.google.com/a/chromium.org/group/chromium-dev

Dirk Pranke

unread,
Dec 5, 2011, 1:05:15 PM12/5/11
to pasta...@chromium.org, Chromium-dev, j...@chromium.org
Jói's suggestion is correct; you'll probably also want to #define the
COMPILE_CONTENT_STATICALLY symbol to avoid getting import/export
errors in a component build.

You can see some examples of this in the chrome_exe.gypi where we link
the file directly into chrome.exe, and also in the nacl win64 targets
in chrome/nacl.gypi.

-- Dirk

Julian Pastarmov

unread,
Dec 6, 2011, 8:25:51 AM12/6/11
to Chromium-dev, Dirk Pranke, pasta...@chromium.org, j...@chromium.org
Thanks for the hints! Will do so. :)
-Julian

> >> full log is here :http://build.chromium.org/p/tryserver.chromium/builders/win_rel/build...

Reply all
Reply to author
Forward
0 new messages