Skip to main content

Supporting Hardware FPU

2 replies [Last post]
sandykhan
Offline
Joined: 2008-01-15

i am cross-compiling for linux-arm, and my target device has hardware FPU (and i'm sure about it). i have edited linux_arm.cfg found in ../sourc/cldc/build/linux_arm, and added the following code into it.

ifeq ($(ENABLE_SOFT_FLOAT), false)
ifeq ($(ENABLE_ARM_VFP), true)
CPP_DEF_FLAGS += -mfloat-abi=softfp -mfpu=vfp
ASM_FLAGS += -mfpu=vfp
endif
endif

now, when i build cldc by setting ENABLE_SOFT_FLOAT=false and ENABLE_ARM_VFP=true, the following errors appear:

linking ../bin/cldc_vm_g ...
/opt/tools/usr/bin/arm-linux-uclibc-ld: ERROR: /pMEF/mr2build/pcsl/arm/linux_arm/lib/libpcsl_memory.a(pcsl_chunkmmap_linux.o) uses FPA instructions, whereas ../bin/cldc_vm_g does not
/opt/tools/usr/bin/arm-linux-uclibc-ld: ERROR: /pMEF/mr2build/pcsl/arm/linux_arm/lib/libpcsl_memory.a(pcsl_chunkmmap_linux.o) uses hardware FP, whereas ../bin/cldc_vm_g uses software FP
/opt/tools/usr/bin/arm-linux-uclibc-ld: failed to merge target specific data of file

and the same errors appears for others libraries too. i have also tried to build without any changes to linux_arm.cfg, but there were some other errors (posted in a separate thread). so, guide me how can i build cldc for my target platform(supporting hardware FPU)?

regards.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
olegpliss
Offline
Joined: 2006-11-09

Sandykhan,

It is not clear from your description which HW FPU do you have. FPA is not VFP, and AFAIK they cannot both be used in the same HW design. FPA is not supported by the VM compiler.

So if your HW FPU is FPA, please disable ARM_VFP and enable SOFT_FLOAT.

> i am cross-compiling for linux-arm, and my target
> device has [b]hardware FPU[/b] (and i'm sure about it). i
> have edited linux_arm.cfg found in
> ../sourc/cldc/build/linux_arm, and added the
> following code into it.
>
> ifeq ($(ENABLE_SOFT_FLOAT), false)
> ifeq ($(ENABLE_ARM_VFP), true)
> CPP_DEF_FLAGS += -mfloat-abi=softfp -mfpu=vfp
> ASM_FLAGS += -mfpu=vfp
> endif
> endif
>
>
> now, when i build cldc by setting
> ENABLE_SOFT_FLOAT=false and ENABLE_ARM_VFP=true, the
> following errors appear:
>
>
> linking ../bin/cldc_vm_g ...
> /opt/tools/usr/bin/arm-linux-uclibc-ld: ERROR:
> /pMEF/mr2build/pcsl/arm/linux_arm/lib/libpcsl_memory.a
> (pcsl_chunkmmap_linux.o) uses [b]FPA[/b] instructions,
> whereas ../bin/cldc_vm_g does not
> /opt/tools/usr/bin/arm-linux-uclibc-ld: ERROR:
> /pMEF/mr2build/pcsl/arm/linux_arm/lib/libpcsl_memory.a
> (pcsl_chunkmmap_linux.o) uses [b]hardware FP[/b], whereas
> ../bin/cldc_vm_g uses software FP
> /opt/tools/usr/bin/arm-linux-uclibc-ld: failed to
> merge target specific data of file

danila
Offline
Joined: 2006-09-25

Hi sandykhan,

the build errors indicate that fp-specific build settings for PCSL and CLDC are different.

A simple temporary solution is to build CLDC without PCSL (set ENABLE_PCSL=false).
This way, you will be able to build phoneME Feature VM and run standalone
CLDC-only applications, but you won't be able to build the full phoneME Feature
software stack on top of that.

A full solution would be to modify PCSL makefiles to use the same fp flags as for CLDC:
introduce a new build flag for PCSL (e.g. USE_ARM_VFP) and append the required
fp flags to the CFLAGS variable in pcsl/makefiles/share/gcc.gmk

Danila