Bug 263179 - devel/flang-clang: fix build with libc++ 14
Summary: devel/flang-clang: fix build with libc++ 14
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: Johannes M Dieterich
URL:
Keywords:
Depends on:
Blocks: 261742
  Show dependency treegraph
 
Reported: 2022-04-09 15:14 UTC by Dimitry Andric
Modified: 2022-04-26 19:16 UTC (History)
0 users

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


Attachments
devel/flang-clang: fix build with libc++ 14 (1.17 KB, patch)
2022-04-09 15:15 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 freebsd_triage 2022-04-09 15:14:42 UTC
During an exp-run for llvm 14 (see bug 261742), it turned out that devel/flang-clang fails to build with libc++ 14:

-- Performing Test LLVM_NO_OLD_LIBSTDCXX - Failed
CMake Error at /usr/local/llvm70/lib/cmake/llvm/CheckCompilerVersion.cmake:38 (message):
  Host Clang must be able to find libstdc++4.8 or newer!
Call Stack (most recent call first):
  /usr/local/llvm70/lib/cmake/llvm/HandleLLVMOptions.cmake:9 (include)
  CMakeLists.txt:95 (include)


-- Configuring incomplete, errors occurred!
See also "/wrkdirs/usr/ports/devel/flang-clang/work/.build/CMakeFiles/CMakeOutput.log".
See also "/wrkdirs/usr/ports/devel/flang-clang/work/.build/CMakeFiles/CMakeError.log".
*** Error code 1

This is because libc++ 14 no longer builds if the compiler doesn't support __builtin_is_constant_evaluated(). Similar to other ports, add a wrapper to make it work.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2022-04-09 15:15:08 UTC
Created attachment 233101 [details]
devel/flang-clang: fix build with libc++ 14
Comment 2 commit-hook freebsd_committer freebsd_triage 2022-04-26 19:16:41 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=dd89b97ac0fccbb4486ca60e2ed33f8d434719ed

commit dd89b97ac0fccbb4486ca60e2ed33f8d434719ed
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-04-09 15:12:07 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2022-04-26 19:15:37 +0000

    devel/flang-clang: fix build with libc++ 14

    During an exp-run for llvm 14 (see bug 261742), it turned out that
    devel/flang-clang fails to build with libc++ 14:

    -- Performing Test LLVM_NO_OLD_LIBSTDCXX - Failed
    CMake Error at /usr/local/llvm70/lib/cmake/llvm/CheckCompilerVersion.cmake:38 (message):
      Host Clang must be able to find libstdc++4.8 or newer!
    Call Stack (most recent call first):
      /usr/local/llvm70/lib/cmake/llvm/HandleLLVMOptions.cmake:9 (include)
      CMakeLists.txt:95 (include)

    -- Configuring incomplete, errors occurred!
    See also "/wrkdirs/usr/ports/devel/flang-clang/work/.build/CMakeFiles/CMakeOutput.log".
    See also "/wrkdirs/usr/ports/devel/flang-clang/work/.build/CMakeFiles/CMakeError.log".
    *** Error code 1

    This is because libc++ 14 no longer builds if the compiler doesn't
    support __builtin_is_constant_evaluated(). Similar to other ports, add a
    wrapper to make it work.

    PR:             263179
    Approved by:    maintainer timeout (2 weeks)
    MFH:            2022Q2

 devel/flang-clang/Makefile                                    | 3 +++
 devel/flang-clang/files/builtin_is_constant_evaluated.h (new) | 4 ++++
 2 files changed, 7 insertions(+)