This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Using __attribute__((target("arm"))) on ARM cross compiler: warning: target attribute is not supported on this machine [-Wattributes]
- From: Gabriel Marcano <gabemarcano at yahoo dot com>
- To: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Tue, 31 May 2016 05:51:30 +0000 (UTC)
- Subject: Using __attribute__((target("arm"))) on ARM cross compiler: warning: target attribute is not supported on this machine [-Wattributes]
- Authentication-results: sourceware.org; auth=none
- References: <2143393256 dot 1510941 dot 1464673890382 dot JavaMail dot yahoo dot ref at mail dot yahoo dot com>
- Reply-to: Gabriel Marcano <gabemarcano at yahoo dot com>
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