bash_utils.sh do not detect multi-arch correctly

Issue #2133 new
Roland Haas created an issue

Currently bash_utils.sh uses MACHINE:=gcc -dumpmachine`` to try and detect the multi-arch designation. This however is not correct as shown on the Debian wiki:

https://wiki.debian.org/Multiarch/Tuples#Why_not_use_GNU_triplets.3F

In a nutshell -dumpmachine is too specific for intel 386 CPUs and not specific enough for ARM cpus.

Instead one should try the two official ways listed on the wiki followed by the current one as a (not strictly correct but often working namely for the currently common x86_64-linux-gnu) fallback on old systems (gcc older than 4.9):

MACHINE:=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || gcc -print-multiarch 2>/dev/null || gcc -dumpmachine 2>/dev/null)

where the last one is just a fallback that may work often but really is not official.

Keyword: None

Comments (0)

  1. Log in to comment