Skip to content
Commit 4fc3a6fd authored by Vicente Olivert Riera's avatar Vicente Olivert Riera Committed by Peter Korsgaard
Browse files

valgrind: build for the right MIPS ISA revision level



When Valgrind detects a 32-bit MIPS architecture, it forcibly adds
-march=mips32 to CFLAGS; when it detects a 64-bit MIPS architecture, it
forcibly adds -march=mips64. This causes Valgrind to be built always for
the first ISA revision level (R1), even when the user has configured
Buildroot for the second ISA revision level (R2).

Since R2 is backwards compatible with R1, you can run a Valgrind built
for R1 in an R2 core. This is why nobody noticed about this problem, or
at least nobody complained.

But, since (I hope) we will support R6 in Buildroot in the near future,
this problem will become very important because R6 is not backwards
compatible with R1 or R2, so building Valgrind for R1 when your target
is R6 will result in a non-working Valgrind.

Override the CFLAGS variable (which Valgrind appends to its CFLAGS) and
pass the right -march option, so they take precedence over Valgrind's
wrongfully detected value.

Signed-off-by: default avatarVicente Olivert Riera <Vincent.Riera@imgtec.com>
Reviewed-by: default avatarArnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Reviewed-by: default avatar"Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: default avatarPeter Korsgaard <peter@korsgaard.com>
parent e3046c80
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment