Compiler FAQ


  1. How can I silently install the compiler?
  2. What is the handling when the compiler returns a C9932E error?
  3. What are the recommended operations when the atan2f function is called as atan2f(0.f, 0.f)?
  4. How can I make all warnings errors?
  5. Non-finite values cannot be handled when specifying --fpmode=fast.
  6. The application cannot be built when specifying --enum_is_int.
  7. How do I deal with bugs related to optimization?
  8. A compile error occurs when using the to_string function in std::bitset.
  9. In forward declarations and actual declarations, no compile errors occur if classes and structures are not specified correctly.
  10. How do I hide messages output by the compiler when using a precompiled header?
  11. When a static function call depends on a template argument, a compile error occurs.
  12. How do I generate binary files from source files written in C?
  13. How do I display warning message #94 "The array size must be larger than zero" when specifying --gnu?
  14. How do I display a warning when implicitly casting from a floating point number to an integer?
  15. With arrays of structures, optimization results in calls to aeabi_vec_ctor_nocookie_nodotr even though it should not be called.
  16. How do I output a warning when an auto variable having the same name as a member variable is defined?
  17. How do I use the --ltcg option?
  18. Is it advisable to use VFP vector mode?
  19. What are the operations related to exceptions when using the --fpmode=ieee_no_fenv option?
  20. During builds, the following error occurs: #1620-D:Internal fault:translation failed. Please contact your supplier (ipa_nfuncs).
  21. During Release builds, code that performs this pointer NULL checks is not generated.
  22. How do I perform inline expansion at the object level?
  23. How do I allocate from a stack rather than from a heap?
  24. Should the compile option sequence be uniform between the side that creates the precompiled header and the side that references it?
  25. Sometimes weak symbols are given priority and linked before non-weak symbols in the library.
  26. When using #pragma diag_suppress in a header to precompile, the pragma statement is enabled when generating the precompiled header, but is not enabled when using the precompiled header.
  27. No error occurs even when the class name is duplicated when defining member functions.
  28. How do I search the include path recursively?
  29. 16 or 32 cannot be specified in __align.
  30. What is the difference between optimizing using -Otime -O3 and -Otime -O2?
  31. What is diagnostic message #2819-D?
  32. Are there any plans for the inline assembler to support notation similar to the GCC assembler instruction template?
  33. An error occurs when using a precompiled header created using --create_pch.
  34. Can relative paths be used with the -I option when using --create_pch or --use_pch?
  35. Even when specifying --split_sections, functions coded in embedded assembly language are not dead-stripped.
  36. How can I know the position of the padding inserted by the compiler?
  37. Code is not optimized if it makes multiple calls to functions for which __forceinline is specified.
  38. What are the character codes that can be used with the compiler?
  39. What are the operations of the static initializer?
  40. What is the handling for array pointers?
  41. How do I use global variables in anonymous namespaces from inline assembly code?
  42. Do you plan to support C++0x (C++11) with ARMCC?
  43. A fast build links to ARM v4 libraries instead of ARM v5T libraries.
  44. If the compiler is changed to ARMCC 5.x, warnings appear that previously did not appear.
  45. If the compiler is changed to ARMCC 5.x, error #3093 occurs when --gnu is not specified.
  46. When changing to ARMCC5.04, the L6244E error occurs when linking with the DLL module.
  47. How can I reduce build time?
  48. How do I build without generating a map file?
  49. After I changed to ARMCC5.04, the debugger started malfunctioning.

1.

Q.

How can I silently install the compiler?

A.

If the silent installation of the compiler does not go well, the EULA agreement portion may have failed.


When specified as shown below, installation is possible.

 start /wait msiexec /qn /i nintendo.msi /l*v nintendo_install.log EULA=1
 
 [Options]
         /qn:            quiet install mode
         /i:             install
         /l*v            log all the information
         EULA=1  accepting EULA from command line


2.

Q.

How can I handle the C9932E error when it is returned by the compiler?

The compiler sometimes outputs the following message and encounters an error during compilation.

