0

Where is the documentation which describes the initialisation of the C++ standard library? The E2Studio project generator only adds the code:

extern “C” void __main()

{

static int initialized;

if (! initialized)

{

typedef void (*pfunc) ();

extern pfunc __ctors[];

extern pfunc __ctors_end[];

pfunc *p;

 

initialized = 1;

for (p = __ctors_end; p > __ctors; )

(*–p) ();

 

}

}

The syscalls are all implemented and stdin, stdout and stderr streams all work with C. What initialisation is required so C++ code:

std::cout << “Hello World\r\n”;

will work?

Best regards,

Adam.

GNU Tools Support コメント済
    • Hi Darius,

      Thanks for your help. I have installed 16.01, upgraded the tool chains for the project and associated libraries. Then changed the the vfpv3 option as described. Previously I had the settings so the project linked and worked with V14.02, now it is back to the arm-none-eabi-ld: cannot find -lstdc++ link error.

      E2Studio has the following archive file paths, in the order shown below:
      “${CONFIGDIR}”
      “${TCINSTALL}/lib/gcc/arm-none-eabi/${GCC_VERSION}/armv7-ar/thumb/fpu”
      “${TCINSTALL}/arm-none-eabi/lib/armv7-ar/thumb/fpu”

      In the “C:\Program Files (x86)\KPIT\GNUARM-NONEv16.01-EABI\arm-none-eabi\arm-none-eabi\arm-none-eabi\lib\armv7-ar\thumb\fpu\” folder there is a libstdc++.a file.

      Any idea of what else is wrong?

      Best regards,

      Adam.

    • Hi Darius,

      This is from the console:

      -L“C:\PROGRA~2\KPIT\GNUARM~2.01-\ARM-NO~1\ARM-NO~1/arm-none-eabi/lib/armv7-ar/thumb/fpu�?

      There appears to be yet another bug in the E2Studio tool support. The path passed to the linker contains an invalid character. Deleting the entry and re-entering it fixes the problem.

      Then, finally, when it links there is an undefined reference:
      C:\PROGRA~2\KPIT\GNUARM~2.01-\ARM-NO~1\ARM-NO~1/arm-none-eabi/lib/armv7-ar/thumb/fpu\libstdc++.a(time_members.o): In function `std::__timepunct::_M_put(wchar_t*, unsigned int, wchar_t const*, tm const*) const’:
      time_members.cc:(.text._ZNKSt11__timepunctIwE6_M_putEPwjPKwPK2tm+0x3e): undefined reference to `wcsftime’

      Are there any release notes for libstdc++ to indicated the differences between the V14.02 and V16.01 tool chains?

      Best regards,

      Adam.

    • Hi Darius,

      Finally after resolving the link errors I ran the application and it almost instantly hit the abort vector. I don’t have time to spend the next week of my life debugging the dog turd that dropped out of the linker, so I thought that I could just change the tool chain version back to 14.02. However I was unable to find the option.

      So I uninstalled V16.01, Close E2Studio, reverted the project. Then when I re-opened the project, E2Studio unregistered the tool chain then reported that V16.01 was missing and it would use V14.02.

      Is this the only way to do it?

      Best regards,

      Adam.

    • Hello Adam,

      Thank you for the feedback.

      >>Are there any release notes for libstdc++ to indicated the differences between the V14.02 and V16.01 tool chains?

      You can find the release notes for the toolchains in their installation folder (e.g: C:\Program Files (x86)\KPIT\GNUARM-NONEv16.01-EABI\). There is a file named release_notes.pdf. No information is provided there for libstc++, but you have information about the gcc version.

      If you are still using the GNUARM-NONE v14.02 you can find the documentation for gcc here: https://gcc.gnu.org/gcc-4.9/ > GCC 4.9.2 October 30, 2014 (changes, documentation).

      If you click on ‘changes’ you will be redirected to the gcc 4.9 release notes and you will see the libstc++ part at the “New Languages and Language specific improvements” chapter.

      The manual for the C++ library is here: https://gcc.gnu.org/onlinedocs/gcc-4.9.2/libstdc++/manual/ and the reference manual is here: https://gcc.gnu.org/onlinedocs/gcc-4.9.2/libstdc++/api/

      If you switched to the GNUARM-NONE v16.01, you can find the documentation for gcc here: https://gcc.gnu.org/gcc-5/ > GCC 5.2 July 16, 2015 (changes, documentation).

      If you click on ‘changes’ you will be redirected to the gcc 5.2 release notes and you will see the libstc++ part at the “New Languages and Language specific improvements” chapter.

      The manual for the C++ library is here: https://gcc.gnu.org/onlinedocs/gcc-5.2.0/libstdc++/manual/ and the library reference manual is here: https://gcc.gnu.org/onlinedocs/gcc-5.2.0/libstdc++/api/

      >>So I uninstalled V16.01, Close E2Studio, reverted the project. Then when I re-opened the project, E2Studio unregistered the tool chain then reported that V16.01 was missing and it would use V14.02.

      If you want to change the toolchain version, you can right-click on your project > Renesas Tool Settings > Change Toolchain Version (from the C/C++ Build tab);
      Alternatively, you can click on the Renesas Tool Settings button from your second menu bar > Change Toolchain Version (from the C/C++ Build tab);
      …or, click on your project, then alt+T > Change Toolchain Version (from the C/C++ Build tab);

      >>C:\Program Files (x86)\KPIT\GNUARM-NONEv16.01-EABI\arm-none-eabi\arm-none-eabi\arm-none-eabi\lib\armv7-ar\thumb\fpu\” folder there is a libstdc++.a file.
      >>-L“C:\PROGRA~2\KPIT\GNUARM~2.01-\ARM-NO~1\ARM-NO~1/arm-none-eabi/lib/armv7-ar/thumb/fpu?

      We could not reproduce the problem at our end. If possible and if you may, please send us the project to take a closer look.

      You can mark this query as private, so nobody else will be able to see your proprietary software code, or you can open a private support request by choosing Support -> New Support Query from the top menus in our site.


      Best regards,
      The GNU Tools Support Team

    • Hello Adam,

      We hope your question has been answered. Please let us know if we can be of any further assistance, or if we can close this thread otherwise.

      This thread will be closed if no reply is received 24 hours after this message, but can be reopened upon request.


      Thank you,
      The GNU Tools Support Team

    • Hi,

      In summary the documentation for libstc++ is missing from C:\Program Files (x86)\KPIT\GNUARM-NONEv16.01-EABI\. There is some documentation at https://gcc.gnu.org/onlinedocs/gcc-4.9.2/libstdc++/manual/ and https://gcc.gnu.org/onlinedocs/gcc-4.9.2/libstdc++/api/ which may be of some help but there is no documentation pertinent to the build used by the tool chain.

      There are bugs in E2Studio with regards to the archive libraries and file path includes for both toolchain versions 14.02 & 16.01 where the user has to figure out which paths to use. For a C++ project with tool chain 14.02 & -mfloat-abi=hard the following include paths are required:

      ${TCINSTALL}/arm-none-eabi/include
      ${TCINSTALL}/lib/gcc/arm-none-eabi/${GCC_VERSION}/include
      ${TCINSTALL}/arm-none-eabi/include/c++/${GCC_VERSION}
      ${TCINSTALL}/arm-none-eabi/include/c++/${GCC_VERSION}/arm-none-eabi/fpu
      ${TCINSTALL}/lib/gcc/arm-none-eabi/${GCC_VERSION}/include-fixed

      The following archive search directories are required:
      “${CONFIGDIR}”
      “${TCINSTALL}/lib/gcc/arm-none-eabi/${GCC_VERSION}/fpu”
      “${TCINSTALL}/arm-none-eabi/lib/fpu/interwork”

      And the following archive files:
      ${BuildArtifactFileBaseName}
      gcc
      stdc++

      There is a bug in E2Studio where the C/C++ Build Change Toolchain Version entry disappears. The work-around is to import the projects into another workspace and it re-appears.

      Best regards,

      Adam.

    • Hello Adam,

      Thank you for your input on this matter.

      >>There are bugs in E2Studio with regards to the archive libraries and file path includes for both toolchain versions 14.02 & 16.01 where the user has to figure out which paths to use. For a C++ project with tool chain 14.02 & -mfloat-abi=hard the following include paths are required

      We were able to reproduce the first portion of the problem: changing the -mfloat-abi from soft to hard (or vice-versa) did not update the linker archive directories from “${TCINSTALL}/lib/gcc/arm-none-eabi/${GCC_VERSION}/fpu/interwork” to “${TCINSTALL}/lib/gcc/arm-none-eabi/${GCC_VERSION}/fpu” for v14.02

      For v16.01, you must choose the parameter recommended vfpv3, i.e “-mfpu=vfpv3”.
      So, for the default project which is for Cortex-A9 target based on the armv7-a architecture, please change the settings in e2 studio to: Properties -> C/C++ Build -> Settings -> CPU -> Target FPU (-mfpu) to vfpv3 from drop down list
      This will set the library archive path to (only for v15.01 and above):
      “${TCINSTALL}/arm-none-eabi/lib/armv7-ar/thumb/fpu”
      “${TCINSTALL}/lib/gcc/arm-none-eabi/${GCC_VERSION}/armv7-ar/thumb/fpu”
      “${CONFIGDIR}”

      >>There is a bug in E2Studio where the C/C++ Build Change Toolchain Version entry disappears.
      We were unable to reproduce this bug after changing the paths required for -mfloat-abi=hard.

      For the bugs encountered using the v14.02 of the toolchain, I will raise a ticket to Renesas E2Studio development team.
      If you could, please send us the e2 studio log file, so we can investigate this issue more thoroughly. The file is located in the \.metadata\.log .
      We appreciate your interest on this task.


      Best regards,
      Darius,
      The GNU Tools Support Team

    • Hi,

      I’m sorry I deleted the workspace .metadata folder. This folder quickly becomes huge and as far as I can see contains only a few preferences, which I am quite happy to reset. I keep the workspace in a separate folder to the project files and it is not under version control.

      The archive file and include file bugs are also in V16.01. To reproduce the include file bugs simply generate a C++ static library project with -mfloat-abi=hard. Then add the following standard headers to one of the sample C++ files:

      #include
      #include
      #include
      #include
      #include
      #include
      #include
      #include

      If you try to build the project it will fail because E2Studio has failed to add any include paths.

      If you want the code to build then manually add the following paths:
      ${TCINSTALL}/arm-none-eabi/include
      ${TCINSTALL}/lib/gcc/arm-none-eabi/${GCC_VERSION}/include
      ${TCINSTALL}/arm-none-eabi/include/c++/${GCC_VERSION}
      ${TCINSTALL}/arm-none-eabi/include/c++/${GCC_VERSION}/arm-none-eabi/fpu
      ${TCINSTALL}/lib/gcc/arm-none-eabi/${GCC_VERSION}/include-fixed

      Then in the compiler options add the option -std=gnu++11. Only then will the library compile.

      Using the V16.01 tool chain generate a C++ project changing only Floating Point ABI to Hard (there is no option for vfpv3). In order for it to link you have to manually change the option to vfp3. Then add gnu++11 option to the compiler settings and the include files to projectname.cpp & yet again it fails to link.

      As the documentation is as much use as a chocolate fire guard, the best option is to go to https://gcc.gnu.org/mirrors.html and download the source code to the appropriate GCC version (5.2 for V16.01). This is the only way that user’s of E2Studio will be able to figure out what the include folders should be and how to initialise the C++ standard library.

      I have never had so many issues with the quality of the tool integration in any other IDE. I hope that future releases of E2Studio are better documented and address the issues with the project generators for the GNUARM-NONE-EABI Toolchain.

      Best regards,

      Adam

    • The include files have dissapeared from the page, they are:
      iostream
      fstream
      stdlib.h
      stdio.h
      memory
      functional
      atomic
      limits.h

    • Hi Adam,

      Thanks again for your detailed response!

      I just wanted to let you know that we have identified a number of problems in e2 Studio and we are working on a solution for all of them with the e2 Studio team.

      Just to be sure that we do not miss any of the issues/errors you are experiencing, could you please:
      a) prepare all the build logs where you are experiencing them, and…
      b) send them to us for detailed analysis, pinpointing the problems in each?

      This way, we can ensure a qualitative release which will most likely resolve all of the above.


      Thank you,
      The GNU Tools Support Team

    • Hi,

      OK. I will put a document together, however I am very busy and it may take a while. Do you also want me to include samples that make the compiler crash too? For example:

      cc1plus.exe: out of memory allocating 107868728 bytes
      src/relative_pose/modules/sixpt/subdir.mk:18: recipe for target ‘src/relative_pose/modules/sixpt/modules2.o’ failed
      make: *** [src/relative_pose/modules/sixpt/modules2.o] Error 1

      Or are these errors outside the scope of E2Studio and in the realm of machine virtual memory settings?

      Best regards,

      Adam.

    • Hi Adam,

      >> Do you also want me to include samples that make the compiler crash too?

      Yes please, this will help us track down the problem easier and faster.

      >> Or are these errors outside the scope of E2Studio and in the realm of machine virtual memory settings?

      The GCC compiler is designed to cope with very large files efficiently. Nonetheless, we will differentially check the cause of the memory allocation crash and, once a problem is found, try to come up with a fix for it as soon as possible.


      Thank you,
      The GNU Tools Support Team