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
URL:
Keywords:
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)


Attachments
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:

http://package18.nyi.freebsd.org/data/headamd64PR201377-default/2015-07-31_13h29m42s/logs/errors/darktable-1.6.7.log

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
  "/usr/work/share/dim/ports/graphics/darktable/work/.build/data/darktable.desktop".
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:
https://reviews.freebsd.org/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
  "/wrkdirs/graphics/darktable/work/.build/data/darktable.desktop".
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

Log:
  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

Changes:
  head/graphics/darktable/files/patch-src_common_darktable.c
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:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202399
Comment 5 John Marino freebsd_committer 2015-08-26 17:48:23 UTC
Thanks, it's building now.