From 6ad085a1f8e3847d53a0e80c6ad5d1c8c7718c0d Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Tue, 5 Jun 2012 10:57:52 +0200 Subject: [PATCH] Only allow __Dmain to remain undefined in druntime to avoid hidden build errors. --- runtime/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index 55636cf1..672ebf8e 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -30,7 +30,9 @@ set(D_FLAGS -g -w -d CACHE STRING "runtime build flags, separated by ;") if(BUILD_SHARED_LIBS) list(APPEND D_FLAGS -relocation-model=pic) if(APPLE) - list(APPEND LD_FLAGS -Wl,-undefined,dynamic_lookup) + # We need to explicitly specify that __Dmain should be resolved at + # runtime with the default OS X tool chain. + list(APPEND LD_FLAGS -Wl,-U,__Dmain) endif() set(D_LIBRARY_TYPE SHARED) else(BUILD_SHARED_LIBS)