1

Is here anyone who successfully build Google Breakpad on MacOS using standard Qt tool chain without xcode?

I'm trying to get work this library for two days now and still without success. I already successfully compiled it and ran it on Windows and Linux. (from original Google-git repository).

But MacOS version of library has missing makefile for libbreakpad_client.a and generated libbreakpad.a does not contain the exception handler.

http://screencast.com/t/V0mNiM3kZ

I found few topic about this issue on here on a stackoverflow but advice with updated makefiles didn't work for me (or I didn't copy makefiles correctly).

I also tried to download updated version directly from Mozilla repository (version 10 and 11beta). But when I tried to compile Mozilla version, there was another errors with undefined symbols (on Mac and also on Linux).

I also found AlekSi - breakpad-qt but this version also works correctly only under Win and Linux. Under Mac there is some errors about "Unknown architecture -- are you on a PDP-11?"

I will be gratitude to anyone who can point me how to compile it and get it work under Mac or who can send me a packed version of breakpad which can be compiled under MacOS using standard make and used in Qt application.

Thank you Ludek

Community
  • 1
  • 1
Ludek Vodicka
  • 1,610
  • 1
  • 18
  • 33
  • Curious - is there a reason you do not want to use xcode? We compile breakpad from a script that uses `xcodebuild` and the resulting library can be used in a Qt application. – Dave Mateer May 04 '12 at 14:35
  • 1
    The main reason why I didn't want to use xcode is that I don't know it ;-). I'm primary MS Visual Studio developer so app is primary developed using Visual Studio and ported to Linux and MacOs. I already learn gcc, makefiles and the whole Linux environment, so I wanted to use it also on MacOS. The second reason was that I read somewhere that compiling using xcode doesn't work too. But if a compilation could be done using xcode by some simple script and after that used by Qt qmake system, I will be glad for any guidance. Thanks. – Ludek Vodicka May 04 '12 at 15:26
  • Here is the script we used that works: `xcodebuild -project Breakpad.xcodeproj -configuration release -target All ARCHS=x86_64 ONLY_ACTIVE_ARCH=YES CONFIGURATION_BUILD_DIR=../path/to/shadow/build/dir` – Dave Mateer May 04 '12 at 17:40
  • Disclaimer on the script above: it doesn't really answer the question, so I didn't include it as an answer (someone else may have a better solution, and it would be nice for the question to keep getting attention.) Disclaimer 2: because of the way Qt handles exceptions in event handlers (they are not supported), it made breakpad very awkward to use so we abandoned it. Thus, this script has not been tested in awhile. – Dave Mateer May 04 '12 at 17:42
  • Thank you for sharing a script. I will try it as soon as possible. I also found a half-solution in the meantime. The solution is to add all .cc and .mm files directly to the project.pro file and include header files in common way. http://pastebin.com/QKLAEAV0 After that there is no need to compile library, but I would rather prefer a usual way by using precompiled library. – Ludek Vodicka May 04 '12 at 18:10
  • Maybe it would be possible to create stand-alone .pro project for breakpad library and compile it separately. – Ludek Vodicka May 04 '12 at 18:15

1 Answers1

2

AlekSi's breakpad-qt is three years old, and the breakpad source in it doesn't support 64 bits on OSX.

Failing to detect your processor type is what makes it complain about "Unknown architecture -- are you on a PDP-11?".

You definitely need a more recent breakpad version, either from their svn, or from my breakpad-qt fork at: https://github.com/webitup/qt-breakpad

Now, if you intend on supporting 10.6 (MACOSX_DEPLOYMENT_TARGET=10.6) as well, you need to patch breakpad source using this https://github.com/webitup/qt-breakpad/commit/71a9fdedd827e5939ba66bfcc0cd6c1c9fbbc87b (-> I don't think 10.6 has PPC support)

Then:

You apparently managed to compile directly from source, so, good for that way.

Now, if you want to build a framework from breakpad instead, and link to that from your qt app/lib, then Dave Mateer suggestion is the way to go (and he deserves the credit). The following worked for me:

cd $BREAKPAD_SOURCE_TREE
xcodebuild -sdk macosx10.7 -project src/client/mac/Breakpad.xcodeproj -configuration Release -target Breakpad ARCHS=x86_64 ONLY_ACTIVE_ARCH=YES MACOSX_DEPLOYMENT_TARGET=10.6 GCC_VERSION=com.apple.compilers.llvmgcc42 

Note that I'm only building target Breakpad instead of All (it seems you only need that - and a test is failing for me using All, though it does produce a usable framework either way).

And note that you don't require XCode per-se - just the command line builds tools.

In order to use that framework in your QT project:

mac {
        QMAKE_LFLAGS += -F$$BREAKPAD_PATH/client/mac/build/Release/
        LIBS += -framework Breakpad
}

And you should be set.

Finally: I also pushed a number of changes in my breakpad-qt fork source itself to have it at least compile (on OSX!) against the updated breakpad version, but I have no idea yet if it does work properly.

I'm just starting with that fork - if you want to share experience and/or commit some stuff in there, just ask.

Mangled Deutz
  • 11,384
  • 6
  • 39
  • 35
  • And this http://stackoverflow.com/questions/5404636/building-google-breakpad-on-mac-os-x has some information about the current state of things: you can't build breakpad on OSX using simply "standard" tools, unless you manually build your own makefiles to produce an a/dylib library. – Mangled Deutz Jun 08 '12 at 15:14
  • FWIW I put some detailed notes here: http://tech.roxee.tv/?p=25 - though this might be out of scope of your original question. – Mangled Deutz Jun 09 '12 at 01:31
  • Hello guys, links are dead: the github repository and the roxee.tv link are not working and I'm actually struggling to get breakpad linked correctly with my qt code… – zmo Jan 15 '15 at 22:53
  • Hey - the blog has been removed, but the repo is still there: https://github.com/roxee/qt-breakpad (moved) - although, this is three years old information now... Happy if it still helps, but probably a lot has changed. – Mangled Deutz Jan 22 '15 at 20:29
  • I did not find your repository, but I found Aleksi's and a few others, and they were working fine with latest google-breakpad. So I guess your code is still useful 3 years after, thank you! ;-) – zmo Jan 23 '15 at 00:44