From 9c14033610bc00072d00389c879ac305efbb95df Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 19 Oct 2022 11:10:18 +0200 Subject: Canonicalize 'linux' to `linux-gnu' in target triplet In particular, GCC in Fedora now reports its target as x86_64-redhat-linux. Note that this canonicalization is consistent with config.sub. --- libbutl/target-triplet.cxx | 5 +++++ libbutl/target-triplet.hxx | 1 + 2 files changed, 6 insertions(+) (limited to 'libbutl') 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 -- cgit v1.1