Error: C9932E: Cannot obtain license for Compiler (feature besp_compiler_00) with license version >= 4.0
System clock has been set back

For further information, refer to the FLEXnet Licensing documentation,
available at "www.acresso.com".

A.

The compiler license file randomly checks the files on the PC, and raises this error if it finds a file with an invalid timestamp (a time set in the future).


If you get this error, use Windows file search to find any files with timestamps set in the future, and fix the timestamps. This resolves the error.


Specifically, you can fix the files by running the following commands in cygwin.

$ cd /cygdrive/c
$ find -type f -mmin -1 -exec touch {} \;
$ find -type f -amin -1 -exec touch {} \;
Note that files in the Recycle Bin might also have been found by the check. If this action does not solve the problem, try emptying your Recycle Bin.


3.

Q.

What are the recommended operations when the atan2f function is called as atan2f(0.f, 0.f)?

In the CTR development environment (RVCT4.0), when the atan2f function is called as atan2f(0.f, 0.f), NaN is returned. But shouldn't it return 0.0 instead?

A.

According to the ISO specification, the operations when out-of-bounds arguments are passed to this function are left to the implementer. The RVCT4.0 ARM C library returns NaN.

For information about the operations of other functions, see section 2.14 of the package's libraries guide (rvct_libraries_guide.pdf).

With ARMCC4.1, special-case math functions return 0.0f to conform with POSIX/C99 requirements.


4.

Q.

How can I make all warnings errors?

A.

You can make all warnings into errors by adding --diag_error=warning to the command-line options.


5.

Q.

Non-finite values cannot be handled when specifying --fpmode=fast.

A.

When --fpmode=fast is specified, the application has no support at all for handling of non-finite values as regulated by the IEEE standard. Also, the application is not guaranteed to have the same operations at all optimization levels.
When you expect that a calculation might yield NaN, handle it by taking steps such as branching the process in advance with the isnan function.


6.

Q.

The application cannot be built when specifying --enum_is_int.

A.

The CTR-SDK is built with --enum_is_int disabled.
You cannot build libraries or applications where this option is changed.
There are no plans to enable the --enum_is_int option in the CTR-SDK.


7.

Q.

How do I deal with bugs related to optimization?

A.

Currently, many bugs seem to be occurring when developers use the -O3 -Otime combination.
This combination of options enables the loop optimization feature, but there are several cases where invalid optimization is performed with this feature.

The following are possible workarounds.

■ If you cannot identify the exact function that generates the invalid code:

- Add the following statement to the start of the source code to change the optimization level of the source code.

#pragma Ospace

- Change the optimization level only when a specific optimization level has been specified.

#if __OPTIMISE_LEVEL == 3
#ifdef __OPTIMISE_TIME
#pragma Ospace
#endif
#endif


■ If you can identify the exact function that generates the invalid code:

- Change the optimization level only for that specific function.

#pragma push
#pragma Ospace
void foo()
{
  ...
}
#pragma pop


- Disable only the loop optimization feature that is enabled by -O3 -Otime.

#pragma push
#pragma Ono_vast
void foo()
{
  ...
}
#pragma pop

Note: This Ono_vast option is an undocumented private option, but you can specify it to disable only the loop optimization feature.


8.

Q.

A compile error occurs when using the to_string function in std::bitset.

When I compile code similar to the following, an compile error occurs in the (a) locations.

std::string  foo()
{
 std::bitset<10>  bits = 100;
 std::string  str = bits.to_string();    // ---(a)
 return str;
}

A.

This symptom is per specification, because to_string is defined as using template member functions with the C++ standard library specifications.

The following shows the proper call method.
std::string str = bits.to_string< char, std::char_traits, std::allocator >();

In addition, although it is not recommended, you can also use non-template member function versions by passing _RWSTD_NO_MEMBER_TEMPLATES to the compiler as a macro name.

Example:
armcc -c test.cpp -D_RWSTD_NO_MEMBER_TEMPLATES


9.

Q.

In forward declarations and actual declarations, no compile errors occur if classes and structures are not specified correctly.

A.

This functionality is in accordance with the compiler design.

