|
From: Anmol P. <An...@fr...> - 2014-07-10 16:27:17
|
Hello, I am trying to build (Valgrind Revision: 14147, VEX Revision: 2897) on the ARM V8 Foundation Model (FM000-KT-00035-r0p8-52rel06.tgz from https://silver.arm.com/browse/FM00A), other details of the build environment being: -------------------------------------------------------------------------------- root@genericarmv8:/home/b07584/valgrind# uname -a Linux genericarmv8 3.15.0-1-linaro-vexpress64 #1ubuntu1~ci+140621065049 SMP PREEMPT Sat Jun 21 06:51:35 UTC 20 aarch64 GNU/Linux -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- root@genericarmv8:/home/b07584/valgrind# gcc --version gcc (Linaro GCC 4.8-2014.04) 4.8.3 20140401 (prerelease) -------------------------------------------------------------------------------- I have the following build error: -------------------------------------------------------------------------------- make[3]: Warning: File 'm_ume/.deps/libcoregrind_arm64_linux_a-script.Po' has modification time 2423282 s in the future aarch64-oe-linux-gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I../include -I../VEX/pub -I../VEX/pub -DVGA_arm64=1 -DVGO_linux=1 -DVGP_arm64_linux=1 -DVGPV_arm64_linux_vanilla=1 -I../coregrind -DVG_LIBDIR="\"/home/b07584/valgrind/lib/valgrind"\" -DVG_PLATFORM="\"arm64-linux\"" -O2 -g -Wall -Wmissing-prototypes -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Wno-format-zero-length -Wno-tautological-compare -fno-strict-aliasing -fno-builtin -Wno-long-long -Wwrite-strings -fno-stack-protector -MT vgdb-vgdb-invoker-ptrace.o -MD -MP -MF .deps/vgdb-vgdb-invoker-ptrace.Tpo -c -o vgdb-vgdb-invoker-ptrace.o `test -f 'vgdb-invoker-ptrace.c' || echo './'`vgdb-invoker-ptrace.c vgdb-invoker-ptrace.c: In function 'restore_and_detach': vgdb-invoker-ptrace.c:748:7: error: invalid use of undefined type 'struct user_pt_regs' if (!setregs(pid_of_save_regs, &user_save.regs, sizeof(user_save.regs))) { ^ vgdb-invoker-ptrace.c:748:7: error: invalid use of undefined type 'struct user_pt_regs' vgdb-invoker-ptrace.c: In function 'invoker_invoke_gdbserver': vgdb-invoker-ptrace.c:786:24: error: storage size of 'user_mod' isn't known struct user_pt_regs user_mod; ^ vgdb-invoker-ptrace.c:824:4: error: 'user_save' has an incomplete type user_save = user_mod; ^ vgdb-invoker-ptrace.c:786:24: warning: unused variable 'user_mod' [-Wunused-variable] struct user_pt_regs user_mod; ^ vgdb-invoker-ptrace.c: At top level: cc1: warning: unrecognized command line option "-Wno-tautological-compare" [enabled by default] Makefile:7224: recipe for target 'vgdb-vgdb-invoker-ptrace.o' failed make[3]: *** [vgdb-vgdb-invoker-ptrace.o] Error 1 make[3]: Leaving directory '/home/b07584/valgrind/coregrind' Makefile:7370: recipe for target 'check' failed make[2]: *** [check] Error 2 make[2]: Leaving directory '/home/b07584/valgrind/coregrind' Makefile:745: recipe for target 'check-recursive' failed make[1]: *** [check-recursive] Error 1 make[1]: Leaving directory '/home/b07584/valgrind' Makefile:1033: recipe for target 'check' failed make: *** [check] Error 2 root@genericarmv8:/home/b07584/valgrind# -------------------------------------------------------------------------------- With the same revisions, on an x86_64, and: -------------------------------------------------------------------------------- b07584@atx-ub12-p64-42:~$ uname -a Linux atx-ub12-p64-42 3.13.0-27-generic #50-Ubuntu SMP Thu May 15 18:06:16 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- b07584@atx-ub12-p64-42:~$ gcc --version gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2 -------------------------------------------------------------------------------- - everything builds and works just fine... Please let me know if you need any more information. Thank you, Anmol P. Paralkar |
|
From: Mark W. <mj...@re...> - 2014-07-11 10:00:12
|
On Thu, 2014-07-10 at 16:27 +0000, Anmol Paralkar wrote: > I am trying to build (Valgrind Revision: 14147, VEX Revision: 2897) > on the ARM V8 Foundation Model (FM000-KT-00035-r0p8-52rel06.tgz > from https://silver.arm.com/browse/FM00A), other details of the > build environment being: > > -------------------------------------------------------------------------------- > root@genericarmv8:/home/b07584/valgrind# uname -a > Linux genericarmv8 3.15.0-1-linaro-vexpress64 #1ubuntu1~ci+140621065049 SMP PREEMPT Sat Jun 21 06:51:35 UTC 20 aarch64 GNU/Linux > -------------------------------------------------------------------------------- > > -------------------------------------------------------------------------------- > root@genericarmv8:/home/b07584/valgrind# gcc --version > gcc (Linaro GCC 4.8-2014.04) 4.8.3 20140401 (prerelease) > -------------------------------------------------------------------------------- > > I have the following build error: > > -------------------------------------------------------------------------------- > make[3]: Warning: File 'm_ume/.deps/libcoregrind_arm64_linux_a-script.Po' has modification time 2423282 s in the future > aarch64-oe-linux-gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I../include -I../VEX/pub -I../VEX/pub -DVGA_arm64=1 -DVGO_linux=1 -DVGP_arm64_linux=1 -DVGPV_arm64_linux_vanilla=1 -I../coregrind -DVG_LIBDIR="\"/home/b07584/valgrind/lib/valgrind"\" -DVG_PLATFORM="\"arm64-linux\"" -O2 -g -Wall -Wmissing-prototypes -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Wno-format-zero-length -Wno-tautological-compare -fno-strict-aliasing -fno-builtin -Wno-long-long -Wwrite-strings -fno-stack-protector -MT vgdb-vgdb-invoker-ptrace.o -MD -MP -MF .deps/vgdb-vgdb-invoker-ptrace.Tpo -c -o vgdb-vgdb-invoker-ptrace.o `test -f 'vgdb-invoker-ptrace.c' || echo './'`vgdb-invoker-ptrace.c > vgdb-invoker-ptrace.c: In function 'restore_and_detach': > vgdb-invoker-ptrace.c:748:7: error: invalid use of undefined type 'struct user_pt_regs' Which glibc is this using? I got a similar report for elfutils: https://lists.fedorahosted.org/pipermail/elfutils-devel/2014-June/004042.html It looks like on aarch64 depending on the glibc version used you have to use either user_pt_regs or user_regs_struct. The later is what new versions will define and might be good to adopt. But it does mean that the code won't compile anymore on older aarch64 glibc versions. Cheers, Mark |
|
From: Anmol P. <An...@fr...> - 2014-07-11 21:58:50
|
-----Original Message----- From: Mark Wielaard [mailto:mj...@re...] Sent: Friday, July 11, 2014 5:00 AM To: Paralkar Anmol-B07584 Cc: val...@li... Subject: Re: [Valgrind-developers] vgdb-invoker-ptrace.c build failure. On Thu, 2014-07-10 at 16:27 +0000, Anmol Paralkar wrote: > I am trying to build (Valgrind Revision: 14147, VEX Revision: 2897) on > the ARM V8 Foundation Model (FM000-KT-00035-r0p8-52rel06.tgz from > https://silver.arm.com/browse/FM00A), other details of the build > environment being: > > ---------------------------------------------------------------------- > ---------- root@genericarmv8:/home/b07584/valgrind# uname -a Linux > genericarmv8 3.15.0-1-linaro-vexpress64 #1ubuntu1~ci+140621065049 SMP > PREEMPT Sat Jun 21 06:51:35 UTC 20 aarch64 GNU/Linux > ---------------------------------------------------------------------- > ---------- > > ---------------------------------------------------------------------- > ---------- root@genericarmv8:/home/b07584/valgrind# gcc --version gcc > (Linaro GCC 4.8-2014.04) 4.8.3 20140401 (prerelease) > ---------------------------------------------------------------------- > ---------- > > I have the following build error: > > ---------------------------------------------------------------------- > ---------- > make[3]: Warning: File > 'm_ume/.deps/libcoregrind_arm64_linux_a-script.Po' has modification > time 2423282 s in the future aarch64-oe-linux-gcc -DHAVE_CONFIG_H -I. > -I.. -I.. -I../include -I../VEX/pub -I../VEX/pub -DVGA_arm64=1 > -DVGO_linux=1 -DVGP_arm64_linux=1 -DVGPV_arm64_linux_vanilla=1 > -I../coregrind -DVG_LIBDIR="\"/home/b07584/valgrind/lib/valgrind"\" > -DVG_PLATFORM="\"arm64-linux\"" -O2 -g -Wall -Wmissing-prototypes > -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations > -Wno-format-zero-length -Wno-tautological-compare -fno-strict-aliasing > -fno-builtin -Wno-long-long -Wwrite-strings -fno-stack-protector -MT > vgdb-vgdb-invoker-ptrace.o -MD -MP -MF > .deps/vgdb-vgdb-invoker-ptrace.Tpo -c -o vgdb-vgdb-invoker-ptrace.o > `test -f 'vgdb-invoker-ptrace.c' || echo './'`vgdb-invoker-ptrace.c > vgdb-invoker-ptrace.c: In function 'restore_and_detach': > vgdb-invoker-ptrace.c:748:7: error: invalid use of undefined type 'struct user_pt_regs' Which glibc is this using? I got a similar report for elfutils: https://lists.fedorahosted.org/pipermail/elfutils-devel/2014-June/004042.html It looks like on aarch64 depending on the glibc version used you have to use either user_pt_regs or user_regs_struct. The later is what new versions will define and might be good to adopt. But it does mean that the code won't compile anymore on older aarch64 glibc versions. Cheers, Mark [] Hello Mark, Using gnu_get_libc_version (), it's version: 2.19-2014.06 With the __GLIBC__ and __GLIBC_MINOR__ macros, we do not get the resolution to know whether we are past 2.19 to be able to choose between user_pt_regs or user_regs_struct, so I'm thinking that we might just have to wait till glibc 2.20 is out before we could make that change in the valgrind sources. Thanks very much for your mail. Regards, Anmol. |
|
From: Mark W. <mj...@re...> - 2014-07-17 14:13:42
|
On Fri, 2014-07-11 at 21:58 +0000, Anmol Paralkar wrote: > Using gnu_get_libc_version (), it's version: 2.19-2014.06 > > With the __GLIBC__ and __GLIBC_MINOR__ macros, we do not get the resolution to know whether > we are past 2.19 to be able to choose between user_pt_regs or user_regs_struct, so I'm > thinking that we might just have to wait till glibc 2.20 is out before we could make that > change in the valgrind sources. Yeah, I don't know what the correct solution is atm. fedora also switched to a pre-release glibc now, so I have just added a renaming patch for now to the package: http://pkgs.fedoraproject.org/cgit/valgrind.git/tree/valgrind-3.9.0-arm64-user_regs.patch Cheers, Mark |
|
From: Philippe W. <phi...@sk...> - 2014-07-17 19:53:46
|
On Thu, 2014-07-17 at 16:13 +0200, Mark Wielaard wrote: > On Fri, 2014-07-11 at 21:58 +0000, Anmol Paralkar wrote: > > Using gnu_get_libc_version (), it's version: 2.19-2014.06 > > > > With the __GLIBC__ and __GLIBC_MINOR__ macros, we do not get the resolution to know whether > > we are past 2.19 to be able to choose between user_pt_regs or user_regs_struct, so I'm > > thinking that we might just have to wait till glibc 2.20 is out before we could make that > > change in the valgrind sources. > > Yeah, I don't know what the correct solution is atm. fedora also > switched to a pre-release glibc now, so I have just added a renaming > patch for now to the package: > http://pkgs.fedoraproject.org/cgit/valgrind.git/tree/valgrind-3.9.0-arm64-user_regs.patch Is there a need to support both struct user_pt_regs user_mod; and struct user_regs_struct user_mod; ? In other words, is there a "release" version of glibc that uses the first, and another one that uses the second ? And if yes, do we want to support these 2 glibc versions ? If the answer is 2 times yes, then I guess we need a config test. Otherwise, we just have to support the "newer and good glibc" Philippe |
|
From: Mark W. <mj...@re...> - 2014-07-17 20:23:43
|
On Thu, 2014-07-17 at 21:53 +0200, Philippe Waroquiers wrote: > On Thu, 2014-07-17 at 16:13 +0200, Mark Wielaard wrote: > > On Fri, 2014-07-11 at 21:58 +0000, Anmol Paralkar wrote: > > > Using gnu_get_libc_version (), it's version: 2.19-2014.06 > > > > > > With the __GLIBC__ and __GLIBC_MINOR__ macros, we do not get the resolution to know whether > > > we are past 2.19 to be able to choose between user_pt_regs or user_regs_struct, so I'm > > > thinking that we might just have to wait till glibc 2.20 is out before we could make that > > > change in the valgrind sources. > > > > Yeah, I don't know what the correct solution is atm. fedora also > > switched to a pre-release glibc now, so I have just added a renaming > > patch for now to the package: > > http://pkgs.fedoraproject.org/cgit/valgrind.git/tree/valgrind-3.9.0-arm64-user_regs.patch > > Is there a need to support both > struct user_pt_regs user_mod; > and > struct user_regs_struct user_mod; > ? > In other words, is there a "release" version of glibc that uses the first, > and another one that uses the second ? Sadly yes. The struct user_pt_regs really comes from a kernel header that (erroneously) leaked through in glibc 2.19 for arm64. struct user_regs_struct is the (official) user struct as will be provided by glibc 2.20 (when it is released). The new glibc release will no longer define the kernel struct for arm64 in the glibc headers. > And if yes, do we want to support these 2 glibc versions ? Maybe. If we want to support both glibc 2.19 and 2.20 for arm64. > If the answer is 2 times yes, then I guess we need a config test. yeah. The problem at the moment is that 2.20 isn't actually released yet, but some distros are already testing it in their unstable branches. That makes a simple version check difficult, since this 2.20-beta still claims it is 2.19... > Otherwise, we just have to support the "newer and good glibc" I'll ask some distro people if they consider an arm64 release with 2.19 supportable or whether they think they will eventually switch to 2.20 for any stable arm64 version. Cheers, Mark |
|
From: Philippe W. <phi...@sk...> - 2014-07-17 20:30:16
|
On Thu, 2014-07-17 at 22:23 +0200, Mark Wielaard wrote: > yeah. The problem at the moment is that 2.20 isn't actually released > yet, but some distros are already testing it in their unstable branches. > That makes a simple version check difficult, since this 2.20-beta still > claims it is 2.19... I mean by a configure test: verify if a piece of c code compiles with the struct we want to use. That should work whatever the version claimed by glibc header. Philippe |
|
From: Mark W. <mj...@re...> - 2014-07-17 20:46:19
|
On Thu, 2014-07-17 at 22:30 +0200, Philippe Waroquiers wrote: > On Thu, 2014-07-17 at 22:23 +0200, Mark Wielaard wrote: > > > yeah. The problem at the moment is that 2.20 isn't actually released > > yet, but some distros are already testing it in their unstable branches. > > That makes a simple version check difficult, since this 2.20-beta still > > claims it is 2.19... > I mean by a configure test: verify if a piece of c code compiles with > the struct we want to use. > That should work whatever the version claimed by glibc header. Yes, I was just hoping we could just say "for arm64 support use glibc 2.20 or newer". But it seems people are actually shipping distros for aarch64 that are based on 2.17 (that is even 2 versions back). So it seems we cannot escape doing a proper configure test to see if user_regs_struct is available or user_pt_regs. Cheers, Mark |
|
From: Mark W. <mj...@re...> - 2014-07-18 20:47:08
|
On Thu, 2014-07-17 at 22:46 +0200, Mark Wielaard wrote: > So it > seems we cannot escape doing a proper configure test to see if > user_regs_struct is available or user_pt_regs. I checked in the attached configure test (r14176). Tested against both old and newer glibc on arm64. Cheers, Mark |