Wiki Roadmap Timeline Tickets New Ticket Source Search Help / Guide About Trac Login

Changeset 808:4ad1e7b10378

Show
Ignore:
Timestamp:
11/30/08 13:19:39 (1 month ago)
Author:
elrood
branch:
default
Message:

when building the runtime pass -fPIC for shared libs and -disable-invariants for gc

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • bin/ldc2.conf

    r759 r808  
    1  
    21[Environment] 
    3  
    42DFLAGS=-I%@P%/../druntime/import -L-L%@P%/../druntime/lib 
  • ldc2.conf.in

    r785 r808  
    1  
    21[Environment] 
    3  
    42DFLAGS=-I@RUNTIME_DIR@/import -L-L@RUNTIME_DIR@/lib 
  • runtime/CMakeLists.txt

    r791 r808  
    1313set(D_FLAGS -g -w -d CACHE STRING "runtime build flags, separated by ;") 
    1414 
     15if(BUILD_SHARED_LIBS) 
     16    list(APPEND D_FLAGS -fPIC) 
     17endif(BUILD_SHARED_LIBS) 
     18 
     19# build tango for D1, druntime for D2 
    1520if(D_VERSION EQUAL 1) 
    1621    set(RUNTIME tango) 
     
    2429 
    2530if(D_VERSION EQUAL 1) 
    26     # build tango for D1, druntime for D2 
    2731    set(LDC_EXE ldc) 
    2832    # copy imports to runtime dir 
     
    5458    file(GLOB CORE_D ${RUNTIME_DIR}/src/common/core/*.d) 
    5559    file(GLOB CORE_C ${RUNTIME_DIR}/src/common/core/stdc/*.c) 
    56 else(D_VERSION EQUAL 1) 
    57     message(FATAL_ERROR "set d version to 1 or 2") 
    5860endif(D_VERSION EQUAL 1) 
    5961 
     
    8688        WORKING_DIRECTORY ${RUNTIME_DIR} 
    8789    ) 
     90    # rebuild cache to include sources added by patch 
    8891    add_custom_command( 
    8992        OUTPUT recache 
     
    98101 
    99102# compile d file into outdir, include incdir, and append names of generated .o and .bc to outlist_o and _bc 
    100 macro(dc INPUT_D OUTLIST_O OUTLIST_BC OUTDIR INCDIR
     103macro(dc INPUT_D OUTLIST_O OUTLIST_BC OUTDIR INCDIR MOREFLAGS
    101104    get_filename_component(BASENAME ${INPUT_D} NAME_WE) 
    102105    set(OUTPUT_O ${PROJECT_BINARY_DIR}/${OUTDIR}/${BASENAME}.o) 
     
    108111            ${OUTPUT_O} 
    109112            ${OUTPUT_BC} 
    110         COMMAND ${LDC_LOC} -c -I${INCDIR} -output-bc ${INPUT_D} -of${OUTPUT_O} ${D_FLAGS} 
     113        COMMAND ${LDC_LOC} -c -I${INCDIR} -output-bc ${INPUT_D} -of${OUTPUT_O} ${D_FLAGS} ${MOREFLAGS} 
    111114        DEPENDS ${LDC_LOC} 
    112115    ) 
     
    115118# dc_dir include for core and gc only necessary with druntime 
    116119foreach(f ${CORE_D}) 
    117     dc(${f} CORE_O CORE_BC core ${RUNTIME_DC_DIR}
     120    dc(${f} CORE_O CORE_BC core ${RUNTIME_DC_DIR} ""
    118121endforeach(f) 
    119122 
    120123foreach(f ${GC_D}) 
    121     dc(${f} GC_O GC_BC gc "${RUNTIME_GC_DIR} ${RUNTIME_DC_DIR}"
     124    dc(${f} GC_O GC_BC gc "${RUNTIME_GC_DIR} ${RUNTIME_DC_DIR}" "-disable-invariants"
    122125endforeach(f) 
    123126 
    124127foreach(f ${DCRT_D}) 
    125     dc(${f} DCRT_O DCRT_BC dcrt ${RUNTIME_DC_DIR}
     128    dc(${f} DCRT_O DCRT_BC dcrt ${RUNTIME_DC_DIR} ""
    126129endforeach(f) 
    127130 
Copyright © 2008, LDC Development Team.