Because the only difference between struct and class in C++ is the default access specifier, no warnings or errors occur unless the specifier is incorrect in the source code.


10.

Q.

How do I hide messages output by the compiler when using a precompiled header?

A.

You can suppress messages related to precompiled headers by adding the --no_pch_messages command.


11.

Q.

When a static function call depends on a template argument, a compile error occurs.

A.

By design only names that have external linkage are targeted for lookup. This functionality follows the recommended procedure for dependent name lookup defined by section 14.6.4.2 in the C++ Standards.

http://www.csci.csusb.edu/dick/c++std/cd2/template.html#temp.dep.candidate

However, despite this design, in RVCT the --no_dep_name option yields the same results as GCC or VC++ in regard to dependent names.
When you add the --no_dep_name option, you can suppress errors because this disables dependent name lookup during template parsing. For more information, see the --dep_name, --no_dep_name section in the Compiler Reference Guide.


12.

Q.

How do I generate binary files from source files written in C?

I want to use armcc and armlink to create AXF files from source code files written in C, and then use fromelf to create binary files, but I get an L6048U error when linking.

A.

Unfortunately, that method no longer works in RVCT4.0 20100909 and later versions because of the license protection mechanism.
We are considering other methods.


13.

Q.

How do I display warning message #94 "The array size must be larger than zero" when specifying --gnu?

A.

Warning message #94 cannot be displayed when --gnu is specified.


14.

Q.

How do I display a warning when implicitly casting from a floating point number to an integer?

A.

The current compiler does not have this type of feature.
Additional features are being discussed, but there are no plans to implement them in ARMCC 5.x.


15.

Q.

With arrays of structures, optimization results in calls to aeabi_vec_ctor_nocookie_nodotr even though it should not be called.

In the following code, the constructor should not be optimized when a default constructor is defined, but aeabi_vec_ctor_nocookie_nodotr is called anyway.

If the default constructor is not defined, this symptom does not occur.

struct Point
{
 int x;
 int y;
 int z;

 // Comment this out to see "inlined" version
 Point() {}
};

struct Line
{
 Point ends[2];
};

extern "C" void nnMain()
{
 Line lines[10] __attribute__((unused));
 while(1){}
}

A.

The current compiler does not perform this type of optimization.
Fixes are being discussed, but there are no plans to implement them in ARMCC 5.x.


16.

Q.

How do I output a warning when an auto variable having the same name as a member variable is defined?

A.

No such warning is currently output.
Additional features are being discussed, but there are no plans to implement them in ARMCC 5.x.

17.

Q.

How do I use the --ltcg option?

A.

Currently, the --ltcg option cannot be used.
We are considering improvements so that it can be used, but we do not have specific plans.

You can have the same results by using the --multifile feature.


18.

Q.

Is it advisable to use VFP vector mode?

A.

There is no problem in using the VFP vector mode.
Section 5.17 VFP Vector Mode of the document included in the RVCT package (DUI0204IJ_rvct_assembler_guide.pdf) mentions the plan to stop using VFP vector mode. But this plan does not mean that the CTR's VFP vector mode will be discontinued. The document also says that parallel processing is possible by performing SIMD (single instruction, multiple data) processing. But VFP involves numerous computations performed serially, not in parallel, so the meaning is not "parallel processing."


19.

Q.

What are the operations related to exceptions when using the --fpmode=ieee_no_fenv option?

The compiler reference guide states that exceptions are not generated when the --fpmode=ieee_no_fenv option is used, but when debugging in fpmode, the process sometimes terminates.

A.

With CTR-SDK you must specify --fpmode=fast. There is no support for operations with the --fpmode=ieee_no_fenv option.

As it says in the compiler manual, the following exceptions are no longer generated when you specify --fpmode=ieee_no_fenv.

  • Invalid operation (such as attempting to find the square root of a negative number).
  • Division by 0.
  • Overflow. (The result is too large to be correctly expressed.)
  • Underflow. (The result is nonzero but too small to be expressed as a regular number, and therefore inaccurate.)
  • Inaccuracy.

Operations when Signal NaN or Quiet NaN is used as an operator are described in Table 17-2 QNaN and SNaN in Section 17.2.3 Decision to Implement the IEEE 754 Standard, in Chapter 17 VFP Programmer Model, in the Technical Reference Manual.

For example, consider using --fpmode=ieee_no_fenv. The default NaN mode is off, but if Quiet NaN is in the operand with a FCMPE instruction (equivalent to VCMPE), the description in the table is: "INV is set. The operation process is bounced in the support code." This description indicates that the input exception flag is set and an exception occurs.

On the other hand, if --fpmode=fast or --fpmode=std is set, an exception is not generated because a library that turns NaN mode on by default is linked by _fp_init.

If an object compiled using --fpmode=fast or --fpmode=ieee_* is included, the linker performs standard IEEE standard initialization as when using --fpmode=ieee_no_fenv and the default NaN mode is off.

For these reasons, if --fpmode=ieee_no_fenv is used in the CTR environment, the default NaN mode is off for the VFP initialization section and exception handling occurs.


20.

Q.

During builds, the following error occurs: #1620-D:Internal fault:translation failed. Please contact your supplier (ipa_nfuncs).

A.

This internal error display is an internal fault string output by the diagnostic message, and is not an error.

This message is generated when using the --remarks option, and indicates why optimizations failed.
In this case, the message displayed indicates that optimization has failed because the conversion unit includes more than 10,000 functions.
To prevent this message from appearing and ensure that optimization works, split these functions among multiple conversion units so that no single unit has more than 10,000 functions.


21.

Q.

During Release builds, code that performs this pointer NULL checks is not generated.

A.

When the this pointer NULL state exists, implementation when calling a member function is undefined.
With RVCT, because the code for the NULL check during optimization is deleted by default, this implementation is working as designed.

By using the --allow_null_this command-line option, the this pointer NULL check is enabled and the deletion due to optimization can be disabled.


22.

Q.

How do I perform inline expansion at the object level?

When I specify --inline with the linker, is there a way to perform inline expansion at the linker level even with somewhat complex functions?

A.

Inline expansion with the linker is a feature that inserts the body of a function in the compiler-generated code where the function is called. The linker is not capable of complex inlining.
Consider using the --multifile option.


23.

Q.

How do I allocate from a stack rather than from a heap?

A.

From ARMCC4.1 b640, allocations can be made from stacks by using the alloca function.
Currently, there are no plans to support this with RVCT 4.0.


24.

Q.

Should the compile option sequence be uniform between the side that creates the precompiled header and the side that references it?

A.

The compiler gets the options from the command line or from the VIA file, sorts them by type, and then uses them.
Even if different types of compiler options are specified between multiple applicable options (-I, for example), if the order matches after sorting by type, the command-line specifications are recognized as the same.

For example:
  --create_pch=file.pch -O3 -Iaaa -Otime -Ibbb
  --use_pch=file.pch -O3 -Otime -Iaaa -Ibbb

The command-line specifications are
  -O3 -Otime -Iaaa -Ibbb
They are sorted by this type order and the precompiled header can be used.
The options that work this way are those that can be specified multiple times, such as -D/-U/-I/-J/--preinclude.

For cases such as --diag_suppress where multiple elements can be set with a single option specification, the elements are simply concatenated before processing.

For example:
  --diag_suppress=1 --diag_suppress=2 --diag_suppress=3

is converted as follows.
  --diag_suppress=1,2,3

On the other hand,
  --diag_suppress=1,3 --diag_suppress=2

caution is required because the following concatenation occurs.
  --diag_suppress=1,3,2
You can use either of the following to check the results of sorting options by type.
  1. Display in standard output with --show_cmdline.
  2. When you specify --asm, output them to the portion displayed by ; commandline armcc of the assembler output file.


25.

Q.

Sometimes weak symbols are given priority and linked before non-weak symbols in the library.

A.

Depending on the method of using the non-weak symbols, sometimes non-weak symbols in the library cannot replace weak symbols that are linked earlier.
This functionality is part of the RVCT linker specifications.

The following information comes from section 4.1.19 __weak in the RVCT Compiler Reference Guide.

--
The linker does not load functions or variables from the library, except in cases where the functions or variables are used as non-weak with another compiler.
--

When you try to replace weak symbols with the non-weak symbols in the library, pay careful attention to whether they are actually replaced.
Improvements to these specifications were discussed, but there are no planned changes.


26.

Q.

When using #pragma diag_suppress in a header to precompile, the pragma statement is enabled when generating the precompiled header, but is not enabled when using the precompiled header.

A.

This is correct functionality for the precompiled header mechanism.
If this functionality is a problem, consider using one of the following methods.

  1. Add #pragma diag_suppress to a source code file (specify it after #include) instead of a header file.
  2.   Example of the main.cpp source code file:
      #include "main.h"
      #pragma diag_suppress 177
    
  3. Write #pragma diag_suppress in a different header file to exclude it as a precompiled header target.
  4.     Example of the main.cpp source code file:
        #include "main.h"
        #pragma hdrstop // End precompiled header generation.
        #include "user.h" // Include  #pragma diag_suppress in this file.
    


27.

Q.

No error occurs even when the class name is duplicated when defining member functions.

No error is detected in the following code.

Example:
class MyClass {
public:
 MyClass();
 ~MyClass();
 void DoAnything();
};
MyClass::MyClass::MyClass() {} // no error
MyClass::MyClass::MyClass::~MyClass() {} // no error
void MyClass::MyClass::MyClass::MyClass::DoAnything() {} // no error

A.

This functionality is consistent with the recommendations in Chapter 9.0.2 of the C++ Standards Specifications.

A class-name is inserted into the scope in which it is declared
immediately after the class-name is seen. The class-name is also
inserted into the scope of the class itself; this is known as
the injected-class-name. For purposes of access checking, the
injected-class-name is treated as if it were a public member
name.

[Translation in JIS X3014]
A ≪class-name≫ is added to the declared valid scope immediately after the ≪class-name≫ appears.
The ≪class-name≫ is also added to the valid scope of the class itself (called the injected-class-name).
For access checking, injected-class-name is treated as if it were a public member name.
This class name is the class name inserted into the scope of that class (injected-class-name).


28.

Q.

How do I search the include path recursively?

A.

There is no way to search the include path recursively.
There are no plans to add this feature.


29.

Q.

16 or 32 cannot be specified in __align.

A.

This functionality is in accordance with the compiler design.
Support of this feature is not planned, because it might also affect other tools.


30.

Q.

What is the difference between optimizing using -Otime -O3 and -Otime -O2?

A.

Optimization using -Otime -O3 has the following characteristics.

  • High level loop optimization (VAST).
  • Scheduling before register allocation.
  • During inline optimization, it makes more inline functions by increasing the inline threshold.
  • With -O3 in RVCT4.0, --multifile is used implicitly, and when multiple source files are specified from the command line, they are compiled as a single concatenated source code file.


31.

Q.

What is diagnostic message #2819-D?

When I use virtual functions in a template class, the #2819-D diagnostic message is displayed. But what does The implicit instantiation of the template member function is selected as a key function mean?

A.

This diagnostic message notifies you that instantiation was carried out implicitly when the key function was a template member function.

(The key function is the first virtual function declared in the class that is not an inline function or a pure virtual function.)

The following is a workaround.

  • Make the function in question an inline function.
  • Specify the --no_implicit_key_function option.


32.

Q.

Are there any plans for the inline assembler to support notation similar to the GCC assembler instruction template?

A.

We are considering adding this feature as part of our long-term planning, but there are no plans to implement it in ARMCC 5.x.


33.

Q.

An error occurs when using a precompiled header created using --create_pch.

A.

Note the following cautions when using precompiled headers created with --create_pch.

  • When you use the -I or -J options or specify an #include statement in the source code, do not use a relative path from the source file directory (such as #include "..\..\test.h").
  • Specify --sys_include as a compile option, and exclude the source file directory from the include search path.


34.

Q.

Can relative paths be used with the -I option when using --create_pch or --use_pch?

A.

Currently, there are no plans to support this because of the problem of maintaining compatibility with existing functionality.


35.

Q.

Even when specifying --split_sections, functions coded in embedded assembly language are not dead-stripped.

A.

By design, --split_sections has no effect on functions written in embedded assembly language.
As shown below, you must explicitly set the section names per individual function using #pragma arm section statements.

#pragma push

#pragma arm section code="AAAA_Asm"
AAAA_Asm() {...}
#pragma arm section code="BBBB_Asm"
BBBB_Asm() {...}
#pragma arm section code="CCCC_Asm"
CCCC_Asm() {...}
: None.

#pragma pop


36.

Q.

How can I know the position of the padding inserted by the compiler?

The following warning is displayed when padding is necessary for aligning classes or structures, but is there a way to know where and how many bytes of padding have been inserted?

#1301-D: padding inserted in XXXXX

A.

Not currently.
There are no plans to implement this feature in ARMCC 5.x.


37.

Q.

Code is not optimized if it makes multiple calls to functions for which __forceinline is specified.

When I use the -O3 -Otime options to build code that makes multiple calls to functions for which __forceinline is specified, optimization is not performed as expected. Are improvements planned?

A.

We are considering improvements, but there are no plans to support this feature in ARMCC 5.x.
If you use macros, only the last function call out of all the duplicated calls is left as code.


38.

Q.

What are the character codes that can be used with the compiler?

A.

The treatment of multi-byte code with ARMCC depends on the OS used by the host.
With Windows versions, it is treated as Shift-JIS or UTF-8 (with BOM), and EUC code is not supported.

Also, character codes of object files after compilation are made into the same character codes as the source code for multibyte characters and into UTF-16LE for wide strings.


39.

Q.

What are the operations of the static initializer?

When writing a constructor inline, the following source code build is executed.

---
- A.cpp

#include <nn.h>

class C {
public:
    C() {
        NN_LOG("AAA:%s(%d)\n", __FILE__, __LINE__);
    }
};

C A;

---
- B.cpp

#include <nn.h>

class C {
public:
    C() {
        NN_LOG("BBB:%s(%d)\n", __FILE__, __LINE__);
    }
};

C B;
---

When this code is executed, the instance A, B static initializer can call only one constructor.
Isn't it proper for an error to occur with the link or for each constructor to be called?

A.

When specifying --retain=calls in the build options, and global object initialization due to the static initializer, functions not expanded inline are called.

__sti___5_A_cpp PROC
        PUSH     {r4,lr}
        LDR      r0,|L1.16|
        Calls BL       _ZN1CC1Ev    ; C::C()
        POP      {r4,pc}
        ENDP
This causes a reference to the class C constructor _ZN1CC1Ev.
The linker resolves this issue, but the class C constructor _ZN1CC1Ev is defined with the same name in multiple objects, and these objects are used by the same name common group (COMGROUP).

AREA ||i._ZN1CC1Ev||, COMGROUP=_ZN1CC1Ev, CODE, READONLY, ALIGN=2

_ZN1CC2Ev                  ; Alternate entry point
_ZN1CC1Ev PROC
As described in section 5.2 Deleting Common Groups and Common Sections of the Using the Linker documentation, the linker maintains the group that was detected first and deletes all others.

For this reason, a linker error for duplicated definitions does not occur.

When --retain=calls is not specified, the constructor is expanded inline and the initialization of global objects is as follows.

__sti___5_A_cpp PROC
        MOV      r2,#6
        ADR      r1,|L1.16|
        ADR      r0,|L1.52|
        B        _ZN2nn3dbg6detail6PrintfEPKcz
As a result, each constructor is called in the same conversion unit.
When --no_inline is specified without --retain=calls, the constructor is not expanded inline. Be careful when intentionally using a constructor of the same name with other compiler units.


40.

Q.

What is the handling for array pointers?

When the following code is compiled, it is passed over and there is no error.

