This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH][s390x] Fix build of z9 iconv rountines on z900
- From: "Andreas Krebbel" <krebbel at linux dot vnet dot ibm dot com>
- To: Aurelien Jarno <aurelien at aurel32 dot net>
- Cc: libc-alpha at sourceware dot org
- Date: Fri, 18 Mar 2011 09:02:39 +0100
- Subject: Re: [PATCH][s390x] Fix build of z9 iconv rountines on z900
- References: <20110301234737.GA22110@volta.aurel32.net>
On Wed, Mar 02, 2011 at 12:47:37AM +0100, Aurelien Jarno wrote:
> The GNU libc provides iconv optimized routines using instructions
> introduced on the z9-109. They check for hardware support before running
> such instructions, so it is still possible to target a z900 CPU.
>
> However recent versions of binutils now rejects these instructions when
> targeting a z900 CPU. It's not possible to call GCC with -march=z9-109
> as it would enable other instructions and the code won't run anymore on
> a z900 CPU. Instead this patch force the z9-109 instruction set at the
> assembler level.
There has been a Binutils bug on S/390. When invoking 'as' without an
-march option it defaulted to z900 on 64 bit but it should default to
the highest supported CPU instead. I've fixed that with:
http://sourceware.org/ml/binutils/2010-11/msg00446.html
This should fix the problem as long as no -march=z900 is explicitly
added to CFLAGS when building glibc.
However when building glibc with an higher -march= option than z9-109 it would
fail with your patch. The GCC generated code then would use
instructions which would be rejected by 'as' when invoked with
-march=z9-109. We would need something like -march=max for 'as' then in
order to accept at least all z9-109 instruction but also higher levels
if necessary.
Another way to fix this is to replace the z9-109 mnemonics in the s390
iconv modules with .insn directives specifying directly the opcode. I
will send a patch soon.
Bye,
-Andreas-