@@ -16,9 +16,6 @@ if(NOT LDC_EXE)
16
16
if (NOT DEFINED DMDFE_MINOR_VERSION OR NOT DEFINED DMDFE_PATCH_VERSION )
17
17
message (FATAL_ERROR "Please define the CMake variables DMDFE_MINOR_VERSION and DMDFE_PATCH_VERSION." )
18
18
endif ()
19
- if (NOT DEFINED LDC_WITH_LLD )
20
- message (FATAL_ERROR "Please define the CMake variable LDC_WITH_LLD." )
21
- endif ()
22
19
endif ()
23
20
24
21
#
@@ -263,13 +260,6 @@ endif()
263
260
# Create configuration files.
264
261
#
265
262
266
- if (PHOBOS2_DIR )
267
- set (build_defaultlib "phobos2-ldc,druntime-ldc" )
268
- else ()
269
- set (build_defaultlib "druntime-ldc" )
270
- endif ()
271
- set (install_defaultlib "phobos2-ldc,druntime-ldc" )
272
-
273
263
# Only have either shared or static libs?
274
264
# Then explicitly default to linking against them via default LDC switch.
275
265
if (${BUILD_SHARED_LIBS} STREQUAL "ON" )
@@ -278,26 +268,14 @@ elseif(${BUILD_SHARED_LIBS} STREQUAL "OFF")
278
268
list (APPEND switches "-link-defaultlib-shared=false" )
279
269
endif ()
280
270
281
- # LLVM 16: Disable function specializations by default.
282
- # They cause miscompiles of e.g. the frontend for some targets (macOS x86_64 and Windows x64).
283
- if ( LDC_LLVM_VER GREATER 1599 AND LDC_LLVM_VER LESS 1700 )
284
- list ( APPEND switches "-func-specialization-size-threshold=1000000000 " )
271
+ if ( PHOBOS2_DIR )
272
+ set ( build_defaultlib "phobos2-ldc,druntime-ldc" )
273
+ else ( )
274
+ set ( build_defaultlib "druntime-ldc " )
285
275
endif ()
286
276
287
277
set (build_switches "-defaultlib=${build_defaultlib} " ${switches} )
288
- set (install_switches "-defaultlib=${install_defaultlib} " ${switches} )
289
-
290
- # Directory filled with auto-generated import files
291
- set (LDC_GCCBUILTINS_IMPORT_DIR "${CMAKE_BINARY_DIR} /import" )
292
- list (APPEND build_post_switches
293
- "-I${RUNTIME_DIR} /src"
294
- "-I${LDC_GCCBUILTINS_IMPORT_DIR} "
295
- "-I${JITRT_DIR} /d"
296
- )
297
- if (PHOBOS2_DIR )
298
- list (APPEND build_post_switches "-I${PHOBOS2_DIR} " )
299
- endif ()
300
- set (install_post_switches "-I${INCLUDE_INSTALL_DIR} " )
278
+ set (install_switches ${switches} )
301
279
302
280
set (build_libdir "${CMAKE_BINARY_DIR} /lib${LIB_SUFFIX} " )
303
281
set (install_libdir "${CMAKE_INSTALL_LIBDIR} " )
@@ -313,34 +291,15 @@ makeConfSection(NAME "30-ldc-runtime-lib${LIB_SUFFIX}"
313
291
314
292
BUILD
315
293
SWITCHES ${build_switches}
316
- POST_SWITCHES OVERRIDE ${build_post_switches}
317
294
LIB_DIRS OVERRIDE ${build_libdir}
318
295
RPATH ${build_rpath}
319
296
320
297
INSTALL
321
298
SWITCHES ${install_switches}
322
- POST_SWITCHES OVERRIDE ${install_post_switches}
323
299
LIB_DIRS OVERRIDE ${install_libdir}
324
300
RPATH ${install_rpath}
325
301
)
326
302
327
- list (APPEND wasm_switches -defaultlib= )
328
- # Default wasm stack is only 64kb, this is rather small, let's bump it to 1mb
329
- list (APPEND wasm_switches -L-z -Lstack-size=1048576 )
330
- # Protect from stack overflow overwriting global memory
331
- list (APPEND wasm_switches -L--stack-first )
332
- if (LDC_WITH_LLD )
333
- list (APPEND wasm_switches -link-internally )
334
- endif ()
335
- # LLD 8+ requires (new) `--export-dynamic` for WebAssembly (https://github.com/ldc-developers/ldc/issues/3023).
336
- list (APPEND wasm_switches -L--export-dynamic )
337
-
338
- makeConfSection (NAME "40-ldc-wasm"
339
- SECTION "^wasm(32|64)-"
340
- SWITCHES ${wasm_switches}
341
- LIB_DIRS OVERRIDE
342
- )
343
-
344
303
# macOS has fat libraries; otherwise, append a separate config file section for the
345
304
# multilib target and override the lib directory.
346
305
if (MULTILIB AND NOT "${TARGET_SYSTEM} " MATCHES "APPLE" )
@@ -355,9 +314,11 @@ if(MULTILIB AND NOT "${TARGET_SYSTEM}" MATCHES "APPLE")
355
314
set (sectionPlaceholder "LDC_CONF_MULTILIB_TRIPLE_REGEX" )
356
315
makeConfSection (NAME "${name} "
357
316
SECTION "${sectionPlaceholder} "
317
+
358
318
BUILD
359
319
LIB_DIRS OVERRIDE ${build_libdir}
360
- RPATH ${build_rpath}
320
+ RPATH ${build_rpath}
321
+
361
322
INSTALL
362
323
LIB_DIRS OVERRIDE ${install_libdir}
363
324
RPATH ${install_rpath}
0 commit comments