From 00c073819f19e84ced7bd050c60c80ae891ec3e9 Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Mon, 27 May 2013 19:00:55 +0200 Subject: [PATCH 1/4] Avoid setting C compiler flags on threadasm.S. --- runtime/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index ba436894..7f9b4dc5 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -93,9 +93,10 @@ file(GLOB_RECURSE CORE_D_UNIX ${RUNTIME_DIR}/src/core/sys/posix/*.d) file(GLOB_RECURSE CORE_D_OSX ${RUNTIME_DIR}/src/core/sys/osx/*.d) file(GLOB_RECURSE CORE_D_WIN ${RUNTIME_DIR}/src/core/sys/windows/*.d) set(CORE_D_SYS) +set(DCRT_ASM) if(UNIX) list(APPEND CORE_D_SYS ${CORE_D_UNIX}) - list(APPEND DCRT_C ${RUNTIME_DIR}/src/core/threadasm.S) + list(APPEND DCRT_ASM ${RUNTIME_DIR}/src/core/threadasm.S) if(APPLE) list(APPEND CORE_D_SYS ${CORE_D_OSX}) endif() @@ -297,6 +298,7 @@ macro(build_runtime d_flags c_flags ld_flags lib_suffix path_suffix outlist_targ ${GC_O} ${DCRT_O} ${DCRT_C} + ${DCRT_ASM} ${GCCBUILTINS} ) set(lib_targets ${RUNTIME_AIO}${target_suffix}) From 39313e7735850f2e37a443f984a067fd8515f96c Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Mon, 27 May 2013 20:06:51 +0200 Subject: [PATCH 2/4] Ugly workaround for broken asm support in older CMake versions. The only justification for this is the fact that we need it to work for the release process. --- runtime/CMakeLists.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index 7f9b4dc5..2fa68c76 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -115,6 +115,19 @@ list(APPEND CORE_D ${CORE_D_SYNC} ${CORE_D_SYS} ${CORE_D_STDC}) list(APPEND CORE_D ${LDC_D} ${RUNTIME_DIR}/src/object_.d) file(GLOB CORE_C ${RUNTIME_DIR}/src/core/stdc/*.c) +# CMake 2.8.0 on Ubuntu 10.04 LTS chooses /usr/bin/as for the as compiler +# instead of passing the file through GCC. Other old CMake versions may be +# affected too, but said configuration is critical because it is the officialy +# "blessed" host platform for the release packages. The workaround relies on +# the fact that the default C compiler is GCC (or compatibile), the driver of +# which intelligently handles the different input file types. +if(CMAKE_VERSION VERSION_LESS "2.8.1") + if(UNIX) + message(WARNING "CMake version known not to handle druntime asm source files correctly, forcing them to be treated as C.") + set_source_files_properties(${DCRT_ASM} PROPERTIES LANGUAGE C) + endif() +endif() + if(PHOBOS2_DIR) if(BUILD_SHARED_LIBS) # std.net.curl depends on libcurl – when building a shared library, we From e0dd8ef8ef86f49bad9b9ceb26448fba2746195d Mon Sep 17 00:00:00 2001 From: kai Date: Thu, 30 May 2013 13:50:17 +0200 Subject: [PATCH 3/4] Change version number for release --- dmd2/mars.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dmd2/mars.c b/dmd2/mars.c index cd06970f..8f82bd6d 100644 --- a/dmd2/mars.c +++ b/dmd2/mars.c @@ -102,7 +102,7 @@ Global::Global() #endif #if IN_LLVM version = "v2.062"; - ldc_version = "trunk"; + ldc_version = "0.11.0"; llvm_version = "LLVM "LDC_LLVM_VERSION_STRING; #endif From 26eb95d91eb9de6a77fc7ff2f0fcac1ca44a6900 Mon Sep 17 00:00:00 2001 From: kai Date: Fri, 31 May 2013 21:21:27 +0200 Subject: [PATCH 4/4] Add debug info for vector types. --- gen/todebug.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/gen/todebug.cpp b/gen/todebug.cpp index 0ca88df6..662cedd9 100644 --- a/gen/todebug.cpp +++ b/gen/todebug.cpp @@ -163,6 +163,26 @@ static llvm::DIType dwarfPointerType(Type* type) ////////////////////////////////////////////////////////////////////////////////////////////////// +static llvm::DIType dwarfVectorType(Type* type) +{ + LLType* T = DtoType(type); + Type* t = type->toBasetype(); + + assert(t->ty == Tvector && "only vectors allowed for debug info in dwarfVectorType"); + + // find base type + llvm::DIType basetype = dwarfTypeDescription_impl(static_cast(t)->elementType(), NULL); + + return gIR->dibuilder.createVectorType( + getTypeBitSize(T), // size (bits) + getABITypeAlign(T)*8, // align (bits) + basetype, // element type + llvm::DIArray(0) // subscripts + ); +} + +////////////////////////////////////////////////////////////////////////////////////////////////// + static llvm::DIType dwarfMemberType(unsigned linnum, Type* type, llvm::DIFile file, const char* c_name, unsigned offset) { LLType* T = DtoType(type); @@ -396,6 +416,8 @@ static llvm::DIType dwarfTypeDescription_impl(Type* type, const char* c_name) Type* t = type->toBasetype(); if (t->ty == Tvoid) return llvm::DIType(NULL); + else if (t->ty == Tvector) + return dwarfVectorType(type); else if (t->isintegral() || t->isfloating()) return dwarfBasicType(type); else if (t->ty == Tpointer)