Join Now

Finishing the immigration to GNU make

kcomex | 01 August, 2008 14:38

During last couple of weeks, I made the immigration of building Mozilla NSPR component with Carbide.C++ (still based on makemake and friends Perl scripts) to GNU make and autoconf friends. Here I will share some points I learned in this process.

First of all, if your open source project uses a lot of Writable Static Data (WSD), in theory even only one single variable, and they are used in dynamically linked library (DLL) target type, then your only choice is buying a RVCT compiler. Because GCCE compiler which ships with the S60 SDK has a defect that can not build a working DLL binary if there is WSD in it. This known bug is documented by Symbian already. Though in the document Symbian stated the problem is solved in a later GCCE release possibly, yet I had tried all GCCE releases which is later than 2005Q1C, then found some of them will generate an internal compiler error and some of them build the same defective binary almost the same as 2005Q1C. So I think I could give you the advice : try only GCCE compiler tools if it is shipped with Nokia or Symbian, otherwise you are spending your time on what has been proven already.

Then let's get back to the build tool chain immigration affair. Actually I observed all original makmake build process in Carbide.C++, and then try to copy all compiler and linker arguments to GNU make Makefile scripts. The work is not so hard, and the result is also convenient to verify. Here are some brief points need your attention:

  • Compiler/linker arguments are main additions feed to Makefile
  • Emulator builds and target device builds use different compiler/linker
  • Device builds will need post linker operations, elf2e32 is the tool we use
  • ActivePerl is used to calling the .RSS resource file compiling, other Perl probably won't work
  • Building statically linked library (.LIB target type) takes no post linker jobs to do, compared with .DLL and .EXE
Also, it really depends on the project scale you are working with. Like Mozilla NSPR component, it uses several config and make rules files to make targets for over two dozens operating systems, then finding which place is proper to add arguments takes longer than making the modify itself.
 
Finally, you could have a look at Bug 442706, the patch there will show you the modifications made against the original NSPR build scripts. A detailed description about how to build NSPR with GNU make/autoconf can be found at Mozilla Wiki
 
Cheers~ Laughing

 

Comments

GCCE bug

Sorcery-ltd | 02/08/2008, 00:11

Sorcery-ltd

Hi,

Have you reported this problem with none of the GCCE versions supporting WSD in a DLL to Symbian? I know they are aware of the issue for the current supported version but they really need to pay Code Sourcery to fix it!

Mark

re:gcce

kcomex | 02/08/2008, 00:23

kcomex

Hi Mark
Symbian said Code Sourcery had fixed this issue already, but the fix is not released due to other bugs. This is what I got from a professional Forum Nokia tech support.

Thanks

Sorcery-ltd | 02/08/2008, 20:39

Sorcery-ltd

Great - I really hope they get it resolved and released soon.

You must login to post comments. Login
 
 
Powered by LifeType
     
     RDF Facets:
     
     
     qfnZtopicQUqfnTopicZcppQ
     qfnZtopicQUqfnTopicZseriesE5f60Q
     qfnZtypeQUqfnTypeZBlogContentQ
     qfnZtypeQUqfnTypeZBlogE45ntryQ
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZWebpageQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX