e2 6.1 GCC for Renesas RZ user library broken

One cannot link to a user library when GCC Renesas RZ is used. You always get undefined reference at link time. On the other hand GCC ARM embedded works fine. 

 

  • Hi Armando,

    Can you send me your build log?

    One thing just to check...make sure the .a on the archive is not present in the library include options.
    We will improve validation in this area.

    Thanks,
    Mark.
  • Hi Mark,

    I'm guessing by your statement, that you tried it and works for you.

    A missing .a manifests itself as a "cannot find -llib.a", so no, that's not it. My error is an undefined reference, and not a missing library file. The library file is there and it contains the function. I know the library works well because I can use it from a GCC ARM Embedded project. I'm also able to add the .o file to the linker and that works too.

    But when GCC for Renesas RZ is selected in Tool Chain Editor the libraries don't work. It is like the archive it is not being parsed or completely ignored. As you can see below, -llib and -L"C:\workspace\lib\Debug" are included in the linker.

    Any other thought would be appreciate it.

    Thanks.

    Extracting support files...
    10:18:41 **** Incremental Build of configuration HardwareDebug for project tt ****
    make -j6 all
    'Building target: tt.elf'
    'Invoking: Cross ARM C++ Linker'
    arm-none-eabi-g++ -mcpu=cortex-a9 -march=armv7-a -marm -mthumb-interwork -mlittle-endian -mfloat-abi=hard -mfpu=vfpv3 -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -g3 -Wstack-usage=100 -T "C:/workspace/tt/generate/linker_script.ld" -L "C:\\Program Files (x86)\\GNU Tools ARM Embedded\\5.4 2016q3\\/lib/gcc/arm-none-eabi/5.4.1/armv7-ar/thumb/fpu" -L "C:\\Program Files (x86)\\GNU Tools ARM Embedded\\5.4 2016q3\\/arm-none-eabi/lib/armv7-ar/thumb/fpu" -Wl,-Map,"tt.map" -Wl,--start-group -lm -lc -lgcc -lstdc++ -llib -Wl,--end-group -nostartfiles -Xlinker --gc-sections --specs=nano.specs -specs=nosys.specs -Wl,-e_PowerON_Reset -L"C:\workspace\lib\Debug" -o "tt.elf" ./src/tt.o ./generate/hwsetup.o ./generate/inthandler.o ./generate/start.o ./generate/vects.o
    ./src/tt.o: In function `main':
    C:\workspace\tt\HardwareDebug/../src/tt.cpp:38: undefined reference to `function1'
    collect2.exe: error: ld returned 1 exit status
    makefile:77: recipe for target 'tt.elf' failed
    make: *** [tt.elf] Error 1

    10:18:41 Build Failed. 3 errors, 0 warnings. (took 359ms)
  • In reply to Mark Goodchild:

    Any updates on this? Have you or anyone really, been able to use a static library under 6.1?

    Thanks
  • In reply to ArmandoBroncas:

    ArmandoBroncas,

    Your error suggests that the linker can not find the library you are referencing.
    How did you add your library to the project?

    Mike Clements
    RenesasRulz Moderator
  • In reply to Mike Clements:

    Thanks Mike.

    I know that is what it suggests.... But that's not it. The file is there.

    I am providing the path and the lib name as I always have in settings->linker->libraries. I am not new at this.

    Let me ask you this.. Does it work for you? Did you try it yourself?

    "But when GCC for Renesas RZ is selected in Tool Chain Editor the libraries don't work. It is like the archive it is not being parsed or completely ignored. As you can see below, -llib and -L"C:\workspace\lib\Debug" are included in the linker."

    Thanks again.

  • While this issue needs to be fixed sometime, for now I found a work around for anyone else that can't get their libs to work in the usual way.

    Add the lib as an object file and don't strip any part of the file name and because the compiler sees it as a big obj file, no need to bother with paths.

    The drawback is that you need to recompile manually on change.
  • In reply to ArmandoBroncas:

    This thread will be archived due to inactivity.

    Mike Clements
    RenesasRulz Moderator