source: trunk/dports/editors/textmate2/files/172ce9d4282e408fe60b699c432390b9f6e3f74a.patch @ 136712

Last change on this file since 136712 was 136712, checked in by cal@…, 5 years ago

textmate2: update to beta 7.1, fix build with Xcode clang by backporting upstream fix, closes #47820

File size: 1.6 KB
  • ./Frameworks/crash/src/info.cc

    From 172ce9d4282e408fe60b699c432390b9f6e3f74a Mon Sep 17 00:00:00 2001
    From: Ronald Wampler <rdwampler@gmail.com>
    Date: Wed, 22 Apr 2015 21:47:53 -0400
    Subject: [PATCH] Replace `thread_local` with boost equivalent
    
    The new version of clang (Apple LLVM version 6.1.0) as shipped with Xcode 6.3, disabled TLS. According to http://clang.llvm.org/cxx_status.html, in order to support `thread_local`, the C++ runtime library from g++-4.8 or later is needed.
    
    For now, we can use the boost `thread_specific_ptr`. This is probably a reasonable solution since 1) it should be portable with old and future versions of (Apple's) clang and 2) requires no additional dependencies.
    ---
     Frameworks/crash/src/info.cc | 8 ++++++--
     target                       | 2 ++
     2 files changed, 8 insertions(+), 2 deletions(-)
    
    diff --git ./Frameworks/crash/src/info.cc ./Frameworks/crash/src/info.cc
    index 5c98180..b83789b 100644
     
    11#include "info.h"
     2#include <boost/thread/tss.hpp>
    23#include <oak/debug.h>
    34
    45/* CrashReporter info */
    namespace 
    5859
    5960        static stack_t& stack ()
    6061        {
    61                 thread_local stack_t stack;
    62                 return stack;
     62                static boost::thread_specific_ptr<stack_t> stackPtr;
     63                if(!stackPtr.get())
     64                        stackPtr.reset(new stack_t);
     65
     66                return *stackPtr;
    6367        }
    6468}
    6569
  • ./target

    diff --git ./target ./target
    index 5d8e2.7..6731511 100644
    LN_FLAGS += -rpath @executable_path/../Frameworks 
    2828CXX_FLAGS += -I"$capnp_prefix/include"
    2929LN_FLAGS  += -L"$capnp_prefix/lib"
    3030
     31LN_FLAGS += -lboost_thread-mt
     32
    3133PRELUDE = Shared/PCH/prelude.*
    3234
    3335TARGETS  = vendor/*/target
Note: See TracBrowser for help on using the repository browser.