How to use 64bit doubles on RX26T?
How to use 64bit doubles on RX26T?
Hello support
I am using rx-elf-gcc 8.3.0.202405 on RX26T.
I want to use 64 bit doubles, and therefore I compile with -m64bit-doubles
-Wall -Winvalid-pch -Wextra -std=c18 -O2 -g -misa=v3 -fpu -mlittle-endian-data -Drx26t=1 -D__RX_LITTLE_ENDIAN__=1 -ffunction-sections -fdata-sections -fshort-enums -fno-builtin -fno-function-cse -fno-caller-saves -m64bit-doubles -mjsr
Compiling goes fine, but linking fails. I receive an “undefined reference to `__extendsfdf2′”
I call the linker (through GCC) with following flags:
-Wl,–as-needed -Wl,–no-undefined -T/work/platform/arch/rx/rx26t/linker.ld -Wl,–warn-common -Wl,–gc-sections -nostartfiles -specs=nano.specs -specs=lnosys.specs -Wl,–start-group -lm -lc -Wl,–end-group
What must I do to make the program link?
Best regards, Frank
Hello,
Thank you for reaching out to us!
We apologize for the late response.
The toolchain comes with multiple versions of precompiled libraries(libc.a, libm.a, libgcc.a, etc.), each version being compiled with a specific set of options.
Options like -m64bit-doubles produce objects that can only be used with objects that were also compiled with the same option.
When using the linker through GCC, the driver will select the appropriate library version to be used for linking, based on the passed options.
The encountered issue seems to be caused by not passing -m64bit-doubles to the linker as well, thus resulting in it using the wrong libraries.
When doubles are represented on 32 bits, functions handling 64 bit doubles are not included in the libraries that are used at link time, generating the undefined reference error.
Please let us know if we can be of assistance with any other issues.
Best regards,
The Open Source Tools Team