fix #667 flags list used as string

enable function and data sections
fix incorrect library search paths
This commit is contained in:
Andreas Hollandt 2014-07-16 18:14:58 +02:00
parent 491c180a54
commit 8af29baeda
9 changed files with 23 additions and 12 deletions

View file

@ -333,7 +333,7 @@ if(GENERATE_OFFTI)
endif()
if(MSVC)
set(EXTRA_CXXFLAGS "/W0 /wd4996 /GF /GR-")
set(EXTRA_CXXFLAGS "/W0 /wd4996 /GF /GR- /MP")
else()
set(EXTRA_CXXFLAGS "-fexceptions")
endif()

View file

@ -71,13 +71,13 @@ if (WIN32 OR NOT LLVM_CONFIG)
# llvm_map_components_to_libraries also includes imagehlp and psapi.
set(LLVM_LDFLAGS "-L${LLVM_LIBRARY_DIRS}")
set(LLVM_LIBRARIES ${tmplibs})
endif()
# When using the CMake LLVM module, LLVM_DEFINITIONS is a list
# instead of a string. Later, the list seperators would entirely
# disappear, replace them by spaces instead. A better fix would be
# to switch to add_definitions() instead of throwing strings around.
string(REPLACE ";" " " LLVM_CXXFLAGS "${LLVM_CXXFLAGS}")
endif()
else()
if (NOT FIND_LLVM_QUIETLY)
message(WARNING "Could not find llvm-config. Try manually setting LLVM_CONFIG to the llvm-config executable of the installation to use.")

View file

@ -282,7 +282,9 @@ static int linkObjToBinaryWin(bool sharedLib)
}
// remove dead code and fold identical COMDATs
if (!opts::disableLinkerStripDead)
if (opts::disableLinkerStripDead)
args.push_back("/OPT:NOREF");
else
{
args.push_back("/OPT:REF");
args.push_back("/OPT:ICF");

View file

@ -439,7 +439,9 @@ llvm::TargetMachine* createTargetMachine(
// on OS X supports a similar flag (-dead_strip) that doesn't require
// emitting the symbols into different sections. The MinGW ld doesn't seem
// to support --gc-sections at all, and FreeBSD needs more investigation.
if (!noLinkerStripDead && triple.getOS() == llvm::Triple::Linux) {
if (!noLinkerStripDead &&
(triple.getOS() == llvm::Triple::Linux || triple.getOS() == llvm::Triple::Win32))
{
#if LDC_LLVM_VER < 305
llvm::TargetMachine::setDataSections(true);
llvm::TargetMachine::setFunctionSections(true);

View file

@ -2047,9 +2047,9 @@ namespace AsmParserx8664
if ( token->value == TOKeof && op == Op_FMath0 )
{
// FIXME: verify - no iteration for x86 vs. single iteration for x64
// no iteration for x86 vs. single iteration for x64
#ifndef ASM_X86_64
for (operand_i = 0; operand_i < 0; operand_i++)
while (false)
#else
for (operand_i = 0; operand_i < 1; operand_i++)
#endif

View file

@ -10,6 +10,9 @@ default:
"-I@PROJECT_BINARY_DIR@/../import",
"-I@RUNTIME_DIR@/src", // Needed for gc.*/rt.* unit tests.
"-L-L@PROJECT_BINARY_DIR@/../lib@LIB_SUFFIX@",@MULTILIB_ADDITIONAL_PATH@@SHARED_LIBS_RPATH@
"-L-L@PROJECT_BINARY_DIR@/../lib@LIB_SUFFIX@/Debug",
"-L-L@PROJECT_BINARY_DIR@/../lib@LIB_SUFFIX@/Release",
"-L-L@PROJECT_BINARY_DIR@/../lib@LIB_SUFFIX@/RelWithDebInfo",
"-defaultlib=druntime-ldc",
"-debuglib=druntime-ldc-debug"
];

View file

@ -11,6 +11,9 @@ default:
"-I@RUNTIME_DIR@/src", // Needed for gc.*/rt.* unit tests.
"-I@PHOBOS2_DIR@/",
"-L-L@PROJECT_BINARY_DIR@/../lib@LIB_SUFFIX@",@MULTILIB_ADDITIONAL_PATH@@SHARED_LIBS_RPATH@
"-L-L@PROJECT_BINARY_DIR@/../lib@LIB_SUFFIX@/Debug",
"-L-L@PROJECT_BINARY_DIR@/../lib@LIB_SUFFIX@/Release",
"-L-L@PROJECT_BINARY_DIR@/../lib@LIB_SUFFIX@/RelWithDebInfo",
"-defaultlib=phobos2-ldc,druntime-ldc",
"-debuglib=phobos2-ldc-debug,druntime-ldc-debug"
];

View file

@ -731,6 +731,7 @@ function(add_tests d_files runner name_suffix)
foreach(file ${d_files})
file_to_module_name(${file} module)
add_test(NAME "${module}${name_suffix}"
WORKING_DIRECTORY "${PROJECT_BINARY_DIR}"
COMMAND ${runner}-test-runner${name_suffix} ${module}
)
set_tests_properties("${module}${name_suffix}" PROPERTIES