Closed Bug 892355 Opened 7 years ago Closed 6 years ago

Elfhack is disabled in Fennec since version 20

Categories

(Firefox Build System :: General, defect)

All
Linux
defect
Not set

Tracking

(firefox22 wontfix, firefox23- wontfix, firefox24+ fixed, firefox25+ fixed)

RESOLVED FIXED
mozilla25
Tracking Status
firefox22 --- wontfix
firefox23 - wontfix
firefox24 + fixed
firefox25 + fixed

People

(Reporter: glandium, Assigned: glandium)

References

Details

Attachments

(1 file, 1 obsolete file)

I guess this happened when switching to a new NDK, where the default for PT_GNU_RELRO segments changed, and that disabled elfhack. This mad memory footprint 2.5MB larger than with elfhack, and the apk around 350KB larger.

(Note that for aurora and m-c, elfhack is disabled for another reason: the profiler, but that's for a separate bug)
This makes --enable-elf-hack error out if elfhack can't be enabled, or have configure do what it can to keep it enabled (by disabling unsupported linker features)
Attachment #773799 - Flags: review?(ted)
Blocks: 788974
With missing --disable-elf-hack in mozconfigs that --enable-profiling
Attachment #773807 - Flags: review?(ted)
Attachment #773799 - Attachment is obsolete: true
Attachment #773799 - Flags: review?(ted)
Depends on: 892366
Attachment #773807 - Flags: review?(ted) → review+
https://hg.mozilla.org/mozilla-central/rev/f138a2a6c329
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
Hardware: x86_64 → All
Let's take this in FF24 so that it gets a full beta cycle to iron out any issues.
Comment on attachment 773807 [details] [diff] [review]
Force enable elfhack with --enable-elf-hack

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

::: build/unix/mozconfig.linux
@@ +2,5 @@
>  
>  CC="/tools/gcc-4.7.2-0moz1/bin/gcc"
>  CXX="/tools/gcc-4.7.2-0moz1/bin/g++"
> +
> +ac_add_options --enable-elf-hack

Did you mean to --enable-elf-hack for linux 32 as well? If so, then I think you want to update mozconfig.linux32 as well.
(In reply to Mark Banner (:standard8) from comment #6)
> >  CC="/tools/gcc-4.7.2-0moz1/bin/gcc"
> >  CXX="/tools/gcc-4.7.2-0moz1/bin/g++"
> > +
> > +ac_add_options --enable-elf-hack
> 
> Did you mean to --enable-elf-hack for linux 32 as well? If so, then I think
> you want to update mozconfig.linux32 as well.

mozconfig.linux32 includes mozconfig.linux.
This obviously broke the profiling branch's cron job which merges automatically from m-c and removes --enable-profiling.  To fix that, I removed both --enable-profiling and --disable-elf-hack from linux32/64 mozconfigs.

glandium, is that the right thing to do?
Flags: needinfo?(mh+mozilla)
(In reply to :Ehsan Akhgari (needinfo? me!) from comment #8)
> This obviously broke the profiling branch's cron job which merges
> automatically from m-c and removes --enable-profiling.  To fix that, I
> removed both --enable-profiling and --disable-elf-hack from linux32/64
> mozconfigs.
> 
> glandium, is that the right thing to do?

That sounds good to me.
Flags: needinfo?(mh+mozilla)
This broke my local build because I include mobile/android/config/mozconfigs/common in my mozconfig, and so --enable-elf-hack got included into my mozconfig when it wasn't previously. My build failed on OS X because the host compiler couldn't find elf.h (included from elfxx.h). I had to put --disable-elf-hack into my mozconfig to get past this error.
(In reply to comment #10)
> This broke my local build because I include
> mobile/android/config/mozconfigs/common in my mozconfig

As far as I know, these mozconfigs are not supposed to be used by developers, unless they're expecting to keep up with stuff changing in them.  :/
That's not what I heard, but ok.
(In reply to :Ehsan Akhgari (needinfo? me!) from comment #11)
> (In reply to comment #10)
> > This broke my local build because I include
> > mobile/android/config/mozconfigs/common in my mozconfig
> 
> As far as I know, these mozconfigs are not supposed to be used by
> developers, unless they're expecting to keep up with stuff changing in them.
> :/

I had the same issue.  And we've been pointing new developers to the in-tree configs in #mobile for some time now.
Comment on attachment 773807 [details] [diff] [review]
Force enable elfhack with --enable-elf-hack

[Approval Request Comment]
Bug caused by a change in the used NDK 
User impact if declined: Memory footprint regression since FF20.
Testing completed (on m-c, etc.): Landed on m-c some time ago.
Risk to taking this patch (and alternatives if risky): Low. Build config only.
String or IDL/UUID changes made by this patch: None.
Attachment #773807 - Flags: approval-mozilla-aurora?
Comment on attachment 773807 [details] [diff] [review]
Force enable elfhack with --enable-elf-hack

Approving given this is low risk and comment# 5.
Attachment #773807 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
https://hg.mozilla.org/releases/mozilla-aurora/rev/0d2724681600

Note the patches to browser/config/mozconfigs/linux*/nightly were left out on aurora because there is not --enable-profiling in those files on aurora. There is, however, one in mobile/android/config/mozconfigs/android/nightly, so that one is patched to disable elf hack as on m-c.
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.