This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Problem with -mcpu option for GAS on Linux/Alpha
- From: Sergey Tikhonov <tsv at solvo dot ru>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: binutils at sourceware dot org
- Date: Mon, 09 Jan 2006 22:39:41 +0300
- Subject: Re: Problem with -mcpu option for GAS on Linux/Alpha
- References: <43C16243.2030302@solvo.ru> <43C29B07.9000206@redhat.com>
Nick Clifton wrote:
Hi Sergey,
Am I right that ".arch" directive in a .s file has higher priority
than "-mcpu" command option.
Yes.
The source file has inline assembler that adds some "ev56"
instructions Unfortunatelly, gcc 4.1 (gcc version 4.1.0 20051214 (Red
Hat 4.1.0-0.8)) adds ".arch ev5" into output assembler
file and command line option is overwriten by in-file ".arch" directive.
What should be correct behavior?
Add your own ".arch ev6" directive to the inline assembler just before
the ev56 instructions are used. (Ideally you would want to save the
current architecture, switch to ev6, assemble the required
instructions and then switch back. But currently the Alpha port of
GAS does not support anything like a .push_arch/.pop_arch pair of
pseudos).
Better yet, move the inline assembler out into its own source file and
assemble it independently of the rest of the program. That way you
should be able to ensure that the correct architecture is set from the
command line and that you will not be attempting to assemble gcc
generated code with the wrong architecture set.
Thank you for answer. Unfortunatelly, the source code I was talking
about is Linux kernel. It was compiled without problem by
gcc 4.0.1 compiler, because for some reasons it din't add ".arch"
directives and command line option had effect.
I wish alpha gas had those pseudos you were talking about (for now I
would modify my gas to have command line option to have higher
priority).
Thank you,
Sergey.
tsv@solvo.ru