aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libbutl/target-triplet.cxx5
-rw-r--r--libbutl/target-triplet.hxx1
-rw-r--r--tests/target-triplet/driver.cxx4
3 files changed, 10 insertions, 0 deletions
diff --git a/libbutl/target-triplet.cxx b/libbutl/target-triplet.cxx
index 209f75e..4c02efc 100644
--- a/libbutl/target-triplet.cxx
+++ b/libbutl/target-triplet.cxx
@@ -88,6 +88,11 @@ namespace butl
if (system.front () == '-' || system.back () == '-')
bad ("invalid os/kernel/abi");
+ // Canonicalize SYSTEM.
+ //
+ if (system == "linux")
+ system = "linux-gnu"; // Per config.sub.
+
// Extract VERSION for some recognized systems.
//
string::size_type v (0);
diff --git a/libbutl/target-triplet.hxx b/libbutl/target-triplet.hxx
index 45db457..da29907 100644
--- a/libbutl/target-triplet.hxx
+++ b/libbutl/target-triplet.hxx
@@ -77,6 +77,7 @@ namespace butl
// i686-w64-mingw32 i686 w64 mingw32
// i686-lfs-linux-gnu i686 lfs linux-gnu
// x86_64-unknown-linux-gnu x86_64 linux-gnu
+ // x86_64-redhat-linux x86_64 redhat linux-gnu
// x86_64-linux-gnux32 x86_64 linux-gnux32
// x86_64-microsoft-win32-msvc14.0 x86_64 microsoft win32-msvc 14.0
// x86_64-pc-windows-msvc x86_64 windows-msvc
diff --git a/tests/target-triplet/driver.cxx b/tests/target-triplet/driver.cxx
index 6dcb77e..30153a1 100644
--- a/tests/target-triplet/driver.cxx
+++ b/tests/target-triplet/driver.cxx
@@ -82,6 +82,10 @@ main ()
"x86_64-linux-gnu",
"x86_64", "", "linux-gnu", "", "linux"));
+ assert (test ("x86_64-redhat-linux",
+ "x86_64-redhat-linux-gnu",
+ "x86_64", "redhat", "linux-gnu", "", "linux"));
+
assert (test ("x86_64-linux-gnux32",
"x86_64-linux-gnux32",
"x86_64", "", "linux-gnux32", "", "linux"));