Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build outside source dir #12

Closed
wants to merge 29 commits into from
Closed

Fix build outside source dir #12

wants to merge 29 commits into from

Conversation

bioinfornatics
Copy link
Contributor

Fix build outside source dir

@@ -281,11 +290,18 @@ if(BUILD_BC_LIBS)
set(BCLIBS bclibs)
endif(BUILD_BC_LIBS)

if(D_VERSION EQUAL 2)
if(NOT ROJECT_BINARY_DIR STREQUAL "${PROJECT_SOURCE_DIR}")
file(COPY ${PROJECT_PARENT_DIR}/${RUNTIME} DESTINATION ${PROJECT_BINARY_DIR}/../)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes typo, thanks

install(FILES ${PROJECT_SOURCE_DIR}/bin/${LDC_EXE}.rebuild.conf DESTINATION ${CONF_INST_DIR})
install(FILES ${library} DESTINATION ${CMAKE_INSTALL_LIBDIR})

if(NOT "" STREQUAL "")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like the result of a search/replace accident…

@bioinfornatics
Copy link
Contributor Author

oh yes right i miss remove this code, unused since chroot_install_dir is removed
thanks

set(CONF_INST_DIR ${SYSCONF_INSTALL_DIR} CACHE PATH "Set ldc.conf directory for installation")
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib${LIB_SUFFIX} CACHE PATH "output dir for built libraries")
set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/d CACHE PATH "Directory where will be put header files")
set(BUILD_SHARED_LIBS ON CACHE BOOL "Build as shared library or as static library")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it enabled by default? It probably works only on linux.

@dnadlinger
Copy link
Member

Since this pull request became quite a mess over time, I merged a slightly cleaned up version (less whitespace changes, removed the unused CHROOT_INSTALL_DIR) in a single commit, 4703232. I'm to blame for any mistakes made in that process… ;)

@dnadlinger dnadlinger closed this Nov 9, 2011
@dnadlinger dnadlinger mentioned this pull request Nov 11, 2011
redstar added a commit that referenced this pull request Sep 27, 2014
timotheecour pushed a commit to timotheecour/ldc that referenced this pull request Dec 13, 2017
…ter types returned by semantic().

Sometimes types aren't merged and their deco are copied manually, do the same for equivDeco so function overriding works properly.
timotheecour pushed a commit to timotheecour/ldc that referenced this pull request Dec 13, 2017
Unlike Clang, LDC flattens anon structs into the parent's LLVM struct type:

    %withanonstruct_d = type { i32, float, i8, [3 x i8] }  ; LDC
    %struct.withanonstruct_cpp = type { i32, %struct.anon }  ; Clang
    %struct.anon = type { float, i8 }

Same goes for base classes and anonymous unions, so Calypso shouldn't access fields through LDC's flat varGEPIndices.

This didn't cause issues with base classes because the derived class pointer is always bitcast to the base one, but it did break if buildGEPIndices was querying the LLVM field number for an injected field.

Letting Clang handle the GEP construction is a more robust approach, and this fixes the segfault during codegen while compiling wilsonk's FastFlow demo (ldc-developers#12).
timotheecour pushed a commit to timotheecour/ldc that referenced this pull request Dec 13, 2017
Default ctors and dtors of records that are implicitly called if a field is one such record may not appear anywhere in its parent AST node.

Fixes the remaining linking error from ldc-developers#12.
timotheecour pushed a commit to timotheecour/ldc that referenced this pull request Dec 13, 2017
Clang was already trying to emit a global ctor/dtor for global variables, but assumed wrong that @llvm.global_ctors didn't exist.

This fixes the segfault of the FastFlow example by wilsonk (ldc-developers#12).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants