Closed Bug 616057 Opened 14 years ago Closed 13 years ago

Rebuild Android NDK v5 with PIC

Categories

(Release Engineering :: General, defect)

All
Android
defect
Not set
normal

Tracking

(fennec+)

RESOLVED INVALID
Tracking Status
fennec + ---

People

(Reporter: mwu, Assigned: bear)

References

Details

(Keywords: mobile, perf, Whiteboard: [ts][mobile], mobilestartupshrink)

I'd like to get the NDK rebuilt with -fPIC so we can remove most of the text relocations in the libraries we build on Android. Text relocations slow down startup and increase memory usage.

I basically did this to get it building with -fPIC:

--- a/build/tools/patches/005-flags.patch
+++ b/build/tools/patches/005-flags.patch
@@ -6,8 +6,8 @@ index 670b620..06c95e9 100644
  LDFLAGS_FOR_TARGET=-mandroid
  
  CFLAGS_FOR_TARGET+= -DANDROID -D__ANDROID__
-+CFLAGS_FOR_TARGET+= -fexceptions
-+CXXFLAGS_FOR_TARGET+= -frtti
++CFLAGS_FOR_TARGET+= -fexceptions -fPIC
++CXXFLAGS_FOR_TARGET+= -frtti -fPIC
  
  # Helper
  prefix-list = $(foreach e, $(2), $(join $1, $e))

I followed the latest instructions on the crystax site to build it. (which are a little different now.. the source pulling part pulls code from a specific date now)
Depends on: 616061
Assignee: nobody → bear
From bug 646843:

Mike Hommey [:glandium]:

Currently libgcc.a and libstdc++.a are not built as PIC. From my experiments,
this should get us between 2 and 5% less time spent before main(), provided bug
646815 is fixed as well.
Whiteboard: [fennec-4.1?]
Bear - What's the status here?
tracking-fennec: --- → ?
Whiteboard: [fennec-4.1?]
(In reply to comment #3)
> Bear - What's the status here?

it's on my task list.  right now i'm buildduty and will get back to it after buildduty.
tracking-fennec: ? → 7+
Blocks: 622908
Keywords: mobile, perf
Whiteboard: [ts]
Depends on: 657723
Bear is working on deploying the r5 NDK via puppet right now (Bug 657723). Once that's done, we'll revisit this bug and re-compile r5 with -fPIC.
From bug 646843:

From my experiments, all that is needed is to add --with-pic as a compile option to gcc (which I did through build/tools/build-gcc.sh), and add -fPIC to libgcc config options (which I did through the TARGET_LIBGCC2_CFLAGS variable in src/gcc/gcc-4.4.0/gcc/config/arm/t-arm-softfp, though there's probably a better place)
Whiteboard: [ts] → [ts][mobile]
tracking-fennec: 7+ → +
Whiteboard: [ts][mobile] → [ts][mobile], mobilestartupshrink
Summary: Rebuild Android NDK with PIC → Rebuild Android NDK v5 with PIC
edited bug title to be very clear that we will be compiling only the r5 NDK with -fPIC support
glandium noted in IRC that PIC support may already be in NDK5.
yep, good catch - according to

http://groups.google.com/group/android-ndk/browse_thread/thread/9fd148aa92a6fab6

PIC is available and enabled by default with NDK5
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → INVALID
Product: mozilla.org → Release Engineering
You need to log in before you can comment on or make changes to this bug.