Closed Bug 666918 Opened 14 years ago Closed 14 years ago

ARM builds fail with --enable-profiling

Categories

(Firefox Build System :: General, defect)

Other Branch
ARM
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla7

People

(Reporter: jbramley, Assigned: jbramley)

Details

Attachments

(1 file, 1 obsolete file)

The --enable-profiling switch adds -fno-omit-frame-pointer to the compiler flags so that call graphs can be produced by profilers. However, if GCC is forced into maintaining a frame pointer, it does not have enough registers left over to satisfy the inline assembly contraints in yuv42x_to_rgb565_row_neon. I've attached a trivial fix, which simply forces the frame pointer off just for that function. An arguably cleaner fix would edit the assembly contraints so that there are enough registers anyway, though this might not be straightforward and could well come with a performance penalty.
It looks like breakpad also has trouble. I'm trying a build with --disable-crashreporter. (I don't need the crash reporter for this.)
I think the crash reporter doesn't build because the Linux syscall interface uses r7, and GCC uses r7 as a frame pointer in Thumb-2 mode. I'm not sure exactly which asm statement is causing offence because the error I get doesn't point anywhere useful. There are many that use r7. Most-likely solutions: * Force -fomit-frame-pointer for this module. We can't generally get stack traces into the kernel anyway, so not much is lost. * Force this module to build as ARM code, where the frame pointer is r11. The latter is probably the cleanest solution. Thumb code is smaller so it'd cost some space, but I assume we don't set --enable-profiling for release builds anyway. (Yes, it could affect profile results, but it wouldn't be significant and it should be restricted to the crash reporter.) This does not show up in NDK5, presumably because Thumb support is not detected (as in bug 667130) and so the module is being built with ARM support.
Ok, there's already a fix in the Makefile.in for exception_handler.cc, and -fomit-frame-pointer gets added to the command line. However, the profiling flags (-fno-omit-frame-pointer) get added afterwards, and counter-act it.
Summary: yuv_convert_arm.cpp fails to build with --enable-profiling → ARM builds fail with --enable-profiling
Assignee: Jacob.Bramley → nobody
Component: Graphics → Build Config
QA Contact: thebes → build-config
This patch forces omit-frame-pointer for the failing breakpad file. The only change to the existing workaround (from bug 633436) is to remove -fno-omit-frame-pointer from MOZ_OPTIMIZE_FLAGS.
Attachment #541668 - Attachment is obsolete: true
Attachment #542823 - Flags: review?(jones.chris.g)
Assignee: nobody → Jacob.Bramley
Comment on attachment 542823 [details] [diff] [review] Force omit-frame-pointer for some selected routines. Review of attachment 542823 [details] [diff] [review]: ----------------------------------------------------------------- ::: gfx/ycbcr/yuv_convert_arm.cpp @@ +21,5 @@ > + const uint8 *y, > + const uint8 *u, > + const uint8 *v, > + int n, > + int oddflag) By the way, I did wonder if this should use the same Makefile-based mechanism as for the breakpad fix, but decided that per-function controls would be better here. If we add other NEON functions to this file, it might be handy to control omit-frame-pointer on a per-function basis rather than for the whole file.
Comment on attachment 542823 [details] [diff] [review] Force omit-frame-pointer for some selected routines. Per-function here is fine with me.
Attachment #542823 - Flags: review?(jones.chris.g) → review+
To where should I push this? mozilla-central?
(In reply to comment #7) > To where should I push this? mozilla-central? yes, or mozilla-incoming if you don't want to watch the tree
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla7
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: