Closed Bug 761287 Opened 8 years ago Closed 8 years ago

Cannot build on NDK-8 due to conflicting struct sigcontext

Categories

(Toolkit :: Crash Reporting, defect)

ARM
Android
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla19

People

(Reporter: toonetown, Assigned: jchen)

References

Details

Attachments

(2 files, 1 obsolete file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/535.18.5 (KHTML, like Gecko) Version/5.2 Safari/535.18.5

Steps to reproduce:

I am trying to build firefox mobile against Android ndk-8 on ubuntu linux.  All seems to build and work correctly, except for a compilation error due to the fact that the ndk now seems to include the headers that define struct sigcontext.  Some of the tools (the profiler and the crash reporter) define their own struct sigcontext to read this information, however, they won't build due to naming conflict.

I am building from the aurora branch, the tag FENNEC_14_0b5_RELEASE


Actual results:

Getting errors due to the fact that struct sigcontext is now defined in the headers for ndk8


Expected results:

Build should complete successfully.  I am attaching a patch which allows the code to build (simply renaming the struct to be called "sigcontext_moz" instead of "sigcontext").  I have not tested this patch against any other ndks or in any other build environments.
The patch needs review from a Breakpad peer. https://developer.mozilla.org/En/Developer_Guide/How_to_Submit_a_Patch#Getting_reviews Ted whom I'm cc'ing on the bug should be able to review the patch.
Status: UNCONFIRMED → NEW
Component: General → Breakpad Integration
Ever confirmed: true
OS: Mac OS X → Android
Product: Fennec Native → Toolkit
QA Contact: general → breakpad.integration
Hardware: x86 → ARM
Attachment #629897 - Attachment is patch: true
Is there any way we could detect this in the source? Do the header files that provide this struct define anything detectable?
We obviously can't take this patch as-is, since it will break building with older NDKs (including the one we're using for official builds).
Blocks: 779568
Summary: Cannot build on NDK-8 → Cannot build on NDK-8 due to conflicting struct sigcontext
Attached patch Patch (v1)Splinter Review
So Breakpad was half of the problem. This patch tries to fix the other half having to do with our profiler tool.

I think this is the right fix. Ehsan, can you take a look?

Try: https://tbpl.mozilla.org/?tree=Try&rev=9778a0b84217
Attachment #679289 - Flags: review?(ehsan)
Assignee: nobody → nchen
Attachment #629897 - Attachment is obsolete: true
Comment on attachment 679289 [details] [diff] [review]
Patch (v1)

Review of attachment 679289 [details] [diff] [review]:
-----------------------------------------------------------------

::: tools/profiler/platform-linux.cc
@@ +53,5 @@
>  
>  static Sampler* sActiveSampler = NULL;
>  
>  
> +#if defined(ANDROID)

Nit: #ifdef.
Attachment #679289 - Flags: review?(ehsan) → review+
https://hg.mozilla.org/mozilla-central/rev/ec3ad127d567
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
This breaks profiling builds:

tools/profiler/TableTicker.cpp: In member function 'void TableTicker::doBacktrace(ThreadProfile&, TickSample*)':
tools/profiler/TableTicker.cpp:829: warning: ISO C++ forbids braced-groups within expressions
tools/profiler/TableTicker.cpp:838: error: 'struct sigcontext' has no member named 'gregs'
tools/profiler/TableTicker.cpp:838: error: 'R0' was not declared in this scope
tools/profiler/TableTicker.cpp:839: error: 'struct sigcontext' has no member named 'gregs'
tools/profiler/TableTicker.cpp:839: error: 'R1' was not declared in this scope
tools/profiler/TableTicker.cpp:840: error: 'struct sigcontext' has no member named 'gregs'
tools/profiler/TableTicker.cpp:840: error: 'R2' was not declared in this scope
tools/profiler/TableTicker.cpp:841: error: 'struct sigcontext' has no member named 'gregs'
tools/profiler/TableTicker.cpp:841: error: 'R3' was not declared in this scope
tools/profiler/TableTicker.cpp:842: error: 'struct sigcontext' has no member named 'gregs'
tools/profiler/TableTicker.cpp:842: error: 'R4' was not declared in this scope
tools/profiler/TableTicker.cpp:843: error: 'struct sigcontext' has no member named 'gregs'
tools/profiler/TableTicker.cpp:843: error: 'R5' was not declared in this scope
tools/profiler/TableTicker.cpp:844: error: 'struct sigcontext' has no member named 'gregs'
tools/profiler/TableTicker.cpp:844: error: 'R6' was not declared in this scope
tools/profiler/TableTicker.cpp:845: error: 'struct sigcontext' has no member named 'gregs'
tools/profiler/TableTicker.cpp:845: error: 'R7' was not declared in this scope
tools/profiler/TableTicker.cpp:846: error: 'struct sigcontext' has no member named 'gregs'
tools/profiler/TableTicker.cpp:846: error: 'R8' was not declared in this scope
tools/profiler/TableTicker.cpp:847: error: 'struct sigcontext' has no member named 'gregs'
tools/profiler/TableTicker.cpp:847: error: 'R9' was not declared in this scope
tools/profiler/TableTicker.cpp:848: error: 'struct sigcontext' has no member named 'gregs'
tools/profiler/TableTicker.cpp:848: error: 'R10' was not declared in this scope
tools/profiler/TableTicker.cpp:849: error: 'struct sigcontext' has no member named 'gregs'
tools/profiler/TableTicker.cpp:849: error: 'R11' was not declared in this scope
tools/profiler/TableTicker.cpp:850: error: 'struct sigcontext' has no member named 'gregs'
tools/profiler/TableTicker.cpp:850: error: 'R12' was not declared in this scope
tools/profiler/TableTicker.cpp:851: error: 'struct sigcontext' has no member named 'gregs'
tools/profiler/TableTicker.cpp:851: error: 'R13' was not declared in this scope
tools/profiler/TableTicker.cpp:852: error: 'struct sigcontext' has no member named 'gregs'
tools/profiler/TableTicker.cpp:852: error: 'R14' was not declared in this scope
tools/profiler/TableTicker.cpp:853: error: 'struct sigcontext' has no member named 'gregs'
tools/profiler/TableTicker.cpp:853: error: 'R15' was not declared in this scope

struct sigcontext as defined in asm/sigcontext.h is not the same as what was defined in tools/profiler/android-signal-defs.h, and the code in TableTicker.cpp is now broken.
(In reply to Mike Hommey [:glandium] from comment #9)
> 
> struct sigcontext as defined in asm/sigcontext.h is not the same as what was
> defined in tools/profiler/android-signal-defs.h, and the code in
> TableTicker.cpp is now broken.

You're right. Reopening.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attachment #681053 - Flags: review?(ehsan) → review+
https://hg.mozilla.org/mozilla-central/rev/58cdbc0577de
Status: REOPENED → RESOLVED
Closed: 8 years ago8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.