Opened 8 years ago

Closed 7 years ago

#53994 closed defect (fixed)

highlight @3.36 fails to build with libc++

Reported by: 1-61803 Owned by: kencu (Ken)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: highlight

Description

It also fails with 3.28 and 3.35. According to #53719, 3.35 builds on 10.6 and there's also a workaround posted for 3.36 on 10.7 that I haven't tried yet on 10.8.

Attachments (1)

highlight_failed_main.log (160.5 KB) - added by 1-61803 8 years ago.

Download all attachments as: .zip

Change History (5)

Changed 8 years ago by 1-61803

Attachment: highlight_failed_main.log added

comment:1 Changed 8 years ago by ryandesign (Ryan Carsten Schmidt)

Yes, this is another case of a build system that does not understand that it needs to use CXXFLAGS at link time as well when linking C++ code. The workaround posted in #53719 should be sufficient until the port or the build system is fixed.

comment:2 Changed 8 years ago by 1-61803

I confirm sudo port install highlight configure.cxxflags="-stdlib=libc++" configure.cxx="clang++ -stdlib=libc++" builds 3.36 on 10.8.

comment:3 Changed 8 years ago by 1-61803

Thanks to Ken Cunningham for the guidance, see this post and related thread.

On 10.8 I had 3 possibilities:

  1. run this command, see also ticket:53719#comment:12.
    sudo port install highlight configure.cxxflags="-stdlib=libc++" configure.cxx="clang++ -stdlib=libc++"
    
  2. patch the portfile with the flags in 1.
  1. install a newer compiler and change runtime.

I did the latter: installed clang-3.9 and set libc++.

  1. modify /opt/local/etc/macports/macports.conf (see here).
    default_compilers  macports-clang-3.9
    cxx_stdlib         libc++
    buildfromsource    always
    delete_la_files    yes
    
  2. patch the compiler to use libc++ in <10.9.

· check out bb3b700f76 from macports-ports (clang-3.9 @3.9.0_2) and patch it manually, or

· use the files from Ken's GitHub repo

Basically, in the portfile add

# patch clang to always default to -stdlib=libc++, even on <10.9
patchfiles-append 999-patch-clang-3.9-Toolchains-default-always-libcxx.diff

and in the patchfile

--- ./tools/Clang/lib/Driver/ToolChains.cpp.orig	2016-12-21 00:45:00.000000000 -0800
+++ ./tools/Clang/lib/Driver/ToolChains.cpp	2016-12-21 00:45:42.000000000 -0800
@@ -73,7 +73,7 @@
        isTargetWatchOSBased())
     return ToolChain::CST_Libcxx;
 
-  return ToolChain::CST_Libstdcxx;
+  return ToolChain::CST_Libcxx;
 }

comment:4 Changed 7 years ago by kencu (Ken)

Owner: set to kencu
Resolution: fixed
Status: newclosed

In 1aee29e12f6c9ee099f1fd194df8623daa9b5108/macports-ports:

highlight: update to 3.39

change to cxx11 1.1 portgroup
add -stdlib to clang builds
fixes: #53994
fixes: #53719

Note: See TracTickets for help on using tickets.