Re: Using __attribute__((target("arm"))) on ARM cross compiler: warning: target attribute is not supported on this machine [-Wattributes]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Gabriel,

On 31/05/16 06:51, Gabriel Marcano wrote:
For reference, I am running a cross compiler for my raspberry pi on my Gentoo
x86_64 system. The compiler is armv6zk-hardfloat-linux-gnueabihf-gcc at version
5.3.0.

I have been doing some experimentation with inline assembly, and in the course
of it I ran into https://gcc.gnu.org/onlinedocs/gcc/ARM-Function-Attributes.html
which claims that GCC with ARM supports the attribute target for changing the
type of instruction being generated. When I try to use the attribute, I get the

That documentation link refers to the current GCC trunk.
If you want documentation specific to GCC 5.3 look at:
https://gcc.gnu.org/onlinedocs/gcc-5.3.0/gcc/

following warning:
     warning: target attribute is not supported on this machine [-Wattributes]

This was added for GCC 6.1. So if you want to use target attributes
you'll have to use that version. They are not supported in GCC 5.3.

Kyrill

I am inlining a small program that illustrates the problem.

main.c:

   __attribute__((target("arm")))
   int foo(void) { return 0;}

   int main (void)
   {
       return foo();
   }

--

Compiling with 'armv6zk-hardfloat-linux-gnueabihf-gcc prog.c -o prog' is enough
to generate the warning. Am I missing something obvious, or is the GCC
documentation about ARM wrong? I actually ran into this problem with another
cross-compiler also, for an arm946e-s CPU. Any ideas? Let me know if any more
information is desired, and I will try to provide it.

Thanks,

Gabriel E. Marcano





[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux