This ad appeared in one of the post in which I had panned Yahoo mail for being unreliable.
All I can say is “Money tastes like Honey“
I recently installed Google Chrome on my machine and was pleasantly surprised to see this dialog.
I hope all browsers support this soon. User should be allowed to decide which search engine should be default search like he decides which web browser is the default browser.
I had posted a blog for “Building Froyo on Snow Leopard” previously and at that time I didn’t face any problems building Froyo but it looks like few make files have changed now. So I am writing this post as an update to my previous post.
Before starting on this, I would like to thank Tomas Isdal and andferno.
So I will note down all the steps involved in building Froyo on Snow leopard. You can refer android get source page for information. I have referred it for few of the steps involved in building android.
Step 1
Create a new partition that is a case-sensitive partition if you’re using a case-insensitive primary partition. You can refer to this for more info.
Step 2
You would also have to install Xcode 3.2 and 10.4 SDK. Xcode can be found in the installation disc. It can also be downloaded from Apple developers connection. Refer the attached image.
Step 3
Install Macports. There are two ways of doing so.
i. Download the source from this link and untar the file. Run the following commands
./configure
make
sudo make install
ii. My preferred method is to download the DMG from here. I used MacPorts-1.8.2-10.6-SnowLeopard.dmg from the list.
Step 4
Make sure that /opt/local/bin is in your path before /usr/bin by running
echo $PATH
If you don’t see /opt/local/bin, edit $HOME/.bash_profile and add the line
export PATH=/opt/local/bin:$PATH
(or the equivalent for other shells) after any other PATH-related lines. To verify that your path is now correct, open a new terminal and run echo $PATH again.
Step 5
Get the following packages from port:
POSIXLY_CORRECT=1 sudo port install libsdl git-core gnupg
NOTE: Restart the terminal
Step 6
Set an appropriate per-process file descriptor limit. To do this, add the following lines to your .bash_profile file:
# set the number of open files to be 1024
ulimit -S -n 1024
Step 7
Now check out the Froyo Source code to the case-sensitive partition created in step 1, please refer android get source page for more information.
Step 8
Snow leopard doesn’t have Java 1.5, it has Java 1.6. Since Leopard has Java 1.5 this step can be skipped on Leopard. On Snow Leopard we have two options.
i. Changing Android make file to build with Java 1.6.
Open “build/core/main.mk” and search for “grep ‘[ "]1\.5” and change that “5″ with a “6″. You will find it repeated two times. This trick was suggested to me by andferno.
ii. Install Java 1.5 on Snow Leopard.
curl -o java.1.5.0-leopard.tar.gz http://www.cs.washington.edu/homes/isdal/snow_leopard_workaround/java.1.5.0-leopard.tar.gz
tar -xvzf java.1.5.0-leopard.tar.gz
sudo mv 1.5.0 /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0-leopard
cd /System/Library/Frameworks/JavaVM.framework/Versions/
sudo rm 1.5.0
sudo ln -s 1.5.0-leopard 1.5.0
We have to set Java preferences. You can either manually open “Java Preferences.app” or use terminal and type
open /Applications/Utilities/Java\ Preferences.app
Change the preference to as shown in the image below. You would have to drag and drop different Java version to change the preference.
NOTE: Restart the terminal
Building the source and resolving errors
Build the source.
make -j2
You might face the following error first.
host C++: emulator-elff <= external/qemu/elff/dwarf_cu.cc
In file included from external/qemu/qemu-common.h:15,
from external/qemu/elff/elf.h:22,
from external/qemu/elff/elf_defs.h:20,
from external/qemu/elff/dwarf_defs.h:22,
from external/qemu/elff/dwarf_die.h:20,
from external/qemu/elff/elf_file.h:20,
from external/qemu/elff/dwarf_cu.cc:20:
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/stdarg.h:4:25: error: stdarg.h: No such file or directory
In file included from external/qemu/elff/dwarf_die.h:21,
from external/qemu/elff/elf_file.h:20,
from external/qemu/elff/dwarf_cu.cc:20:
external/qemu/elff/elf_alloc.h: In static member function ‘static void* DwarfAllocBase::operator new(size_t)’:
external/qemu/elff/elf_alloc.h:156: warning: ‘operator new’ must not return NULL unless it is declared ‘throw()’ (or -fcheck-new is in effect)
make: *** [out/host/darwin-x86/obj/STATIC_LIBRARIES/emulator-elff_intermediates/elff/dwarf_cu.o] Error 1
To fix this error go to “external/qemu/” and open “Makefile.android” file and change the following line
iMY_CFLAGS += -mdynamic-no-pic
to
MY_CFLAGS += -mdynamic-no-pic -I /Developer/usr/lib/gcc/i686-apple-darwin10/4.0.1/include/
Continue with the build process again and you are likely to come across following errors
In file included from external/v8/src/macro-assembler.h:87,
from external/v8/src/jsregexp.h:31,
from external/v8/src/ast.h:33,
from external/v8/src/compiler.h:31,
from external/v8/src/api.cc:33:
external/v8/src/arm/assembler-arm-inl.h: In constructor ‘v8::internal::Operand::Operand(const char*)’:
external/v8/src/arm/assembler-arm-inl.h:165: error: cast from ‘const char*’ to ‘int32_t’ loses precision
external/v8/src/arm/assembler-arm-inl.h: In constructor ‘v8::internal::Operand::Operand(const v8::internal::ExternalReference&)’:
external/v8/src/arm/assembler-arm-inl.h:172: error: cast from ‘v8::internal::byte*’ to ‘int32_t’ loses precision
In file included from external/v8/src/macro-assembler.h:87,
from external/v8/src/ic-inl.h:33,
from external/v8/src/assembler.cc:39:
external/v8/src/arm/assembler-arm-inl.h: In constructor ‘v8::internal::Operand::Operand(const char*)’:
external/v8/src/arm/assembler-arm-inl.h:165: error: cast from ‘const char*’ to ‘int32_t’ loses precision
external/v8/src/arm/assembler-arm-inl.h: In constructor ‘v8::internal::Operand::Operand(const v8::internal::ExternalReference&)’:
external/v8/src/arm/assembler-arm-inl.h:172: error: cast from ‘v8::internal::byte*’ to ‘int32_t’ loses precision
This may not be the only precision error you may get. If you come across any errors like “error: cast from ‘abc’ to ‘xyz’ loses precision“
Do the following. Open “build/core/config.mk” file and search for the following text.
PREBUILT_IS_PRESENT := $(if $(wildcard prebuilt/Android.mk),true)
and replace the above text with following text.
PREBUILT_IS_PRESENT := $(if $(wildcard prebuilt/Android.mk),true)
ifeq ($(HOST_OS),darwin)
HOST_GLOBAL_CFLAGS += -arch i386
HOST_GLOBAL_CPPFLAGS += -arch i386
HOST_GLOBAL_LDFLAGS += -arch i386
endif
Again continue the build process and you are likely to come across following error
host C: acp <= build/tools/acp/acp.c
host C++: libhost <= build/libs/host/pseudolocalize.cpp
host C: libhost <= build/libs/host/CopyFile.c
build/libs/host/CopyFile.c: In function ‘copyFileContents’:
build/libs/host/CopyFile.c:124: warning: format ‘%d’ expects type ‘int’, but argument 4 has type ‘ssize_t’
build/libs/host/CopyFile.c:124: warning: format ‘%d’ expects type ‘int’, but argument 5 has type ‘ssize_t’
host StaticLib: libhost (out/host/darwin-x86/obj/STATIC_LIBRARIES/libhost_intermediates/libhost.a)
ar crs out/host/darwin-x86/obj/STATIC_LIBRARIES/libhost_intermediates/libhost.a out/host/darwin-x86/obj/STATIC_LIBRARIES/libhost_intermediates/pseudolocalize.o out/host/darwin-x86/obj/STATIC_LIBRARIES/libhost_intermediates/CopyFile.o
host Executable: acp (out/host/darwin-x86/obj/EXECUTABLES/acp_intermediates/acp)
ld: warning: in out/host/darwin-x86/obj/EXECUTABLES/acp_intermediates/acp.o, file is not of required architecture
ld: warning: in out/host/darwin-x86/obj/STATIC_LIBRARIES/libhost_intermediates/libhost.a, file is not of required architecture
Undefined symbols:
"_main", referenced from:
start in crt1.10.6.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [out/host/darwin-x86/obj/EXECUTABLES/acp_intermediates/acp] Error 1
To fix this error open “darwin-x86.mk” present in “build/core/combo/” and find the following strings.
$(HOST_CXX) \
-dynamiclib -single_module -read_only_relocs suppress \
$(HOST_GLOBAL_LD_DIRS) \
and add the following strings after the above string.
$(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
$(HOST_GLOBAL_LDFLAGS) \
) \
Find the following strings
$(HOST_CXX) \
-Wl,-dynamic -headerpad_max_install_names \
$(HOST_GLOBAL_LD_DIRS) \
$(call normalize-target-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \
and add the following strings after the above string.
$(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
$(HOST_GLOBAL_LDFLAGS) \
) \
Start the build again and watch it fly. Feel free to revert back in-case of any queries.
There is something special about Monday mornings. For starters I don’t really feel like working and secondly I hardly remember any work I had done the previous week. Break of two days clears my mind.
Monday mornings are a new beginning forgetting the failures of the previous week and starting up new. I don’t like to keep any work pending over the weekend. But there are times when this can’t be done. The ghosts of my previous week come back to haunt me. What I am writing now was one of those experiences.
It was another lazy Monday morning and as usual I was late to office, I met my manager who assigned me work for the entire week and I came back to my cubicle to start-up with the assigned work.
I have two machines in my cubicle one is a Dell machine running Linux OS and the other a Mac mini running Macintosh(Snow Leopard). I know it sounds stupid “a Mac mini running Macintosh” but trust me when I say I have seen people using Windows XP on Mac book Pro and also I am sorry Apple fan boys, I don’t use my Macintosh machine a lot! I am currently hooked on to Linux(Ubuntu). I usually start my day by checking my mail on my Linux machine. So first think I did was to check my official mail and then I tried to open Gmail page and I got the following error.
I saw the error code “sec_error_expired_certificate” which mean that the certificate has expired. This actually makes sense but I know you would agree with me when I say, it is very hard to believe that Google hasn’t renewed their certificate. Then I happen to read the description “The certificate will not be valid till until Friday 18 December 2009 05:30 AM”. Holy cow! that day was 23 August 2010! Add to that the error message and the error code were contradictory to each other. I have seen Windows XP display such contradictory messages but never expected Firefox to follow Microsoft’s lead.
Since I had worked a bit on internet security related stuff, the first thing I did was to check the certificate.
Firstly I have a confession to make, the private and the public keys don’t really make any sense to me! The only thing that made sense was the date which seemed alright. So my conclusion was that, there was no problem with the certificate and this entire issue had something to do with my system. Although I love using Linux I don’t trust the OS completely. After all it’s a software and all software’s have bugs!
And since I couldn’t think of anything, I switched on my mac mini and connected to the Gmail page using Firefox. The page loaded without any issues.
I stared at my monitor with my mouth open and it was at this moment I felt like being hit by a lightning. I checked my Linux machine and did a change and Gmail was up and running on my Linux machine.
Okay, now it’s time to unlock the mystery. The lightning was actually the moment I remembered that I had changed the time and date settings of my Linux machine last week for a silly reason.
My silly reason : I wanted to fake the modified time of a file, so that I could fool my colleague(I am not telling who it is.). As they say “I was impaled by my own sword”.
Apple(iPhone) fights back.