char (*str)[256] = new (char(*)[256])[2];
Because the right side is "pointer to the array" and the left side is the start address of the "array of pointers to the arrays," the indirect reference level is different.
For the left side, is the array of pointers to the array something that can be made new?
(This cannot be done with Visual Studio 2008.)

A.

You can replace that code with the following code.

  typedef char(*the_type)[256];
  the_type str = new (the_type)[2];
The expression new (the_type)[2] is not valid with C++, so this error is in a mode that specifies strict C++ standards (--strict).
Also, with --strict_warnings, a warning message is displayed.
In the default non-strict mode (--no_strict), it is handled as follows.
  the_type str = (new (the_type))[2];
the_type is a pointer to a 256-character array. (new (the_type)) allocates this pointer and returns this address.
(new (the_type))[2] performs this operation, and then handles the value returned as an array, and returns the second element (having the_type type).

It is the following when allocating an array of pointers to the arrays. (To be clear, typedef is also used.)

  typedef char array_type[256];
  typedef array_type *array_type_ptr;
  array_type_ptr *str = new array_type_ptr[2];
This code allocates an array that has two pointers to 256-character arrays as elements, and sets the first element for the pointer array in str.

The C++ standards state that using parentheses with new expression "can have surprising effects," so we normally recommend using typedef.


41.

Q.

How do I use global variables in anonymous namespaces from inline assembly code?

I can't get the address of a variable in an anonymous namespace. Code like the following causes the L6218E error to occur.

namespace{
 float  localValue;

 asm float *GetLocalValueAddr()
 {
     LDR    r0,=__cpp(&localValue)
     BX    lr
 }
}

main()
{
 NN_LOG("local Addr:%p\n",GetLocalValueAddr());
} 

A.

Multiple _asm functions in inline assembly code are connected within the same conversion unit. At compile time, armasm is called internally and these functions are combined into a single object. Symbols in an anonymous namespace do not support external linkage (export attributes). The localValue variable exists in the same anonymous namespace as the GetLocalValueAddr function, but the reference is not resolved when linking because the export attribute is not defined, causing a link error.

The __cpp keyword can only handle function addresses or data that use external linkage. To work around this issue, take the variable out of the anonymous namespace and use it as a non-static global variable.


42.

Q.

Do you plan to support C++0x (C++11) with ARMCC?

A.

- Support is being considered in ARMCC5.x.


43.

Q.

A fast build links to ARM v4 libraries instead of ARM v5T libraries.

A.

The default linker options select ARM v4 libraries (such as c_4.l), which only contain ARM instructions, when input objects only contain ARM code. ARM v5T libraries (such as c_5.l) are selected when input objects contain Thumb code.

Specify the --cpu=MPCore linker option to select the ARM v5T libraries (such as c_5.l) even when input objects only contain ARM code.

The --cpu=MPCore option has been added to the default linker options in the CTR-SDK 4.0 build rules.


44.

Q.

If the compiler is changed to ARMCC 5.x, warnings appear that previously did not appear.

A.

Because of the front-end compiler change in ARMCC 5.x, sometimes warnings appear that did not appear previously.
Although it is not the case that error-checking was intentionally enhanced, the warnings are correct.

The following warnings are examples of the warnings that might appear.

  • #177-D:variable "ooo" was declared but never referenced
  • #550-D:variable "ooo" was set but never used
  • #836-D:returning reference to local variable
  • #2938-D:the initialization of member "ooo" will be done before that of member "ooo"

45.

Q.

If the compiler is changed to ARMCC 5.x, error #3093 occurs when --gnu is not specified.

A.

The compiler supports unnamed unions or structures embedded in structures when the --gnu mode is specified or #pragma anon_unions appears in the source code.

Previously, however, even when neither of these two options were used, the compiler did not output the appropriate errors about the use of unnamed unions or structures.

Because this issue causes invalid code to be generated, ARMCC 5.x has been fixed so that errors are output.


46.

Q.

When changing to ARMCC5.04, the L6244E error occurs when linking with the DLL module.

A.

With the ARMCC 5.04 linker, the specifications have been changed so that --no_legacyalign is the default when a dynamic relocation is generated.

