Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem building Crashpad with MSVC16 in 32bit mode #182

Closed
tru opened this issue Mar 16, 2020 · 5 comments
Closed

Problem building Crashpad with MSVC16 in 32bit mode #182

tru opened this issue Mar 16, 2020 · 5 comments

Comments

@tru
Copy link

tru commented Mar 16, 2020

Hello,

I was trying to build this project under visual studio 2019 in 32-bit mode. It failed because problematic flags where passed to the assembler:

C:\PROGRA~2\MIB055~1\2019\BUILDT~1\VC\Tools\MSVC\1424~1.283\bin\Hostx64\x86\ml.exe -DCRASHPAD_ZLIB_SOURCE_EMBEDDED -DHAVE_STDARG_H -DNOMINMAX -DUNICODE -DWIN32_LEAN_AND_MEAN -DZLIB_CONST -D_CRT_SECURE_NO_WARNINGS -D_HAS_EXCEPTIONS=0 -D_UNICODE -D_WIN32_WINNT=0x0A00 -IC:\.conan\3c2f69\1\include -IC:\.conan\7dd726\1\include -IC:\.conan\bc8821\1\include -Isentry-native\external\crashpad -Isentry-native\external\crashpad\third_party\mini_chromium\mini_chromium -Isentry-native\external\crashpad\PUBLIC -Isentry-native\external\crashpad\compat\non_mac -Isentry-native\external\crashpad\compat\win -Isentry-native\external\crashpad\compat\non_elf /safeseh   /FS /W4 /WX /Zi /bigobj /wd4100 /wd4127 /wd4324 /wd4351 /wd4577 /wd4996 /wd4201 /wd4996 /wd4131 /wd4244 /wd4245 /wd4267 /wd4324 /wd4702 /c  /Fo external\crashpad\util\CMakeFiles\crashpad_util.dir\misc\capture_context_win.asm.obj sentry-native\external\crashpad\util\misc\capture_context_win.asm
Microsoft (R) Macro Assembler Version 14.24.28316.0
Copyright (C) Microsoft Corporation.  All rights reserved.

MASM : warning A4018:invalid command-line option : /FS
MASM : warning A4018:invalid command-line option : /bigobj
MASM : warning A4018:invalid command-line option : /wd4100
MASM : warning A4018:invalid command-line option : /wd4127
MASM : warning A4018:invalid command-line option : /wd4324
MASM : warning A4018:invalid command-line option : /wd4351
MASM : warning A4018:invalid command-line option : /wd4577
MASM : warning A4018:invalid command-line option : /wd4996
MASM : warning A4018:invalid command-line option : /wd4201
MASM : warning A4018:invalid command-line option : /wd4996
MASM : warning A4018:invalid command-line option : /wd4131
MASM : warning A4018:invalid command-line option : /wd4244
MASM : warning A4018:invalid command-line option : /wd4245
MASM : warning A4018:invalid command-line option : /wd4267
MASM : warning A4018:invalid command-line option : /wd4324
MASM : warning A4018:invalid command-line option : /wd4702
MASM : warning A4008:invalid command-line option value, default is used : /W
 Assembling: sentry-native\external\crashpad\util\misc\capture_context_win.asm

This can be fixed in your crashpad cmakefile.txt by adding a generator expression that only applies the flags to the C++ files: $<$<COMPILE_LANGUAGE:CXX>/wx> for example. Also it should not use target_compile_definitions but rather target_compile_options for those things.

I solved it by removing the /WX flag for now and that made it build.

Thanks for adding a CMake based build system for crashpad - I was already working on that for our applications but now that you have added it I might shift and help you with patches if I have the time.

@Swatinem
Copy link
Member

Thanks for adding a CMake based build system for crashpad - I was already working on that for our applications but now that you have added it I might shift and help you with patches if I have the time.

I would very much appreciate that. I only learned CMake a few week ago for this project, and I’m sure I can still learn a lot about it.

master now has a broader set of tests, also building the crashpad backend on 32bit VS2017, and 64bit VS2019. We can extend the list further if needed, for example cross-compiling 32bit from a 64bit VS2019 toolchain like you are trying to do here.

@Swatinem
Copy link
Member

@tru can you try this again with the latest 0.2.1 release and close this if the issue is solved? We made a few improvements to the CMake files, and also test with at least 32-bit VS2017.

@Swatinem
Copy link
Member

I will close this for now, please re-open if you are still having problems

@hankbao
Copy link

hankbao commented Sep 2, 2020

It's not clear how to build the 32bit crashpad backend with VS2019. The result binaries are 64bit anyway even building with VS2019 x86 Native Tools environment.

@Mixaill
Copy link
Contributor

Mixaill commented Sep 2, 2020

Use -A Win32 flag.

Something like,

mkdir ~build
cd build
cmake -A Win32 ..
cmake --build .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants