Bug 398649 - New s390x z13 support doesn't build with older gcc/binutils
Summary: New s390x z13 support doesn't build with older gcc/binutils
Status: RESOLVED UNMAINTAINED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.14 SVN
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Vadim Barkov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-15 01:56 UTC by Mark Wielaard
Modified: 2023-04-19 16:59 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Fixup for old bunutils (1.13 KB, application/mbox)
2019-02-08 02:58 UTC, Vadim Barkov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Wielaard 2018-09-15 01:56:58 UTC
Fairly old gcc/binutils might not have z13 support. But there are no configure checks for this.

This impacts the code in s390x_dirtyhelper_vec_binop:

gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I..  -I.. -I../include -I../include -I../VEX/pub -I../VEX/pub -DVGA_s390x=1 -DVGO_linux=1 -DVGP_s390x_linux=1 -DVGPV_s390x_linux_vanilla=1  -Ipriv  -m64 -O2 -finline-functions -g -Wall -Wmissing-prototypes -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Wcast-align -Wcast-qual -Wwrite-strings -Wempty-body -Wformat -Wformat-security -Wignored-qualifiers -Wmissing-parameter-type -Wlogical-op -Wold-style-declaration -fno-stack-protector -fno-strict-aliasing -fno-builtin  -fomit-frame-pointer  -Wbad-function-cast -fstrict-aliasing -g -pipe -Wall --param=ssp-buffer-size=4 -march=z9-109 -mtune=z10 -MT priv/libvex_s390x_linux_a-guest_s390_helpers.o -MD -MP -MF priv/.deps/libvex_s390x_linux_a-guest_s390_helpers.Tpo -c -o priv/libvex_s390x_linux_a-guest_s390_helpers.o `test -f 'priv/guest_s390_helpers.c' || echo './'`priv/guest_s390_helpers.c
priv/guest_s390_helpers.c: In function 's390x_dirtyhelper_vec_binop':
priv/guest_s390_helpers.c:2505: error: unknown register name 'v18' in 'asm'
priv/guest_s390_helpers.c:2505: error: unknown register name 'v17' in 'asm'
priv/guest_s390_helpers.c:2505: error: unknown register name 'v16' in 'asm'

And the new testcases vector, lsc2 and ppno.

When those are behind some configure check (I haven't figured out which one yet, but just disabled that code) things seem to work fine (for any non z13 code of course, but it is not expected any z13 code runs on such old setups).
Comment 1 Dirk Mueller 2018-11-21 12:55:28 UTC
I see a similar issue with binutils 2.31 and gcc 8.2.1, is this the same cause? (error is from compiling 3.14.0):

[  106s] priv/guest_s390_helpers.c: In function 's390x_dirtyhelper_vec_op':
[  106s] priv/guest_s390_helpers.c:2587:4: error: unknown register name 'v19' in 'asm'
[  106s]     __asm__ volatile (
[  106s]     ^
[  106s] priv/guest_s390_helpers.c:2587:4: error: unknown register name 'v18' in 'asm'
[  106s] priv/guest_s390_helpers.c:2587:4: error: unknown register name 'v17' in 'asm'
[  106s] priv/guest_s390_helpers.c:2587:4: error: unknown register name 'v16' in 'asm'
[  106s] Makefile:1536: recipe for target 'priv/libvex_s390x_linux_a-guest_s390_helpers.o' failed
[  106s] make[3]: *** [priv/libvex_s390x_linux_a-guest_s390_helpers.o] Error 1
Comment 2 Mark Wielaard 2018-11-21 14:07:55 UTC
It looks the same, but binutils 2.31 certainly should be new enough, it was released this year. Are you sure you are using 2.31?
Comment 3 Dirk Mueller 2018-11-22 09:39:20 UTC
No, I wasn't. ok, nevermind.
Comment 4 Vadim Barkov 2019-02-08 02:58:50 UTC
Created attachment 117918 [details]
Fixup for old bunutils

The problem affects gcc-4 only. This is one of the possible fixes.
Comment 5 Julian Seward 2019-03-10 07:14:26 UTC
What's the situation here?  Do we want/need to fix this?
Comment 6 Mark Wielaard 2023-04-19 16:59:25 UTC
(In reply to Julian Seward from comment #5)
> What's the situation here?  Do we want/need to fix this?

Current distros do support z13 just fine. This was an issue with rhel/centos6 and older rhel/centos7 (which is about to be deprecated too). I don't think we want to workaround this anymore but will just tell people they need a more modern toolchain if they are building valgrind for s390x.