Jump to content


Photo

Did anyone successfully built Android from sources?

* * * * * 3 votes

  • Please log in to reply
43 replies to this topic

#1
Auxx

Auxx

    Enthusiast

  • Members
  • PipPipPip
  • 217 posts
I've just ran readelf on my libwebcore.so and libwebcore.so from Acer to find out why my lib crashes. The most important thing I've noticed right at the start is that my lib is for arm5, thumb1 and without fpu optimizations. So now I recompile it from scratch... Oh, well...

So, my questions. Did anyone successfully compiled any system libs for Acer from AOSP sources? If so, what flags did you use? How did you fight reloc issues?

Thanks in advance!

  • 0

#2
amdnikos

amdnikos

    Regular

  • Members
  • PipPip
  • 135 posts
  • Devices:Acer Liquid

I've just ran readelf on my libwebcore.so and libwebcore.so from Acer to find out why my lib crashes. The most important thing I've noticed right at the start is that my lib is for arm5, thumb1 and without fpu optimizations. So now I recompile it from scratch... Oh, well...

So, my questions. Did anyone successfully compiled any system libs for Acer from AOSP sources? If so, what flags did you use? How did you fight reloc issues?

Thanks in advance!

afaik noone was able to built an aosp system.tbh i would love it cause it includes all languages even Greek that none acer rom include it.

  • 0

#3
Auxx

Auxx

    Enthusiast

  • Members
  • PipPipPip
  • 217 posts

afaik noone was able to built an aosp system.tbh i would love it cause it includes all languages even Greek that none acer rom include it.

Khm... If you are correct, then it'll take more time then I hoped...

  • 0

#4
Piter1225

Piter1225

    Addict

  • Members
  • PipPipPipPipPip
  • 709 posts
  • Location:Poland
  • Devices:O2X, SGS
  • Twitter:@piter1225
I got used to use my phone without my native lang, even I thought there will be AOSP for this device...

  • 0


Posted Image



#5
Auxx

Auxx

    Enthusiast

  • Members
  • PipPipPip
  • 217 posts
