uBlaze : -m compile directives...

Hi all.

I'm using EDK 8.1.02i and I'm programming uBlaze.

I have seen that related to uBlaze configuration (HW/SW FPU, Barrel shifter ON/OFF, and so on...) there are different directives to inform compiler.Example "-mhard-float" (using HW floating point). My question: these type of directives are ONLY for target (I mean used) that is for the linker command or the directives are also used in compiling time? I mean obj code are different if different are condition of "-m" ? For me is important to know if I must use this compile setting also in my external library.

Thanks in advance.

Cheers, Alfmyk.

Reply to
Alfmyk
Loading thread data ...

ON/OFF, and so on...) there are different directives to inform compiler.Example "-mhard-float" (using HW floating point). My question: these type of directives are ONLY for target (I mean used) that is for the linker command or the directives are also used in compiling time? I mean obj code are different if different are condition of "-m" ? For me is important to know if I must use this compile setting also in my external library.

It is really important for the compiler and assembler. That is the main reason why Xilinx has been forced to create an automatic system to recompile all system libraries whenerver hardware changes (apart form the interrupt mapping).

Regards, Zara

Reply to
Zara

Ok, thank you for your answer Zara. So I suppose that if I have to use Xfloat32 or Xfloat64 in my library module it's very important compile library with these directives... And now I understand better why when a add a simple float in my library the code became so bigger... Ok, now I retest adding directives. Thanks.

Reply to
Alfmyk

ON/OFF, and so on...) there are different directives to inform compiler.Example "-mhard-float" (using HW floating point). My question: these type of directives are ONLY for target (I mean used) that is for the linker command or the directives are also used in compiling time? I mean obj code are different if different are condition of "-m" ? For me is important to know if I must use this compile setting also in my external library.

It is important to pass all CPU-specific flags (soft/hard float, HW mul/div/shift) to both the compiler *and* the linker.

If you are doing a compile and link in one pass, then it's not a problem. But Makefiles that do seperate compile and link phases need to be careful.

mb-gcc uses the multilib mechanism with different versions of libc and libgcc compiled for all possible CPU-flag combinations. If you don't pass the CPU options to the linker, it defaults to linking against fully SW versions, which is not what you want.

Regards,

John

Reply to
John Williams

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.