×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Aug 2006
    Posts
    8

    Adding compiler options to armcc using abld

    When using "abld.pl" to build an ARMV5 UREL project, I *allways* get the "-O2" switch to armcc!

    I would like to be able to override this, for example using OPTION keyword in the MMP-file.

    What happens now is:

    > abld build armv5 urel -i arm -v

    armcc -O2 ... and here goes the other options, such as --arm and -O3. This will result in that -O2 is used, allthough that the -O3 input parameter is specified.

    Very annoying - It would be nice to be able to alter the options without patching the CL_ARM.PM file in \epoc32\tools.

  2. #2
    Registered User
    Join Date
    Jun 2008
    Posts
    12

    Co-ask Re: Adding compiler options to armcc using abld

    I have the same trouble of unable to change the optimization levels.

    Please somebody give some advices...

  3. #3
    Registered User
    Join Date
    Aug 2003
    Location
    Oulu, Finland
    Posts
    1,122

    Re: Adding compiler options to armcc using abld

    You can add new options with the OPTION ARMCC keyword pair in your .mmp file.

    To change some implicit default options, edit epoc32\tools\compilation_config\armv5_abiv2.mk. In this case, the REL_OPTIMISATION definition.

    On the other hand, the -O2 is only supplied for release builds. Use a debug build instead if you can. It doesn't get -O2 and you can still supply additional options with the OPTION ARMCC mechanism.

    Lauri

  4. #4
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: Adding compiler options to armcc using abld

    i suggest you include below lines in your application MMP File for Symbian 9.x

    Code:
    #ifdef __ARMCC_2__
    OPTION                                      ARMCC --no_debug_macros -O2 -Otime
    #else //__GCCE__
    OPTION                                      GCCE -O2 -fno-unit-at-a-time

  5. #5
    Registered User
    Join Date
    Jun 2008
    Posts
    12

    RVCT vs GCCE Re: Adding compiler options to armcc using abld

    Thanks laa-laa and skumar_rao for your suggestions!

    I'm exploring different compiler options in order to maximize the speed of my application. Before use RVCT2.2, I used the free GCCE compiler come along with Carbide IDE. But the speed of the binary generated by GCCE is not satisfactory.

    The approach works for me is suggested in ARM5 build customization:
    http://www.symbian.com/developer/tec...%2earm5%2dcust

    In summary, generate different BSF files with different optimization options. For example, for Otime option, I used:

    thumb_options -thumb -Otime
    arm_options -arm -Otime
    kernel_options -arm -Otime

    And in bld.inf file, I used

    PRJ_MMPFILES
    my_proj.mmp BUILD_AS_ARM

    to force the code to be built using ARM instruction set rather than THUMB.

    My only hope is to maximize the speed of the code rather than to minimize its size. To my surprise, after tried all optimization options:
    -O0,-O1,-O2,-O3,-Otime,-Ospace. The speed of the generated binary can not even match that of GCCE. But the code size is much smaller comparing to that of GCCE. For example, the RVCT binaries:
    O0: 50Kb
    O1: 47Kb
    O2: 46Kb
    O3: 46Kb
    Otime: 54Kb
    Ospace: 46Kb

    The GCCE binary: 65Kb

    Can you please help to analysis this situation? Because I am expecting RVCT can render faster binary than GCCE, and this is not what I see.

  6. #6
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: Adding compiler options to armcc using abld

    Have you tried compiler options given by me. those were the most optimized compiler options for me.

  7. #7
    Registered User
    Join Date
    Jun 2008
    Posts
    12

    Re: Adding compiler options to armcc using abld

    Hi, skumar_rao,

    As you suggested, I've put:

    #ifdef __ARMCC_2__
    OPTION ARMCC --no_debug_macros -O2 -Otime
    #else //__GCCE__
    OPTION GCCE -O2 -fno-unit-at-a-time
    #endif

    in the mmp file, then "clean project" and "rebuild project" for "Phone Release (ARMV5) [S60_3rd_FP2_Beta]. But somehow it has no effects, I don't see any changes when armcc is called:

    armcc -O2 --diag_suppress 66,161,611,654,997,1152,1300,1464,1488,6318,6331 --diag_error 1267 --thumb --fpu softvfp --exceptions --exceptions_unwind -D__MARM_THUMB__ -D__MARM_INTERWORK__ --cpu 5T --enum_is_int -Ono_known_library --fpmode ieee_no_fenv --export_all_vtbl --no_vfe --apcs /inter --dllimport_runtime -c -DNDEBUG -D_UNICODE -D__SYMBIAN32__ -D__S60_32__ -D__S60_3X__ -D__SERIES60_3X__ -D__ARMCC__ -D__EPOC32__ -D__MARM__ -D__EABI__ -D__ARMCC_2__ -D__ARMCC_2_2__ -D__MARM_ARMV5__ -D__DLL__ -D__SUPPORT_CPP_EXCEPTIONS__ -D__PRODUCT_INCLUDE__=\"\Symbian\9.3\S60_3rd_FP2_Beta\epoc32\include\variant\Symbian_OS_v9.3.hrh\" --cpp --preinclude \Symbian\9.3\S60_3rd_FP2_Beta\epoc32\include\RVCT2_2\RVCT2_2.h -J \Symbian\Projects\SBDecoderS60_dev\sc_2D_slow\src -J \Symbian\Projects\SBDecoderS60_dev\sc_2D_slow\inc -J \Symbian\9.3\S60_3rd_FP2_Beta\epoc32\include -J \Symbian\9.3\S60_3rd_FP2_Beta\epoc32\include\variant -o \Symbian\9.3\S60_3rd_FP2_Beta\EPOC32\BUILD\Symbian\Projects\my_proj\my_proj1\group\MY_PROJ1\ARMV5\urel\my_src.o \Symbian\Projects\my_proj\my_proj1\src\my_src.cpp

    I don't know if I did anything wrong or not. So I have to generate the BSF file with the setting:
    thumb_options -thumb -Otime
    arm_options -arm -Otime
    kernel_options -arm -Otime

    Then the armcc is called as below:

    armcc -O2 --diag_suppress 66,161,611,654,997,1152,1300,1464,1488,6318,6331 --diag_error 1267 -thumb -Otime -D__MARM_THUMB__ -D__MARM_INTERWORK__ --cpu 5T --enum_is_int -Ono_known_library --fpmode ieee_no_fenv --export_all_vtbl --no_vfe --apcs /inter --dllimport_runtime -c -DNDEBUG -D_UNICODE -D__SYMBIAN32__ -D__S60_32__ -D__S60_3X__ -D__SERIES60_3X__ -D__ARMCC__ -D__EPOC32__ -D__MARM__ -D__EABI__ -D__ARMCC_2__ -D__ARMCC_2_2__ -D__ARMV5OTIME__ -D__MARM_ARMV5__ -D__DLL__ -D__SUPPORT_CPP_EXCEPTIONS__ -D__PRODUCT_INCLUDE__=\"\Symbian\9.3\S60_3rd_FP2_Beta\epoc32\include\variant\Symbian_OS_v9.3.hrh\" --cpp --preinclude \Symbian\9.3\S60_3rd_FP2_Beta\epoc32\include\RVCT2_2\RVCT2_2.h -J \Symbian\Projects\SBDecoderS60_dev\sc_2D_slow\src -J \Symbian\Projects\SBDecoderS60_dev\sc_2D_slow\inc -J \Symbian\9.3\S60_3rd_FP2_Beta\epoc32\include -J \Symbian\9.3\S60_3rd_FP2_Beta\epoc32\include\variant -o \Symbian\9.3\S60_3rd_FP2_Beta\EPOC32\\BUILD\Symbian\Projects\my_proj\my_proj1\group\MY_PROJ1\ARMV5\urel\my_src.o \Symbian\Projects\my_proj\my_proj1\src\my_src.cpp

    Now I can see -Otime is present in this case. But I don't know why the -O2 options is always there. And it seems to me the -thumb option is also always there. And my understanding is THUMB code is generally slower than ARM code. That's why I modified the bld.inf file to force ARM instruction set been used.

    Have you ever compared the code size and speed of code geneated by RVCT and GCCE? My expectation is somehow contradict to what I saw, don't know where I made any mistakes.

  8. #8
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: Adding compiler options to armcc using abld

    Hi,
    I have not gone that deep in to changing any scripts. but i have seen that by using these options i got reduced in size.

    But nice to know that we can change the build environment to this extent.

Similar Threads

  1. Compiler Options
    By rlevenberg in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 17
    Last Post: 2008-09-02, 10:35
  2. abld doesn't compile (VC++6 ok!)
    By doctordwarf in forum Symbian
    Replies: 2
    Last Post: 2005-02-21, 07:13
  3. please guide me for start to develop
    By InsOMniaCCodER in forum Symbian
    Replies: 5
    Last Post: 2005-01-04, 18:38
  4. abld doesn't compile (VC++6 ok!)
    By doctordwarf in forum Symbian Tools & SDKs
    Replies: 0
    Last Post: 2003-10-15, 11:46
  5. Compiler Options in MMP file
    By andy_j_000 in forum Symbian Tools & SDKs
    Replies: 0
    Last Post: 2003-09-02, 17:35

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×