This is an archive of the discontinued LLVM Phabricator instance.

Detect Clear Linux and apply Clear's default linker options
AcceptedPublic

Authored by thiagomacieira on Oct 10 2018, 9:21 PM.

Details

Reviewers
mgorny
erichkeane
Summary

/usr/lib/os-release is the official path of /etc/os-release (the latter is usually a symlink to the former)

Diff Detail

Event Timeline

thiagomacieira created this revision.Oct 10 2018, 9:21 PM

Oops, add the missing portion of the unit test (the part that actually tests).

mgorny added inline comments.Oct 11 2018, 1:27 AM
lib/Driver/Distro.cpp
139

Technically speaking, the spec says you are supposed to read /etc/os-release first and fall back to /usr/lib/os-release only if the former does not exist.

lib/Driver/Distro.cpp
139

You're right, I'll adapt.

Updated to check for /etc/os-release first and /usr/lib/os-release if that fails

thiagomacieira marked an inline comment as done.Oct 15 2018, 10:55 AM
thiagomacieira added inline comments.
lib/Driver/Distro.cpp
148

I'm changing this so we can detect Clear-derived distributions.

Update detection: as of Clear Linux 25620, /usr/lib/os-relaese contains ID_LIKE=clear-linux-os, which allows detecting not only Clear itself, but also Linux distributions derived from it (Clear Linux mixes).

mgorny accepted this revision.Oct 30 2018, 4:30 AM

LGTM, presuming the tests pass for you.

This revision is now accepted and ready to land.Oct 30 2018, 4:30 AM