Guess what, guys? I just did it! I have found a reloc issue workaround! I now have custom webkit in my Liquid (:

  • 0

#6
demolition23

demolition23

    Regular

  • Members
  • PipPip
  • 83 posts
  • Devices:Acer Liquid

Guess what, guys? I just did it! I have found a reloc issue workaround! I now have custom webkit in my Liquid (:



and thats mean...??

  • 0

#7
Auxx

Auxx

    Enthusiast

  • Members
  • PipPipPip
  • 217 posts

and thats mean...??

That means we are free to compile any system libs from Android sources and use them on our devices (:

  • 0

#8
dguerre

dguerre

    Newbie

  • Members
  • Pip
  • 45 posts
  • Gender:Male
  • Devices:Atrix 4G, Acer Iconia A500
  • Twitter:@dguerre

That means we are free to compile any system libs from Android sources and use them on our devices (:


Excellent. Is this for 1.6 or 2.1?

  • 0

#9
ahsid

ahsid

    Enthusiast

  • Members
  • PipPipPip
  • 222 posts
does this mean aosp ?

  • 0

#10
Auxx

Auxx

    Enthusiast

  • Members
  • PipPipPip
  • 217 posts

Excellent. Is this for 1.6 or 2.1?

For anything.

does this mean aosp ?

Yes!

I will provide details tomorrow - I want to go to sleep (: It's 1:41 here and I need to wake up at 8:00.

Edited by Auxx, 31 May 2010 - 10:41 PM.

  • 0

#11
pipajoja

pipajoja

    Regular

  • Members
  • PipPip
  • 88 posts
  • Devices:liquid
  • Twitter:@none
very good news
waiting for applications
impress us :(

  • 0

#12
G_Technik

G_Technik

    Enthusiast

  • Members
  • PipPipPip
  • 163 posts
  • Location:Moscow Region
  • Devices:Acer Liquid E
It's great!!!
«One small step for man, one giant leap for...»Liquid users!!!

  • 0
Acer Metal_3.021.01_t&l_Metal_2.3_test5

#13
drigerott

drigerott

    Diehard

  • Members
  • PipPipPipPip
  • 306 posts
  • Devices:Acer liquid
lol fantastic lol AOSP on liquid ihhihihi great work auxx :(

  • 0
Posted Image



for my ROM B70P, themes and guides if you want ;) offer me a coffè ;)

#14
Auxx

Auxx

    Enthusiast

  • Members
  • PipPipPip
  • 217 posts
So, technical details.

Google decided to use prelinking technique to speed everything up and to waste as little RAM as possible. Great! So they took prelink utility and modified it to fit their needs. Two tools were born: apriori and soslim. They are run on every build to produce optimized and prelinked system libs. Almost every .so file you see in /system/lib is prelinked via soslim/apriori.

Prelinking works by loading libs at known base addresses which are defined in a special file called prelink-linux-arm.map. This file contains a list of libs with their predefined base addresses. What Acer did is that they modified this file and did not share it with us. So every AOSP attemp failed. If you compile any lib from Android sources and put it on your Liquid boom happens and nothing works. Studying Android sources I've found a small utility which is called isprelinked. It checks binary library if it is prelinked and if it is, then base address is shown.

So yesterday I ran isprelinked on Acer libs and recreated prelink-linux-arm.map for Liquid. Then I built test version of webkit (libwebcore.so), put it into /system/lib replacing version from Acer and rebooted the phone - it worked! I can not share prelink map at the moment - it is at my home PC and I don't have remote access. I will share this file in the evening, but you can make it yourself, actually.

How to make prelink map? Quite simple. First of all you need to create isprelinked binary. cd to your Android source (cd ~/mydroid as in docs) and run "make isprelinked" (without quotes, of course). You will get app binary in a while, it will be somewhere in ~/mydroid/out/host/bla-bla-bla. The correct path will be shown in console once compilation is done.

Next step is run isprelinked over Acer binaries. It is quite simple, but will take some time. Copy all libs from your Liquid to some folder, for example to ~/acer-libs. Now open original prelink map (make a backup!), copy its contents to empty text file, in this new text file remove comments and base addresses, leave only lib names. Put a new line at top with full path to isprelinked and merge all lib names into single line with spaces between. You should have text file with one line looking like this:

~/mydroid/out/host/tools/isprelinked libdl.so libc.so libstdc++.so

This line will be very long (: Now go back into console, cd ~/acer-libs and run this BIG line. It will fail (: Because this list has some libs which Acer does not have. It will fail WITHOUT telling which lib is missing. But you will see base addr of previous lib. So find all unneeded libs and remove them from command line. Hell of a work, actually. But once again - I'm not at home, I can not paste correct line at the moment. Sorry.

Once isprelinked runs clean without errors you will see a list of all libs and their base addresses. Remove ":" character between lib name and address, paste it into prelink-linux-arm.map replacing all previous contents (you made a backup, right?) and this part is finished - now you have all base addresses needed for successful compilation of system binaries.

But if you run compilation now it will fail - apriori will tell you that lib addresses are out of bound. You need to modify prelinkmap.c. There is a line:

#define PRELINK_MIN 0x90000000

Change it to:

#define PRELINK_MIN 0x50000000

And recompile apriori tool with "make apriori" from your ~/mydroid. Now you have a 100% Acer compatible build environment!

Now if you wish to compile any component just run "make SOMETHING" where SOMETHING is what you need to compile. For example, "make libwebcore" compiles WebKit (: This is the simplest way of compilation, but you also want to make Snapdragon optimizations generated. So you need to compile with additional option TARGET_ARCH_VARIANT to target Snapdragon. SD has armv7-a CPU inside. So final string for WebKit is "make TARGET_ARCH_VARIANT=armv7-a libwebcore". That will make default WebKit with all CPU dependent optimizations. Compilation result can be found in ~/mydroid/out/target/system/lib - full and correct path will be shown in console after compilation.

What does it all mean? Well, AOSP is finally possible! This will also be helpful for porting binaries from other non-acer ROMs - now you can easily rebase libs to Acer standard and everything will work.

Today I will put map file I've generated from Acer libs and will continue working on Flash support for 2.1. I also think I will compile Flash supporting WebKit with V8 JavaScript engine (like in Froyo), SVG support and I will look into animated GIFs issue. There will be two libwebcores from me: stock with Flash and full-blown (which may eat your RAM and kill CPU).

  • 0

#15
Charlton22

Charlton22

    Diehard

  • Members
  • PipPipPipPip
  • 407 posts
  • Devices:Acer Liquid

So, technical details.

Google decided to use prelinking technique to speed everything up and to waste as little RAM as possible. Great! So they took prelink utility and modified it to fit their needs. Two tools were born: apriori and soslim. They are run on every build to produce optimized and prelinked system libs. Almost every .so file you see in /system/lib is prelinked via soslim/apriori.

Prelinking works by loading libs at known base addresses which are defined in a special file called prelink-linux-arm.map. This file contains a list of libs with their predefined base addresses. What Acer did is that they modified this file and did not share it with us. So every AOSP attemp failed. If you compile any lib from Android sources and put it on your Liquid boom happens and nothing works. Studying Android sources I've found a small utility which is called isprelinked. It checks binary library if it is prelinked and if it is, then base address is shown.

So yesterday I ran isprelinked on Acer libs and recreated prelink-linux-arm.map for Liquid. Then I built test version of webkit (libwebcore.so), put it into /system/lib replacing version from Acer and rebooted the phone - it worked! I can not share prelink map at the moment - it is at my home PC and I don't have remote access. I will share this file in the evening, but you can make it yourself, actually.

How to make prelink map? Quite simple. First of all you need to create isprelinked binary. cd to your Android source (cd ~/mydroid as in docs) and run "make isprelinked" (without quotes, of course). You will get app binary in a while, it will be somewhere in ~/mydroid/out/host/bla-bla-bla. The correct path will be shown in console once compilation is done.

Next step is run isprelinked over Acer binaries. It is quite simple, but will take some time. Copy all libs from your Liquid to some folder, for example to ~/acer-libs. Now open original prelink map (make a backup!), copy its contents to empty text file, in this new text file remove comments and base addresses, leave only lib names. Put a new line at top with full path to isprelinked and merge all lib names into single line with spaces between. You should have text file with one line looking like this:

~/mydroid/out/host/tools/isprelinked libdl.so libc.so libstdc++.so

This line will be very long (: Now go back into console, cd ~/acer-libs and run this BIG line. It will fail (: Because this list has some libs which Acer does not have. It will fail WITHOUT telling which lib is missing. But you will see base addr of previous lib. So find all unneeded libs and remove them from command line. Hell of a work, actually. But once again - I'm not at home, I can not paste correct line at the moment. Sorry.

Once isprelinked runs clean without errors you will see a list of all libs and their base addresses. Remove ":" character between lib name and address, paste it into prelink-linux-arm.map replacing all previous contents (you made a backup, right?) and this part is finished - now you have all base addresses needed for successful compilation of system binaries.

But if you run compilation now it will fail - apriori will tell you that lib addresses are out of bound. You need to modify prelinkmap.c. There is a line:

#define PRELINK_MIN 0x90000000

Change it to:

#define PRELINK_MIN 0x50000000

And recompile apriori tool with "make apriori" from your ~/mydroid. Now you have a 100% Acer compatible build environment!

Now if you wish to compile any component just run "make SOMETHING" where SOMETHING is what you need to compile. For example, "make libwebcore" compiles WebKit (: This is the simplest way of compilation, but you also want to make Snapdragon optimizations generated. So you need to compile with additional option TARGET_ARCH_VARIANT to target Snapdragon. SD has armv7-a CPU inside. So final string for WebKit is "make TARGET_ARCH_VARIANT=armv7-a libwebcore". That will make default WebKit with all CPU dependent optimizations. Compilation result can be found in ~/mydroid/out/target/system/lib - full and correct path will be shown in console after compilation.

What does it all mean? Well, AOSP is finally possible! This will also be helpful for porting binaries from other non-acer ROMs - now you can easily rebase libs to Acer standard and everything will work.

Today I will put map file I've generated from Acer libs and will continue working on Flash support for 2.1. I also think I will compile Flash supporting WebKit with V8 JavaScript engine (like in Froyo), SVG support and I will look into animated GIFs issue. There will be two libwebcores from me: stock with Flash and full-blown (which may eat your RAM and kill CPU).



And what is this for? Sorry.. noob..

  • 0

#16
Auxx

Auxx

    Enthusiast

  • Members
  • PipPipPip
  • 217 posts

And what is this for? Sorry.. noob..


What does it all mean? Well, AOSP is finally possible! This will also be helpful for porting binaries from other non-acer ROMs - now you can easily rebase libs to Acer standard and everything will work.


Basically, if you are not ROM creator/hacker, then it has nothing to do with you (:

  • 0

#17
mirox3m

mirox3m

    Regular

  • Members
  • PipPip
  • 86 posts
  • Devices:Acer Liquid >> Galaxy S

.....Today I will put map file I've generated from Acer libs and will continue working on Flash support for 2.1. I also think I will compile Flash supporting WebKit with V8 JavaScript engine (like in Froyo), SVG support and I will look into animated GIFs issue. There will be two libwebcores from me: stock with Flash and full-blown (which may eat your RAM and kill CPU).


Congrats and thanks for your work!!! :(

Isn't it easier to port Froyo than enabling Flash on 2.1?

Edited by mirox3m, 01 June 2010 - 09:50 AM.

  • 0
Probably the first complete CAR PC in Europe http://goo.gl/hPUB

#18
liquid_it

liquid_it

    Enthusiast

  • Members
  • PipPipPip
  • 264 posts
Great job Auxx, thanks for sharing tech details, this is what I call a Community!
(not everyone on android scene is smart enough to understand that sharing knowledge is the best choice..)

I think I'll spend my night messing with aosp code.. :(

  • 0

#19
Auxx

Auxx

    Enthusiast

  • Members
  • PipPipPip
  • 217 posts

Congrats and thanks for your work!!! :(

Isn't it easier to port Froyo than enabling Flash on 2.1?

Of course it is! But many people are stuck with 2.1 (: Even with earlier versions. So my work will help them.

  • 0

#20
Mr.r9

Mr.r9

    Regular

  • Members
  • PipPip
  • 140 posts
  • Devices:Acer Liquid
Maybe you can contact Malez since he is working on Froyo?
I've no idea if either of you will benefit since Idon't develop but maybe something good might come out of it.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users