https://bugs.kde.org/show_bug.cgi?id=527958

            Bug ID: 527958
           Summary: mips64 n32: configure forces -march=mips64r2,
                    conflicts with -march in CFLAGS
    Classification: Developer tools
           Product: valgrind
      Version First 3.27 GIT
       Reported In:
          Platform: Other
                OS: Other
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

Created attachment 197763
  --> https://bugs.kde.org/attachment.cgi?id=197763&action=edit
configure.ac: don't override -march on mips64 n32

Cross-compiling Valgrind for the MIPS64 n32 ABI with a non-R2 ISA in
CFLAGS (e.g. -march=mips64) fails in VEX:

    mips64el-linux-gcc ... -march=mips64r2 -mabi=n32 ... -march=mips64 -c -o
priv/libvex_mips64_linux_a-main_globals.o priv/main_globals.c
    cc1: error: '-mips64r2' conflicts with the other architecture options,
which specify a mips64 processor

  This is the n32 counterpart of bug 400975. That bug was fixed by commit
  e61d13087 ("mips: if revision is specified, use it for compilation"),
  which makes configure skip its own -march/-mips probes when CFLAGS
  already contains one. That fix only covers o32 and n64: both n32 code
  paths in configure.ac still set unconditionally

    FLAG_M64="-march=mips64r2 -mabi=n32"

  (once after the "if gcc is producing mips n32 binaries" check, once in
  the "if gcc is n32 capable" fallback). FLAG_M64 is placed before the
  user CFLAGS, so GCC gets two different ISAs and errors out. This affects
  every n32 ISA other than mips64r2 (mips64, mips64r3/r5/r6, Octeon, ...).

  Steps to reproduce:

    CC=mips64el-linux-gcc CFLAGS="-march=mips64 -mabi=n32" \
      ./configure --host=mips64el-linux
    make

  Toolchain: Bootlin mips64el-n32 glibc bleeding-edge 2026.08-1
  (GCC 16.2.0). Found by the Buildroot autobuilders:
 
https://autobuild.buildroot.org/results/c562eef960c049f1523ed1c6a30c0d5eacf905ea

  The attached patch does for n32 what e61d13087 did for o32/n64: it
  always adds -mabi=n32, and adds -march=mips64r2 only when no
  -march/-mips option was found in CFLAGS. With it, the configuration
  above builds, and memcheck-mips64-linux comes out as an N32 MIPS64
  binary. It applies to 3.27.1 and master.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to