This is an archive of the discontinued LLVM Phabricator instance.

[llvm] [cmake] Remove obsolete /usr/local hack for *BSD
ClosedPublic

Authored by mgorny on Jan 12 2021, 4:47 AM.

Details

Summary

Remove the hack adding /usr/local paths on FreeBSD and DragonFlyBSD.
It does not seem to be necessary today, and it breaks cross builds.

Diff Detail

Event Timeline

mgorny created this revision.Jan 12 2021, 4:47 AM
mgorny requested review of this revision.Jan 12 2021, 4:47 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 12 2021, 4:47 AM

This patch certainly looks correct for fixing the symptom, but I'm somewhat concerned that the original logic was incorrect anyway. I believe CMake's FindLibrary and FindPackage work correctly with things installed in /usr/local on FreeBSD, so I don't know why we need these.

What happens if you just drop this block unconditionally?

What happens if you just drop this block unconditionally?

It seems to find libxml2 correctly. However, rebuilding everything will take a while. I'll report back when I confirm that everything built without issues.

Trying to add people responsible for the DragonFly part.

I can confirm that it builds fine without that block and that there are no changes in CMakeCache.txt.

I can confirm that it builds fine without that block and that there are no changes in CMakeCache.txt.

That sounds good. My guess would be that this was "needed" at some point in the past because certain targets weren't adding things like ${LIBXML2_INCLUDE_DIRS} with target_include_directories, etc.

Patches that just remove code without breaking functionality are my favourite kind!

mgorny updated this revision to Diff 316123.Jan 12 2021, 9:18 AM
mgorny retitled this revision from [llvm] [cmake] Do not inject /usr/local paths when crosscompiling to [llvm] [cmake] Remove obsolete /usr/local hack for *BSD.
mgorny edited the summary of this revision. (Show Details)

Change the patch to remove the hack entirely.

krytarowski accepted this revision.Jan 12 2021, 9:20 AM
This revision is now accepted and ready to land.Jan 12 2021, 9:20 AM
theraven accepted this revision.Jan 12 2021, 9:22 AM

Great!

arichardson accepted this revision.Jan 12 2021, 9:28 AM
This revision was automatically updated to reflect the committed changes.