The CTR-SDK build system generates the L6244E error when linking to the DLL module because it does not support this specification change.
Also, when linking to DLL applications, the Too large section size error occurs when executing ctr_makerom32.

There are plans to support this specification in the CTR-SDK. For now, specify --no_force-dynamic-natural-alignment when linking to DLL applications and modules.

VSI-CTR Platform 2.3.4 and later versions support the --no_force-dynamic-natural-alignment option of ARMCC5.04 and later.


47.

Q.

How can I reduce build time?

A.

The following methods can be used to reduce build times.

1. Methods impacting the overall build time

- Use parallel execution.
When a build environment is equipped with multiple processors, the multiple compilers can be run in parallel
with the -j option for omake or VSI-CTR settings.
Also, shorter build times are expected for distributed build environments
by installing the third party tool "IncrediBuild Extension Package for Nintendo 3DS."

- Implement sufficient memory in the build environment.
When multiple compilers or linkers are run in parallel with the omake -j option, virtual memory is used beyond the implemented memory,
and there is a large impact on the build performance.
Also, if there is enough RAM, a favorable impact on the build performance by the system file cache can be expected.

- Place files used for the build on a high-speed disc.
By placing the files for input and output during build on a high-speed disc, you can expect
a reduction in the time required for inputting or outputting files to or from the compiler or linker.

  • Source code files
  • Header files
  • Library files
  • Intermediate file output folder
  • Output file folder
  • Folder specified by the TMP system environment variable

2. Methods impacting the compile time

- Adjust the header file search order.
By placing header files that are used more frequently toward the beginning of the header file search order specified with the -I option,
the time needed for header file searching during compile can be reduced.

- Use precompiled headers.
By using precompiled headers and processing frequently used header files in advance,
the process time for header files needed for each compilation can be expected to be shorter.

- Do not output unnecessary debug information.
You can reduce memory use and processes required during compilation
by not outputting debugging information for libraries that have been debugged. Also, the processing of debug information required during linking is also reduced.

- Combine files into compilation units.
By combining several small files into one file and then compiling rather than compiling several small files separately,
the compile time can be expected to be shorter with a reduction in the time for file input and output processing.

3. Methods impacting the link time

- Do not generate map files and call graphs.
By changing the setting in the SDK default build rules so that map files and call graphs are not generated,
the link time can be expected to be shorter.

- Do not generate a disassembly list.
The time to execute the fromelf command after linking can be reduced by
not generating a disassembly list that is generated with SDK default build rules.

- Reduce the debug information for the input object file.
The memory and processes required during linking can be reduced by
reducing the debug information in the library for the source files that are not debugging targets.

- Do not output debug information during partial linking to DLL applications or modules.
With the SDK default build rules, debug information is output during the
DLL partial link (linking by specifying the --partial option),
but this debug information is not needed during subsequent build processes or application debugging.
By not outputting debug information, the time for partial linking can be shortened and memory use can be reduced.

 Debugging information is no longer created during partial linking to DLL applications in CTR-SDK 7.2.1 or later. When using projects created with a CTR-SDK version earlier than 7.2.1 in VSI-CTR, use the --no_debug prelinker option for compatibility.


48.

Q.

How do I build without generating a map file?

A.

According to the default build rules of the SDK, the information specified for the following options is output to the map file (MAP file) specified by the --list option.

 --info, --map, --symbols, --verbose, --xref

If you do not want to generate this map file, do not specify these options and also do not specify the --list option to output just the minimum information to the console.

Change the LDFLAGS_INFO build variable in the SDK build rules.


49.

Q.

After I changed to ARMCC5.04, the debugger started malfunctioning.

A.

With the ARMCC 5.04 compiler, there are changes to the information in the output file (AXF file) that is referenced by the debugger. Debuggers that do not support these changes may not read the debug information correctly and malfunction.

To debug applications created using ARMCC 5.04, use PARTNER-CTR 5.70-040 (2014/01/23) or a later version.
For profiling, use Nintendo 3DS CPU Profiler 3.01f or a later version.




CONFIDENTIAL