This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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

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

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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]