|
From: Leon P. <leo...@gm...> - 2023-02-27 21:11:24
|
Hello, all. I am trying to compile Valgrind 3.20.0 on ARMv7 Linux 2.6.37 (not cross!). At first, compilation produced a lot of errors with binary constants in the form 0bXXXX, but I replaced them with normal numbers and compilation continued. It failed with: ../coregrind/link_tool_exe_linux 0x58000000 gcc -std=gnu99 -o memcheck-arm-linux -O2 -g -Wall -Wmissing-prototypes -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Wcast-qual -Wwrite-st rings -Wformat -Wformat-security -finline-functions -fno-stack-protector -fno-strict-aliasing -fno-builtin -marm -mcpu=cortex-a8 -O2 -static -nodefaultlibs -nostartfiles -u _start memcheck_arm_linux-mc_leak check.o memcheck_arm_linux-mc_malloc_wrappers.o memcheck_arm_linux-mc_main.o memcheck_arm_linux-mc_main_asm.o memcheck_arm_linux-mc_translate.o memcheck_arm_linux-mc_machine.o memcheck_arm_linux-mc_errors.o ../ coregrind/libcoregrind-arm-linux.a ../VEX/libvex-arm-linux.a -lgcc ../coregrind/libgcc-sup-arm-linux.a ../coregrind/link_tool_exe_linux: line 58: use: command not found ../coregrind/link_tool_exe_linux: line 59: use: command not found ../coregrind/link_tool_exe_linux: line 62: die: command not found ../coregrind/link_tool_exe_linux: line 70: syntax error near unexpected token `$ala' ../coregrind/link_tool_exe_linux: line 70: ` if (length($ala) < 3 || index($ala, "0x") != 0);' Looking into the link_tool_exe_linux script I must admit that I did not understand a thing about what should be done...:-( Please, help!!! Many thanks ahead. Leon |
|
From: Paul F. <pj...@wa...> - 2023-02-27 21:23:17
|
On 27-02-23 22:11, Leon Pollak wrote: > Hello, all. > I am trying to compile Valgrind 3.20.0 on ARMv7 Linux 2.6.37 (not cross!). > At first, compilation produced a lot of errors with binary constants in > the form 0bXXXX, but I replaced them with normal numbers and compilation > continued. > It failed with: > ../coregrind/link_tool_exe_linux 0x58000000 gcc -std=gnu99 -o > memcheck-arm-linux -O2 -g -Wall -Wmissing-prototypes -Wshadow > -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Wcast-qual > -Wwrite-st > rings -Wformat -Wformat-security -finline-functions -fno-stack-protector > -fno-strict-aliasing -fno-builtin -marm -mcpu=cortex-a8 -O2 -static > -nodefaultlibs -nostartfiles -u _start memcheck_arm_linux-mc_leak > check.o memcheck_arm_linux-mc_malloc_wrappers.o > memcheck_arm_linux-mc_main.o memcheck_arm_linux-mc_main_asm.o > memcheck_arm_linux-mc_translate.o memcheck_arm_linux-mc_machine.o > memcheck_arm_linux-mc_errors.o ../ > coregrind/libcoregrind-arm-linux.a ../VEX/libvex-arm-linux.a -lgcc > ../coregrind/libgcc-sup-arm-linux.a > ../coregrind/link_tool_exe_linux: line 58: use: command not found > ../coregrind/link_tool_exe_linux: line 59: use: command not found > ../coregrind/link_tool_exe_linux: line 62: die: command not found > ../coregrind/link_tool_exe_linux: line 70: syntax error near unexpected > token `$ala' > ../coregrind/link_tool_exe_linux: line 70: ` if (length($ala) < 3 || > index($ala, "0x") != 0);' It sounds to me as though the script is failing to find the perl interpreter and is running in whatever your default shell is. Can you ensure that you have perl installed? Is the path in link_tool_exe_linux correct? If not you may need to run "autogen.sh" in the top source directory and then rerun configure. A+ Paul |
|
From: Leon P. <leo...@gm...> - 2023-02-28 11:52:55
|
Thank you, Paul - you were right - I missed the autogen.sh script.
Doing it and trying to satisfy its and configure requirements brought me to
so many incompatible version errors, that I gave up on "native" compilation
(for DM8148 arm Cortex-A8, Linux 2.6.37) and decided to switch to
cross-compilation. My PC is x86_64 Fedora 35.
So, autogen.sh ran smoothly.
Than I ran:
export CROSS_COMPILE=/opt/gcc-linaro/bin/arm-linux-gnueabihf-
./configure --target=arm-linux-gnueabihf --host=x86_64-redhat-linux
--prefix=/opt/valgrind CFLAGS=-static CC=${CROSS_COMPILE}gcc \
CPP=${CROSS_COMPILE}cpp CXX=${CROSS_COMPILE}g++
LD=${CROSS_COMPILE}ld AR=${CROSS_COMPILE}ar
Everything runs smoothly till:
/opt/gcc-linaro/bin/arm-linux-gnueabihf-gcc -DHAVE_CONFIG_H -I. -I.. -I..
-I../include -I../include -I../VEX/pub -I../VEX/pub -DVGA_amd64=1
-DVGO_linux=1 -DVGP_amd64_linux=1 -DVGPV_amd64_linux_vanilla=1 -I../
coregrind -DVG_LIBDIR="\"/opt/valgrind/libexec/valgrind"\"
-DVG_PLATFORM="\"amd64-linux\"" -O2 -g -Wall -Wmissing-prototypes -Wshadow
-Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Wcast-align -Wc
ast-qual -Wwrite-strings -Wempty-body -Wformat -Wformat-signedness
-Wformat-security -Wignored-qualifiers -Wmissing-parameter-type
-Wlogical-op -Wold-style-declaration -finline-functions
-fno-stack-protector -f
no-strict-aliasing -fno-builtin -fomit-frame-pointer -static -MT
valgrind-launcher-linux.o -MD -MP -MF .deps/valgrind-launcher-linux.Tpo -c
-o valgrind-launcher-linux.o `test -f 'launcher-linux.c' || echo '
./'`launcher-linux.c
In file included from ../include/pub_tool_vki.h:61:0,
from pub_core_vki.h:42,
from launcher-linux.c:39:
../include/vki/vki-xen.h:82:2: error: #error "Need to define per-ARCH Xen
types for this platform"
#error "Need to define per-ARCH Xen types for this platform"
^~~~~
../include/vki/vki-xen.h:85:1: error: ‘void’ must be the only parameter
DEFINE_VKI_XEN_GUEST_HANDLE(void);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
and further thousands of errors.
On Mon, 27 Feb 2023 at 23:24, Paul Floyd <pj...@wa...> wrote:
>
>
> On 27-02-23 22:11, Leon Pollak wrote:
> > Hello, all.
> > I am trying to compile Valgrind 3.20.0 on ARMv7 Linux 2.6.37 (not
> cross!).
> > At first, compilation produced a lot of errors with binary constants in
> > the form 0bXXXX, but I replaced them with normal numbers and compilation
> > continued.
> > It failed with:
> > ../coregrind/link_tool_exe_linux 0x58000000 gcc -std=gnu99 -o
> > memcheck-arm-linux -O2 -g -Wall -Wmissing-prototypes -Wshadow
> > -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Wcast-qual
> > -Wwrite-st
> > rings -Wformat -Wformat-security -finline-functions -fno-stack-protector
> > -fno-strict-aliasing -fno-builtin -marm -mcpu=cortex-a8 -O2 -static
> > -nodefaultlibs -nostartfiles -u _start memcheck_arm_linux-mc_leak
> > check.o memcheck_arm_linux-mc_malloc_wrappers.o
> > memcheck_arm_linux-mc_main.o memcheck_arm_linux-mc_main_asm.o
> > memcheck_arm_linux-mc_translate.o memcheck_arm_linux-mc_machine.o
> > memcheck_arm_linux-mc_errors.o ../
> > coregrind/libcoregrind-arm-linux.a ../VEX/libvex-arm-linux.a -lgcc
> > ../coregrind/libgcc-sup-arm-linux.a
> > ../coregrind/link_tool_exe_linux: line 58: use: command not found
> > ../coregrind/link_tool_exe_linux: line 59: use: command not found
> > ../coregrind/link_tool_exe_linux: line 62: die: command not found
> > ../coregrind/link_tool_exe_linux: line 70: syntax error near unexpected
> > token `$ala'
> > ../coregrind/link_tool_exe_linux: line 70: ` if (length($ala) < 3 ||
> > index($ala, "0x") != 0);'
>
> It sounds to me as though the script is failing to find the perl
> interpreter and is running in whatever your default shell is.
>
> Can you ensure that you have perl installed?
>
> Is the path in link_tool_exe_linux correct?
> If not you may need to run "autogen.sh" in the top source directory and
> then rerun configure.
>
> A+
> Paul
>
>
>
> _______________________________________________
> Valgrind-users mailing list
> Val...@li...
> https://lists.sourceforge.net/lists/listinfo/valgrind-users
>
|
|
From: Leon P. <leo...@gm...> - 2023-02-28 14:15:36
|
I recall my previous mail about cross-compilation.
When i did exactly what is recommended, I managed to cross-compile.
The unexpected issue appeared when I run wvalgrind myappw:
FATAL: kernel too old
My kernel is 2.6.37 and seemed to be ok.
Is it final or can I do something further? Old Valgrind version, for
example?
Thank a lot!!!
On Tue, 28 Feb 2023 at 13:52, Leon Pollak <leo...@gm...> wrote:
> Thank you, Paul - you were right - I missed the autogen.sh script.
> Doing it and trying to satisfy its and configure requirements brought me
> to so many incompatible version errors, that I gave up on "native"
> compilation (for DM8148 arm Cortex-A8, Linux 2.6.37) and decided to switch
> to cross-compilation. My PC is x86_64 Fedora 35.
> So, autogen.sh ran smoothly.
> Than I ran:
> export CROSS_COMPILE=/opt/gcc-linaro/bin/arm-linux-gnueabihf-
> ./configure --target=arm-linux-gnueabihf --host=x86_64-redhat-linux
> --prefix=/opt/valgrind CFLAGS=-static CC=${CROSS_COMPILE}gcc \
> CPP=${CROSS_COMPILE}cpp CXX=${CROSS_COMPILE}g++
> LD=${CROSS_COMPILE}ld AR=${CROSS_COMPILE}ar
> Everything runs smoothly till:
> /opt/gcc-linaro/bin/arm-linux-gnueabihf-gcc -DHAVE_CONFIG_H -I. -I.. -I..
> -I../include -I../include -I../VEX/pub -I../VEX/pub -DVGA_amd64=1
> -DVGO_linux=1 -DVGP_amd64_linux=1 -DVGPV_amd64_linux_vanilla=1 -I../
> coregrind -DVG_LIBDIR="\"/opt/valgrind/libexec/valgrind"\"
> -DVG_PLATFORM="\"amd64-linux\"" -O2 -g -Wall -Wmissing-prototypes -Wshadow
> -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Wcast-align -Wc
> ast-qual -Wwrite-strings -Wempty-body -Wformat -Wformat-signedness
> -Wformat-security -Wignored-qualifiers -Wmissing-parameter-type
> -Wlogical-op -Wold-style-declaration -finline-functions
> -fno-stack-protector -f
> no-strict-aliasing -fno-builtin -fomit-frame-pointer -static -MT
> valgrind-launcher-linux.o -MD -MP -MF .deps/valgrind-launcher-linux.Tpo -c
> -o valgrind-launcher-linux.o `test -f 'launcher-linux.c' || echo '
> ./'`launcher-linux.c
> In file included from ../include/pub_tool_vki.h:61:0,
> from pub_core_vki.h:42,
> from launcher-linux.c:39:
> ../include/vki/vki-xen.h:82:2: error: #error "Need to define per-ARCH Xen
> types for this platform"
> #error "Need to define per-ARCH Xen types for this platform"
> ^~~~~
> ../include/vki/vki-xen.h:85:1: error: ‘void’ must be the only parameter
> DEFINE_VKI_XEN_GUEST_HANDLE(void);
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> and further thousands of errors.
>
>
> On Mon, 27 Feb 2023 at 23:24, Paul Floyd <pj...@wa...> wrote:
>
>>
>>
>> On 27-02-23 22:11, Leon Pollak wrote:
>> > Hello, all.
>> > I am trying to compile Valgrind 3.20.0 on ARMv7 Linux 2.6.37 (not
>> cross!).
>> > At first, compilation produced a lot of errors with binary constants in
>> > the form 0bXXXX, but I replaced them with normal numbers and
>> compilation
>> > continued.
>> > It failed with:
>> > ../coregrind/link_tool_exe_linux 0x58000000 gcc -std=gnu99 -o
>> > memcheck-arm-linux -O2 -g -Wall -Wmissing-prototypes -Wshadow
>> > -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Wcast-qual
>> > -Wwrite-st
>> > rings -Wformat -Wformat-security -finline-functions
>> -fno-stack-protector
>> > -fno-strict-aliasing -fno-builtin -marm -mcpu=cortex-a8 -O2 -static
>> > -nodefaultlibs -nostartfiles -u _start memcheck_arm_linux-mc_leak
>> > check.o memcheck_arm_linux-mc_malloc_wrappers.o
>> > memcheck_arm_linux-mc_main.o memcheck_arm_linux-mc_main_asm.o
>> > memcheck_arm_linux-mc_translate.o memcheck_arm_linux-mc_machine.o
>> > memcheck_arm_linux-mc_errors.o ../
>> > coregrind/libcoregrind-arm-linux.a ../VEX/libvex-arm-linux.a -lgcc
>> > ../coregrind/libgcc-sup-arm-linux.a
>> > ../coregrind/link_tool_exe_linux: line 58: use: command not found
>> > ../coregrind/link_tool_exe_linux: line 59: use: command not found
>> > ../coregrind/link_tool_exe_linux: line 62: die: command not found
>> > ../coregrind/link_tool_exe_linux: line 70: syntax error near unexpected
>> > token `$ala'
>> > ../coregrind/link_tool_exe_linux: line 70: ` if (length($ala) < 3 ||
>> > index($ala, "0x") != 0);'
>>
>> It sounds to me as though the script is failing to find the perl
>> interpreter and is running in whatever your default shell is.
>>
>> Can you ensure that you have perl installed?
>>
>> Is the path in link_tool_exe_linux correct?
>> If not you may need to run "autogen.sh" in the top source directory and
>> then rerun configure.
>>
>> A+
>> Paul
>>
>>
>>
>> _______________________________________________
>> Valgrind-users mailing list
>> Val...@li...
>> https://lists.sourceforge.net/lists/listinfo/valgrind-users
>>
>
|
|
From: John R. <jr...@bi...> - 2023-02-28 20:42:45
|
On 2/28/2023, Leon Pollak wrote: > I recall my previous mail about cross-compilation. > When i did exactly what is recommended, I managed to cross-compile. > The unexpected issue appeared when I run wvalgrind myappw: > FATAL: kernel too old > My kernel is 2.6.37 and seemed to be ok. > Is it final or can I do something further? Old Valgrind version, for example? Stop. Give it up. Find something else to do. If this is your job, then find a new job as soon as you can, so that you can quit this insanity. Even OpenWRT runs Linux 5.11. It seems likely that your environment is some ARM (v4 or v5) embedded system that has an app with a horrendous bug that you are trying to find and fix. Trying to do this natively, running such an old kernel and probably with severely limited RAM, is insane. Get a 4GB or 8GB Raspberry Pi running a current Debian or Fedora Linux, and debug the app there. The Pi has GPIO, USB, Ethernet, camera, and dot-matrix display interfaces. If there are other sensors on your device, then you should have hardware adapters so that they can use USB interfacing, so that you *can* use a Pi as a real-time development environment. If your management won't spend the time or money to make or procure such adapters for the sensors, then there is *NO* hope. |
|
From: Leon P. <leo...@gm...> - 2023-02-28 21:14:21
|
Thank you, John for your humor...:-))) This is ARMv7 (Cortex-A8) the TI TMS320DM8148 CPU with 1GB RAM and there is no chance to switch to something else. The Valgrind manual says that it supports Linux 2.6.31 and younger, 2.6.37 seems to be younger...:-) Why are you so pessimistic...:-) On Tue, 28 Feb 2023 at 22:44, John Reiser <jr...@bi...> wrote: > On 2/28/2023, Leon Pollak wrote: > > I recall my previous mail about cross-compilation. > > When i did exactly what is recommended, I managed to cross-compile. > > The unexpected issue appeared when I run wvalgrind myappw: > > FATAL: kernel too old > > My kernel is 2.6.37 and seemed to be ok. > > Is it final or can I do something further? Old Valgrind version, for > example? > Stop. Give it up. Find something else to do. If this is your job, > then find a new job as soon as you can, so that you can quit this insanity. > > Even OpenWRT runs Linux 5.11. It seems likely that your environment > is some ARM (v4 or v5) embedded system that has an app with a horrendous > bug > that you are trying to find and fix. Trying to do this natively, running > such an old kernel and probably with severely limited RAM, is insane. > > Get a 4GB or 8GB Raspberry Pi running a current Debian or Fedora Linux, > and debug the app there. The Pi has GPIO, USB, Ethernet, camera, and > dot-matrix display interfaces. If there are other sensors on your > device, then you should have hardware adapters so that they can use > USB interfacing, so that you *can* use a Pi as a real-time development > environment. If your management won't spend the time or money to > make or procure such adapters for the sensors, then there is *NO* hope. > > > > _______________________________________________ > Valgrind-users mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-users > |
|
From: John R. <jr...@bi...> - 2023-02-28 22:01:25
|
On 2/28/2023, Leon Pollak wrote:
> I recall my previous mail about cross-compilation.
> When i did exactly what is recommended, I managed to cross-compile.
> The unexpected issue appeared when I run wvalgrind myappw:
> FATAL: kernel too old
> My kernel is 2.6.37 and seemed to be ok.
> Is it final or can I do something further? Old Valgrind version, for example?
The string "kernel too old" does not appear in the sources for valgrind 3.20.0,
nor in the current 3.21.0, nor in previous 3.19.0. The substring "too old"
likewise does not appear in the sources, except for configuration tests such as:
./configure: { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
So, which software wrote "FATAL: kernel too old"? The utility 'strace' may help.
Something like
strace -f -o strace.out -e trace=execve,write,writev,pwrite,pwritev wvalgrind myappw
where 'execve' tells the command line for a given PID, and the 'write,writev,...'
trace various system calls which write to file descriptors, reporting the associated
process id PID. Also run the 'strace' a second time with just the app, without valgrind.
(By the way, what is the 'w' prefix and suffix in "wvalgrind myappw"?)
|
|
From: Leon P. <leo...@gm...> - 2023-03-01 10:22:48
|
Yes, you are right, John.
The error message comes from glibc, but I didn't look in this direction.
For those coming after me with this task, below is the way to do this. To
cross-compile Valgrind 3.20.0 I used the following script:
export CC=arm-linux-gnueabihf-gcc
export CXX=arm-linux-gnueabihf-g++
export CCFLAGS="-mcpu=cortex-a8 -mfpu=neon"
export LDFLAGS="
-Wl,--rpath=/lib/glibc.2.23,--dynamic-linker=/lib/glibc.2.23/ld-linux-armhf.so.3"
./configure --host=armv7-linux-gnueabihyf
--target=armv7-linux-gnueabihf --prefix=/opt/FS_HDVR/opt
make
make install
When this finished successfully, I need to run the following command to
execute MyApp under Valgrind:
export VALGRIND_LIB=/opt/libexec/valgrind; /opt/bin/valgrind MyApp
Note that most probably (I am not sure) the glibc should correspond to the
cross-compiler in use.
Anyway, now I can run Valgrind with my application(s).
THANKS FOR THE HELP!
On Wed, 1 Mar 2023 at 00:02, John Reiser <jr...@bi...> wrote:
> On 2/28/2023, Leon Pollak wrote:
> > I recall my previous mail about cross-compilation.
> > When i did exactly what is recommended, I managed to cross-compile.
> > The unexpected issue appeared when I run wvalgrind myappw:
> > FATAL: kernel too old
> > My kernel is 2.6.37 and seemed to be ok.
> > Is it final or can I do something further? Old Valgrind version, for
> example?
>
> The string "kernel too old" does not appear in the sources for valgrind
> 3.20.0,
> nor in the current 3.21.0, nor in previous 3.19.0. The substring "too old"
> likewise does not appear in the sources, except for configuration tests
> such as:
> ./configure: { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
> 'missing' script is too old or missing" >&5
>
> So, which software wrote "FATAL: kernel too old"? The utility 'strace'
> may help.
> Something like
> strace -f -o strace.out -e trace=execve,write,writev,pwrite,pwritev
> wvalgrind myappw
> where 'execve' tells the command line for a given PID, and the
> 'write,writev,...'
> trace various system calls which write to file descriptors, reporting the
> associated
> process id PID. Also run the 'strace' a second time with just the app,
> without valgrind.
> (By the way, what is the 'w' prefix and suffix in "wvalgrind myappw"?)
>
>
>
> _______________________________________________
> Valgrind-users mailing list
> Val...@li...
> https://lists.sourceforge.net/lists/listinfo/valgrind-users
>
|