Bug 202594 - Fix graphics/darktable build with clang 3.7.0
Summary: Fix graphics/darktable build with clang 3.7.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Jean-Sébastien Pédron
Depends on:
Blocks: 201377
  Show dependency treegraph
Reported: 2015-08-23 13:59 UTC by Dimitry Andric
Modified: 2015-08-26 17:48 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (dumbbell)

Avoid calling __builtin_cpu_supports() with clang (1.11 KB, patch)
2015-08-23 13:59 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer 2015-08-23 13:59:51 UTC
Created attachment 160248 [details]
Avoid calling __builtin_cpu_supports() with clang

During the exp-run in bug 201377, it was found that graphics/darktable gives errors with a recent clang 3.7.0 snapshot:


This is because the program optionally calls __builtin_cpu_supports() to get some CPU feature flags, and while clang 3.7.0 now supports this builtin, our libgcc/libcompiler-rt does not have the required support yet. To fix this, avoid calling the builtin, if clang is used.

Note that I still could not verify whether the port completely builds, since for me, it always fails with:

CMake Error at data/cmake_install.cmake:76 (file):
  file INSTALL cannot find
Call Stack (most recent call first):
  cmake_install.cmake:34 (include)

This is not a clang-related problem though.  It may be due to some of the dozen dependencies, but I cannot figure out which one.
Comment 1 Jean-Sébastien Pédron freebsd_committer 2015-08-25 18:47:29 UTC
Hello Dimitry!

I added a patch to D3247:

It builds successfully for me with Clang 3.7.0 from ports (including OpenMP support!).
Comment 2 John Marino freebsd_committer 2015-08-26 14:55:26 UTC
(In reply to Jean-Sebastien Pedron from comment #1)

I'm seeing the same issue on DragonFly using the base compiler GCC 5.2:

-- Installing: /wrkdirs/graphics/darktable/work/stage/usr/local/share/darktable/luarc
CMake Error at data/cmake_install.cmake:76 (file):
  file INSTALL cannot find
Call Stack (most recent call first):
  cmake_install.cmake:34 (include)
Comment 3 commit-hook freebsd_committer 2015-08-26 17:01:30 UTC
A commit references this bug:

Author: dumbbell
Date: Wed Aug 26 17:01:26 UTC 2015
New revision: 395381
URL: https://svnweb.freebsd.org/changeset/ports/395381

  graphics/darktable: Add patch to support LLVM/Clang 3.7.0

  PR:		202594
  Reviewed by:	bapt, kwm
  Approved by:	bapt
  Differential Revision:	https://reviews.freebsd.org/D3247

Comment 4 Jean-Sébastien Pédron freebsd_committer 2015-08-26 17:11:09 UTC
(In reply to John Marino from comment #2)

Hi John!

The problem you see is related to Ninja 1.6.0. See #202399:
Comment 5 John Marino freebsd_committer 2015-08-26 17:48:23 UTC
Thanks, it's building now.