SUMMARY Hi, We have a bulid environment/CI system where we are cross-compiling valgrind for various architectures. Due to the way the CI system creates it's working directories such as ${os}-${arch} we end up with paths like /workspace/linux-mips64/output which are included as part of the sysroot when cross-compiling. Our configure invocation ends up like this CFLAGS='--sysroot=/workspace/linux-mips64/sysroot -g2 -gz -mabi=64 -O0' \ ./configure --target=mips64-unknown-linux-gnu \ --host=mips64-unknown-linux-gnu \ --build=x86_64-linux-gnu ... This trips up the following grep in configure.ac https://sourceware.org/git/?p=valgrind.git;a=blob;f=configure.ac;hb=HEAD#l1751 It matches the 'linux-mips64' and skips the code that sets FLAG_M32 and FLAG_M64. STEPS TO REPRODUCE 1. create sysroot in a path with 'linux-mips64' as a component 2. run CFLAGS='--sysroot=/workspace/linux-mips64/sysroot -g2 -gz -mabi=64 -O0' \ ./configure --target=mips64-unknown-linux-gnu \ --host=mips64-unknown-linux-gnu \ --build=x86_64-linux-gnu 3. check values for FLAG_M32 and FLAG_M64 in config.log OBSERVED RESULT FLAG_M32 and FLAG_M64 are not set EXPECTED RESULT FLAG_M32='-mips32 -mabi=32' FLAG_M64='-march=mips64r2 -mabi=64' SOFTWARE/OS VERSIONS Linux: debian "buster" ADDITIONAL INFORMATION
I think the solution probably lies in updating the grep patterns to anchor on non-word boundaries (e.g. \b) but I'm not sure how portable that is.
Created attachment 122873 [details] patch for configure.ac The attached patch seems to work for me on a linux system
Created attachment 122874 [details] patch for configure.ac Found a second instance that needs the same fix. Updated patch attached
Fixed in https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=8f6e97cf6544c5c83945caf01397ac265f6f055a Thanks Chris.