From b7dccae1970c9f39745b71d71ee0f107be0715e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Wed, 12 Oct 2016 08:41:58 +0200 Subject: [PATCH] [Triple] Handle Gentoo arm-hardfloat-*-gnueabi triples Unlike other Linux distributions, Gentoo abuses the vendor field of the arm triples to specify softfloat or hardfloat. Add a special case logic for triple parsing that accounts for this and changes the environment to GNUEABIHF appropriately. --- lib/Support/Triple.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/Support/Triple.cpp b/lib/Support/Triple.cpp index 19d278d..53b3477 100644 --- a/lib/Support/Triple.cpp +++ b/lib/Support/Triple.cpp @@ -874,6 +874,14 @@ std::string Triple::normalize(StringRef Str) { } } + // Gentoo abuses the vendor field for softfloat/hardfloat ARM + // e.g. arm-softfloat-linux-gnueabi, arm-hardfloat-linux-gnueabi + if (Arch == Triple::arm && Environment == Triple::GNUEABI && + Components[1] == "hardfloat") { + Components[3] = "gnueabihf"; + Environment = Triple::GNUEABIHF; + } + // Stick the corrected components back together to form the normalized string. std::string Normalized; for (unsigned i = 0, e = Components.size(); i != e; ++i) { -- 2.10.1