2017-12-12 04:34:59 +00:00
const std = @import ( " std " ) ;
2021-04-12 23:44:51 +00:00
const builtin = std . builtin ;
2017-12-12 04:34:59 +00:00
const Builder = std . build . Builder ;
2017-04-19 05:13:15 +00:00
const tests = @import ( " test/tests.zig " ) ;
2017-12-12 04:34:59 +00:00
const BufMap = std . BufMap ;
const mem = std . mem ;
const ArrayList = std . ArrayList ;
const io = std . io ;
2019-05-26 17:17:34 +00:00
const fs = std . fs ;
2019-07-14 07:06:20 +00:00
const InstallDirectoryOptions = std . build . InstallDirectoryOptions ;
2020-09-04 03:23:00 +00:00
const assert = std . debug . assert ;
2017-04-19 05:13:15 +00:00
2022-10-31 17:25:46 +00:00
const zig_version = std . builtin . Version { . major = 0 , . minor = 11 , . patch = 0 } ;
2022-07-21 19:20:50 +00:00
const stack_size = 32 * 1024 * 1024 ;
2020-08-15 21:17:40 +00:00
2018-05-31 14:56:59 +00:00
pub fn build ( b : * Builder ) ! void {
2022-12-01 23:34:15 +00:00
const release = b . option ( bool , " release " , " Build in release mode " ) orelse false ;
const only_c = b . option ( bool , " only-c " , " Translate the Zig compiler to C code, with only the C backend enabled " ) orelse false ;
2022-11-05 01:35:04 +00:00
const target = t : {
var default_target : std . zig . CrossTarget = . { } ;
2022-12-01 23:34:15 +00:00
if ( only_c ) {
2022-11-05 01:35:04 +00:00
default_target . ofmt = . c ;
}
break : t b . standardTargetOptions ( . { . default_target = default_target } ) ;
} ;
2023-01-31 04:39:43 +00:00
const optimize : std . builtin . OptimizeMode = if ( release ) switch ( target . getCpuArch ( ) ) {
2022-11-05 01:35:04 +00:00
. wasm32 = > . ReleaseSmall ,
else = > . ReleaseFast ,
} else . Debug ;
2022-01-29 00:16:51 +00:00
const single_threaded = b . option ( bool , " single-threaded " , " Build artifacts that run in single threaded mode " ) ;
2021-09-16 20:09:32 +00:00
const use_zig_libcxx = b . option ( bool , " use-zig-libcxx " , " If libc++ is needed, use zig's bundled version, don't try to integrate with the system " ) orelse false ;
2017-10-21 21:31:06 +00:00
2022-11-05 01:35:04 +00:00
const test_step = b . step ( " test " , " Run all the tests " ) ;
2023-01-31 04:39:43 +00:00
const docgen_exe = b . addExecutable ( . {
. name = " docgen " ,
. root_source_file = . { . path = " doc/docgen.zig " } ,
. target = . { } ,
. optimize = . Debug ,
} ) ;
2021-06-03 17:06:22 +00:00
docgen_exe . single_threaded = single_threaded ;
2017-11-07 08:22:27 +00:00
2019-05-26 17:17:34 +00:00
const rel_zig_exe = try fs . path . relative ( b . allocator , b . build_root , b . zig_exe ) ;
const langref_out_path = fs . path . join (
2019-02-07 05:42:41 +00:00
b . allocator ,
2019-11-27 08:30:39 +00:00
& [ _ ] [ ] const u8 { b . cache_root , " langref.html " } ,
2019-02-07 05:42:41 +00:00
) catch unreachable ;
2022-02-16 20:50:47 +00:00
const docgen_cmd = docgen_exe . run ( ) ;
2019-11-27 08:30:39 +00:00
docgen_cmd . addArgs ( & [ _ ] [ ] const u8 {
2023-01-14 10:54:28 +00:00
" --zig " ,
2018-01-17 06:50:35 +00:00
rel_zig_exe ,
2019-05-26 17:17:34 +00:00
" doc " + + fs . path . sep_str + + " langref.html.in " ,
2018-09-12 15:49:46 +00:00
langref_out_path ,
2017-11-07 08:22:27 +00:00
} ) ;
docgen_cmd . step . dependOn ( & docgen_exe . step ) ;
const docs_step = b . step ( " docs " , " Build documentation " ) ;
docs_step . dependOn ( & docgen_cmd . step ) ;
2023-01-31 04:39:43 +00:00
const test_cases = b . addTest ( . {
. root_source_file = . { . path = " src/test.zig " } ,
. optimize = optimize ,
} ) ;
2022-11-26 00:12:50 +00:00
test_cases . main_pkg_path = " . " ;
2022-07-21 19:20:50 +00:00
test_cases . stack_size = stack_size ;
2022-05-13 07:00:20 +00:00
test_cases . single_threaded = single_threaded ;
2018-01-04 02:32:50 +00:00
2019-11-27 08:30:39 +00:00
const fmt_build_zig = b . addFmt ( & [ _ ] [ ] const u8 { " build.zig " } ) ;
2019-02-26 23:10:40 +00:00
2021-04-24 20:39:26 +00:00
const skip_debug = b . option ( bool , " skip-debug " , " Main test suite skips debug builds " ) orelse false ;
2018-07-11 18:09:05 +00:00
const skip_release = b . option ( bool , " skip-release " , " Main test suite skips release builds " ) orelse false ;
2018-09-12 18:50:26 +00:00
const skip_release_small = b . option ( bool , " skip-release-small " , " Main test suite skips release-small builds " ) orelse skip_release ;
const skip_release_fast = b . option ( bool , " skip-release-fast " , " Main test suite skips release-fast builds " ) orelse skip_release ;
const skip_release_safe = b . option ( bool , " skip-release-safe " , " Main test suite skips release-safe builds " ) orelse skip_release ;
2019-05-15 01:21:59 +00:00
const skip_non_native = b . option ( bool , " skip-non-native " , " Main test suite skips non-native builds " ) orelse false ;
2019-09-22 03:55:56 +00:00
const skip_libc = b . option ( bool , " skip-libc " , " Main test suite skips tests that link libc " ) orelse false ;
2022-06-01 21:05:58 +00:00
const skip_single_threaded = b . option ( bool , " skip-single-threaded " , " Main test suite skips tests that are single-threaded " ) orelse false ;
2022-03-31 22:06:44 +00:00
const skip_stage1 = b . option ( bool , " skip-stage1 " , " Main test suite skips stage1 compile error tests " ) orelse false ;
2021-04-15 06:10:51 +00:00
const skip_run_translated_c = b . option ( bool , " skip-run-translated-c " , " Main test suite skips run-translated-c tests " ) orelse false ;
2021-04-15 23:20:43 +00:00
const skip_stage2_tests = b . option ( bool , " skip-stage2-tests " , " Main test suite skips self-hosted compiler tests " ) orelse false ;
2022-10-27 22:16:14 +00:00
const deprecated_skip_install_lib_files = b . option ( bool , " skip-install-lib-files " , " deprecated. see no-lib " ) orelse false ;
if ( deprecated_skip_install_lib_files ) {
std . log . warn ( " -Dskip-install-lib-files is deprecated in favor of -Dno-lib " , . { } ) ;
}
2022-12-01 23:34:15 +00:00
const skip_install_lib_files = b . option ( bool , " no-lib " , " skip copying of lib/ files to installation prefix. Useful for development " ) orelse deprecated_skip_install_lib_files ;
2017-10-21 21:31:06 +00:00
2019-07-14 07:06:20 +00:00
const only_install_lib_files = b . option ( bool , " lib-files-only " , " Only install library files " ) orelse false ;
2022-02-16 20:50:47 +00:00
2020-12-08 00:23:17 +00:00
const static_llvm = b . option ( bool , " static-llvm " , " Disable integration with system-installed LLVM, Clang, LLD, and libc++ " ) orelse false ;
2022-11-01 03:29:55 +00:00
const enable_llvm = b . option ( bool , " enable-llvm " , " Build self-hosted compiler with LLVM backend enabled " ) orelse static_llvm ;
2021-09-01 05:50:10 +00:00
const llvm_has_m68k = b . option (
bool ,
" llvm-has-m68k " ,
" Whether LLVM has the experimental target m68k enabled " ,
) orelse false ;
const llvm_has_csky = b . option (
bool ,
" llvm-has-csky " ,
" Whether LLVM has the experimental target csky enabled " ,
) orelse false ;
const llvm_has_arc = b . option (
bool ,
" llvm-has-arc " ,
" Whether LLVM has the experimental target arc enabled " ,
) orelse false ;
2021-08-02 08:04:54 +00:00
const enable_macos_sdk = b . option ( bool , " enable-macos-sdk " , " Run tests requiring presence of macOS SDK and frameworks " ) orelse false ;
2022-11-28 21:04:42 +00:00
const enable_symlinks_windows = b . option ( bool , " enable-symlinks-windows " , " Run tests requiring presence of symlinks on Windows " ) orelse false ;
2020-07-04 01:15:01 +00:00
const config_h_path_option = b . option ( [ ] const u8 , " config_h " , " Path to the generated config.h " ) ;
2020-04-06 17:07:19 +00:00
2021-04-17 01:58:27 +00:00
if ( ! skip_install_lib_files ) {
b . installDirectory ( InstallDirectoryOptions {
. source_dir = " lib " ,
2021-06-11 08:50:48 +00:00
. install_dir = . lib ,
2021-04-17 01:58:27 +00:00
. install_subdir = " zig " ,
. exclude_extensions = & [ _ ] [ ] const u8 {
2022-12-18 23:28:30 +00:00
// exclude files from lib/std/compress/testdata
2022-01-09 01:12:00 +00:00
" .gz " ,
2021-04-17 01:58:27 +00:00
" .z.0 " ,
" .z.9 " ,
" rfc1951.txt " ,
2022-01-09 01:12:00 +00:00
" rfc1952.txt " ,
// exclude files from lib/std/compress/deflate/testdata
" .expect " ,
" .expect-noinput " ,
" .golden " ,
" .input " ,
" compress-e.txt " ,
" compress-gettysburg.txt " ,
" compress-pi.txt " ,
" rfc1951.txt " ,
2023-01-23 19:46:40 +00:00
// exclude files from lib/std/compress/xz/testdata
" .xz " ,
2022-01-09 01:12:00 +00:00
// exclude files from lib/std/tz/
2021-12-31 17:17:49 +00:00
" .tzif " ,
2022-01-09 01:12:00 +00:00
// others
" README.md " ,
2021-04-17 01:58:27 +00:00
} ,
2021-05-19 00:18:42 +00:00
. blank_extensions = & [ _ ] [ ] const u8 {
" test.zig " ,
} ,
2021-04-17 01:58:27 +00:00
} ) ;
}
2017-10-21 21:31:06 +00:00
2020-09-08 18:15:32 +00:00
if ( only_install_lib_files )
return ;
2020-09-17 00:17:37 +00:00
const tracy = b . option ( [ ] const u8 , " tracy " , " Enable Tracy integration. Supply path to Tracy source " ) ;
2022-10-27 01:17:49 +00:00
const tracy_callstack = b . option ( bool , " tracy-callstack " , " Include callstack information with Tracy data. Does nothing if -Dtracy is not provided " ) orelse ( tracy ! = null ) ;
const tracy_allocation = b . option ( bool , " tracy-allocation " , " Include allocation information with Tracy data. Does nothing if -Dtracy is not provided " ) orelse ( tracy ! = null ) ;
2022-01-23 20:10:39 +00:00
const force_gpa = b . option ( bool , " force-gpa " , " Force the compiler to use GeneralPurposeAllocator " ) orelse false ;
2022-12-01 23:34:15 +00:00
const link_libc = b . option ( bool , " force-link-libc " , " Force self-hosted compiler to link libc " ) orelse ( enable_llvm or only_c ) ;
2022-10-05 10:22:10 +00:00
const sanitize_thread = b . option ( bool , " sanitize-thread " , " Enable thread-sanitization " ) orelse false ;
2022-11-05 01:35:04 +00:00
const strip = b . option ( bool , " strip " , " Omit debug information " ) ;
2022-06-09 22:33:04 +00:00
const value_tracing = b . option ( bool , " value-tracing " , " Enable extra state tracking to help troubleshoot bugs in the compiler (using the std.debug.Trace API) " ) orelse false ;
2020-09-17 00:17:37 +00:00
2021-05-04 03:42:36 +00:00
const mem_leak_frames : u32 = b . option ( u32 , " mem-leak-frames " , " How many stack frames to print when a memory leak occurs. Tests get 2x this amount. " ) orelse blk : {
2022-11-05 01:35:04 +00:00
if ( strip = = true ) break : blk @as ( u32 , 0 ) ;
2023-01-31 04:39:43 +00:00
if ( optimize ! = . Debug ) break : blk 0 ;
2021-05-04 03:42:36 +00:00
break : blk 4 ;
} ;
2023-01-31 04:39:43 +00:00
const exe = addCompilerStep ( b , optimize , target ) ;
2021-02-24 23:36:27 +00:00
exe . strip = strip ;
2022-10-05 10:22:10 +00:00
exe . sanitize_thread = sanitize_thread ;
2022-05-31 20:51:59 +00:00
exe . build_id = b . option ( bool , " build-id " , " Include a build id note " ) orelse false ;
2020-09-08 18:15:32 +00:00
exe . install ( ) ;
2022-12-01 23:34:15 +00:00
const compile_step = b . step ( " compile " , " Build the self-hosted compiler " ) ;
compile_step . dependOn ( & exe . step ) ;
2021-09-16 18:21:19 +00:00
if ( ! skip_stage2_tests ) {
2022-08-18 05:17:19 +00:00
test_step . dependOn ( & exe . step ) ;
2021-09-16 18:21:19 +00:00
}
2022-02-16 20:50:47 +00:00
2020-09-08 18:15:32 +00:00
b . default_step . dependOn ( & exe . step ) ;
2021-06-03 17:06:22 +00:00
exe . single_threaded = single_threaded ;
2020-09-08 18:15:32 +00:00
2021-09-16 21:51:29 +00:00
if ( target . isWindows ( ) and target . getAbi ( ) = = . gnu ) {
// LTO is currently broken on mingw, this can be removed when it's fixed.
exe . want_lto = false ;
2022-05-13 07:00:20 +00:00
test_cases . want_lto = false ;
2021-09-16 21:51:29 +00:00
}
2021-08-26 23:53:23 +00:00
const exe_options = b . addOptions ( ) ;
exe . addOptions ( " build_options " , exe_options ) ;
exe_options . addOption ( u32 , " mem_leak_frames " , mem_leak_frames ) ;
exe_options . addOption ( bool , " skip_non_native " , skip_non_native ) ;
exe_options . addOption ( bool , " have_llvm " , enable_llvm ) ;
2021-09-01 05:50:10 +00:00
exe_options . addOption ( bool , " llvm_has_m68k " , llvm_has_m68k ) ;
exe_options . addOption ( bool , " llvm_has_csky " , llvm_has_csky ) ;
exe_options . addOption ( bool , " llvm_has_arc " , llvm_has_arc ) ;
2022-01-23 20:10:39 +00:00
exe_options . addOption ( bool , " force_gpa " , force_gpa ) ;
2022-10-23 20:18:22 +00:00
exe_options . addOption ( bool , " only_c " , only_c ) ;
2023-01-10 18:15:09 +00:00
exe_options . addOption ( bool , " omit_pkg_fetching_code " , false ) ;
2021-08-26 23:53:23 +00:00
2020-09-08 18:15:32 +00:00
if ( link_libc ) {
exe . linkLibC ( ) ;
2022-05-13 07:00:20 +00:00
test_cases . linkLibC ( ) ;
2020-09-08 18:15:32 +00:00
}
2023-01-31 04:39:43 +00:00
const is_debug = optimize = = . Debug ;
2022-02-01 04:11:41 +00:00
const enable_logging = b . option ( bool , " log " , " Enable debug logging with --debug-log " ) orelse is_debug ;
2021-10-14 11:50:10 +00:00
const enable_link_snapshots = b . option ( bool , " link-snapshot " , " Whether to enable linker state snapshots " ) orelse false ;
2020-09-08 18:15:32 +00:00
const opt_version_string = b . option ( [ ] const u8 , " version-string " , " Override Zig version string. Default is to find out with git. " ) ;
2022-12-01 23:34:15 +00:00
const version_slice = if ( opt_version_string ) | version | version else v : {
2022-02-03 22:27:01 +00:00
if ( ! std . process . can_spawn ) {
std . debug . print ( " error: version info cannot be retrieved from git. Zig version must be provided using -Dversion-string \n " , . { } ) ;
std . process . exit ( 1 ) ;
}
2022-02-16 20:50:47 +00:00
const version_string = b . fmt ( " {d}.{d}.{d} " , . { zig_version . major , zig_version . minor , zig_version . patch } ) ;
2020-09-08 18:15:32 +00:00
var code : u8 = undefined ;
2021-01-02 04:01:51 +00:00
const git_describe_untrimmed = b . execAllowFail ( & [ _ ] [ ] const u8 {
" git " , " -C " , b . build_root , " describe " , " --match " , " *.*.* " , " --tags " ,
2020-09-08 18:15:32 +00:00
} , & code , . Ignore ) catch {
break : v version_string ;
} ;
2021-01-02 04:01:51 +00:00
const git_describe = mem . trim ( u8 , git_describe_untrimmed , " \n \r " ) ;
switch ( mem . count ( u8 , git_describe , " - " ) ) {
0 = > {
2022-10-31 17:24:38 +00:00
// Tagged release version (e.g. 0.10.0).
2021-01-02 04:01:51 +00:00
if ( ! mem . eql ( u8 , git_describe , version_string ) ) {
2020-11-26 12:28:38 +00:00
std . debug . print ( " Zig version '{s}' does not match Git tag '{s}' \n " , . { version_string , git_describe } ) ;
2021-01-02 04:01:51 +00:00
std . process . exit ( 1 ) ;
}
break : v version_string ;
} ,
2 = > {
2022-10-31 17:24:38 +00:00
// Untagged development build (e.g. 0.10.0-dev.2025+ecf0050a9).
2021-08-06 09:01:47 +00:00
var it = mem . split ( u8 , git_describe , " - " ) ;
2022-07-25 19:04:30 +00:00
const tagged_ancestor = it . first ( ) ;
const commit_height = it . next ( ) . ? ;
const commit_id = it . next ( ) . ? ;
2021-01-02 04:01:51 +00:00
const ancestor_ver = try std . builtin . Version . parse ( tagged_ancestor ) ;
if ( zig_version . order ( ancestor_ver ) ! = . gt ) {
std . debug . print ( " Zig version '{}' must be greater than tagged ancestor '{}' \n " , . { zig_version , ancestor_ver } ) ;
std . process . exit ( 1 ) ;
}
// Check that the commit hash is prefixed with a 'g' (a Git convention).
if ( commit_id . len < 1 or commit_id [ 0 ] ! = 'g' ) {
2020-11-26 12:28:38 +00:00
std . debug . print ( " Unexpected `git describe` output: {s} \n " , . { git_describe } ) ;
2021-01-02 04:01:51 +00:00
break : v version_string ;
}
// The version is reformatted in accordance with the https://semver.org specification.
2020-11-26 12:28:38 +00:00
break : v b . fmt ( " {s}-dev.{s}+{s} " , . { version_string , commit_height , commit_id [ 1 . . ] } ) ;
2021-01-02 04:01:51 +00:00
} ,
else = > {
2020-11-26 12:28:38 +00:00
std . debug . print ( " Unexpected `git describe` output: {s} \n " , . { git_describe } ) ;
2021-01-02 04:01:51 +00:00
break : v version_string ;
} ,
2020-09-08 18:15:32 +00:00
}
} ;
2022-12-01 23:34:15 +00:00
const version = try b . allocator . dupeZ ( u8 , version_slice ) ;
exe_options . addOption ( [ : 0 ] const u8 , " version " , version ) ;
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
2022-02-16 20:50:47 +00:00
if ( enable_llvm ) {
2022-07-16 00:25:38 +00:00
const cmake_cfg = if ( static_llvm ) null else blk : {
if ( findConfigH ( b , config_h_path_option ) ) | config_h_path | {
const file_contents = fs . cwd ( ) . readFileAlloc ( b . allocator , config_h_path , max_config_h_bytes ) catch unreachable ;
break : blk parseConfigH ( b , file_contents ) ;
} else {
std . log . warn ( " config.h could not be located automatically. Consider providing it explicitly via \" -Dconfig_h \" " , . { } ) ;
break : blk null ;
}
} ;
2022-02-16 20:50:47 +00:00
if ( cmake_cfg ) | cfg | {
// Inside this code path, we have to coordinate with system packaged LLVM, Clang, and LLD.
// That means we also have to rely on stage1 compiled c++ files. We parse config.h to find
// the information passed on to us from cmake.
if ( cfg . cmake_prefix_path . len > 0 ) {
2022-10-11 15:16:27 +00:00
var it = mem . tokenize ( u8 , cfg . cmake_prefix_path , " ; " ) ;
while ( it . next ( ) ) | path | {
b . addSearchPrefix ( path ) ;
}
2022-02-16 20:50:47 +00:00
}
try addCmakeCfgOptionsToExe ( b , cfg , exe , use_zig_libcxx ) ;
2022-05-13 07:00:20 +00:00
try addCmakeCfgOptionsToExe ( b , cfg , test_cases , use_zig_libcxx ) ;
2022-02-16 20:50:47 +00:00
} else {
// Here we are -Denable-llvm but no cmake integration.
2022-11-13 08:42:51 +00:00
try addStaticLlvmOptionsToExe ( exe ) ;
try addStaticLlvmOptionsToExe ( test_cases ) ;
2022-02-16 20:50:47 +00:00
}
2022-12-07 09:50:49 +00:00
if ( target . isWindows ( ) ) {
inline for ( . { exe , test_cases } ) | artifact | {
artifact . linkSystemLibrary ( " version " ) ;
artifact . linkSystemLibrary ( " uuid " ) ;
artifact . linkSystemLibrary ( " ole32 " ) ;
}
}
2022-02-16 20:50:47 +00:00
}
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
const semver = try std . SemanticVersion . parse ( version ) ;
2021-08-26 23:53:23 +00:00
exe_options . addOption ( std . SemanticVersion , " semver " , semver ) ;
2020-09-08 18:15:32 +00:00
2021-08-26 23:53:23 +00:00
exe_options . addOption ( bool , " enable_logging " , enable_logging ) ;
2021-10-14 11:50:10 +00:00
exe_options . addOption ( bool , " enable_link_snapshots " , enable_link_snapshots ) ;
2021-08-26 23:53:23 +00:00
exe_options . addOption ( bool , " enable_tracy " , tracy ! = null ) ;
2021-10-31 14:12:36 +00:00
exe_options . addOption ( bool , " enable_tracy_callstack " , tracy_callstack ) ;
2021-10-31 14:16:59 +00:00
exe_options . addOption ( bool , " enable_tracy_allocation " , tracy_allocation ) ;
2022-06-09 22:33:04 +00:00
exe_options . addOption ( bool , " value_tracing " , value_tracing ) ;
2020-09-08 18:15:32 +00:00
if ( tracy ) | tracy_path | {
const client_cpp = fs . path . join (
b . allocator ,
2022-10-27 01:17:49 +00:00
& [ _ ] [ ] const u8 { tracy_path , " public " , " TracyClient.cpp " } ,
2020-09-08 18:15:32 +00:00
) catch unreachable ;
2021-09-16 21:51:29 +00:00
// On mingw, we need to opt into windows 7+ to get some features required by tracy.
const tracy_c_flags : [ ] const [ ] const u8 = if ( target . isWindows ( ) and target . getAbi ( ) = = . gnu )
& [ _ ] [ ] const u8 { " -DTRACY_ENABLE=1 " , " -fno-sanitize=undefined " , " -D_WIN32_WINNT=0x601 " }
else
& [ _ ] [ ] const u8 { " -DTRACY_ENABLE=1 " , " -fno-sanitize=undefined " } ;
2022-01-24 18:15:32 +00:00
exe . addIncludePath ( tracy_path ) ;
2021-09-16 21:51:29 +00:00
exe . addCSourceFile ( client_cpp , tracy_c_flags ) ;
2020-09-17 00:17:37 +00:00
if ( ! enable_llvm ) {
exe . linkSystemLibraryName ( " c++ " ) ;
}
2020-09-08 18:15:32 +00:00
exe . linkLibC ( ) ;
2021-09-16 21:51:29 +00:00
if ( target . isWindows ( ) ) {
exe . linkSystemLibrary ( " dbghelp " ) ;
exe . linkSystemLibrary ( " ws2_32 " ) ;
}
2020-09-08 18:15:32 +00:00
}
2017-04-19 05:13:15 +00:00
const test_filter = b . option ( [ ] const u8 , " test-filter " , " Skip tests that do not match filter " ) ;
2022-05-13 21:30:43 +00:00
const test_cases_options = b . addOptions ( ) ;
test_cases . addOptions ( " build_options " , test_cases_options ) ;
test_cases_options . addOption ( bool , " enable_logging " , enable_logging ) ;
test_cases_options . addOption ( bool , " enable_link_snapshots " , enable_link_snapshots ) ;
test_cases_options . addOption ( bool , " skip_non_native " , skip_non_native ) ;
test_cases_options . addOption ( bool , " skip_stage1 " , skip_stage1 ) ;
test_cases_options . addOption ( bool , " have_llvm " , enable_llvm ) ;
test_cases_options . addOption ( bool , " llvm_has_m68k " , llvm_has_m68k ) ;
test_cases_options . addOption ( bool , " llvm_has_csky " , llvm_has_csky ) ;
test_cases_options . addOption ( bool , " llvm_has_arc " , llvm_has_arc ) ;
multi-thread `zig build test-cases`
Instead of always using std.testing.allocator, the test harness now follows
the same logic as self-hosted for choosing an allocator - that is - it
uses C allocator when linking libc, std.testing.allocator otherwise, and
respects `-Dforce-gpa` to override the decision. I did this because
I found GeneralPurposeAllocator to be prohibitively slow when doing
multi-threading, even in the context of a debug build.
There is now a second thread pool which is used to spawn each
test case. The stage2 tests are passed the first thread pool. If it were
only multi-threading the stage1 tests then we could use the same thread
pool for everything. However, the problem with this strategy with stage2
is that stage2 wants to spawn tasks and then call wait() on the main
thread. If we use the same thread pool for everything, we get a deadlock
because all the threads end up all hanging at wait() and nothing is
getting done. So we use our second thread pool to simulate a "process pool"
of sorts.
I spent most of the time working on this commit scratching my head trying
to figure out why I was getting ETXTBSY when spawning the test cases.
Turns out it's a fundamental Unix design flaw, already a known, unsolved
issue by Go and Java maintainers:
https://github.com/golang/go/issues/22315
https://bugs.openjdk.org/browse/JDK-8068370
With this change, the following command, executed on my laptop, went from
6m24s to 1m44s:
```
stage1/bin/zig build test-cases -fqemu -fwasmtime -Denable-llvm
```
closes #11818
2022-06-14 01:59:52 +00:00
test_cases_options . addOption ( bool , " force_gpa " , force_gpa ) ;
2022-10-23 20:18:22 +00:00
test_cases_options . addOption ( bool , " only_c " , only_c ) ;
2022-05-13 21:30:43 +00:00
test_cases_options . addOption ( bool , " enable_qemu " , b . enable_qemu ) ;
test_cases_options . addOption ( bool , " enable_wine " , b . enable_wine ) ;
test_cases_options . addOption ( bool , " enable_wasmtime " , b . enable_wasmtime ) ;
test_cases_options . addOption ( bool , " enable_rosetta " , b . enable_rosetta ) ;
test_cases_options . addOption ( bool , " enable_darling " , b . enable_darling ) ;
test_cases_options . addOption ( u32 , " mem_leak_frames " , mem_leak_frames * 2 ) ;
2022-06-09 22:33:04 +00:00
test_cases_options . addOption ( bool , " value_tracing " , value_tracing ) ;
2022-05-13 21:30:43 +00:00
test_cases_options . addOption ( ? [ ] const u8 , " glibc_runtimes_dir " , b . glibc_runtimes_dir ) ;
2022-12-01 23:34:15 +00:00
test_cases_options . addOption ( [ : 0 ] const u8 , " version " , version ) ;
2022-05-13 21:30:43 +00:00
test_cases_options . addOption ( std . SemanticVersion , " semver " , semver ) ;
test_cases_options . addOption ( ? [ ] const u8 , " test_filter " , test_filter ) ;
2020-08-04 22:32:16 +00:00
2022-05-13 07:00:20 +00:00
const test_cases_step = b . step ( " test-cases " , " Run the main compiler test cases " ) ;
test_cases_step . dependOn ( & test_cases . step ) ;
2021-04-15 23:20:43 +00:00
if ( ! skip_stage2_tests ) {
2022-08-18 05:17:19 +00:00
test_step . dependOn ( test_cases_step ) ;
2021-04-15 23:20:43 +00:00
}
2018-07-11 00:18:43 +00:00
2023-01-31 04:39:43 +00:00
var chosen_opt_modes_buf : [ 4 ] builtin . Mode = undefined ;
2018-09-12 18:50:26 +00:00
var chosen_mode_index : usize = 0 ;
2021-04-24 20:39:26 +00:00
if ( ! skip_debug ) {
2023-01-31 04:39:43 +00:00
chosen_opt_modes_buf [ chosen_mode_index ] = builtin . Mode . Debug ;
2021-04-24 20:39:26 +00:00
chosen_mode_index + = 1 ;
}
2018-09-12 18:50:26 +00:00
if ( ! skip_release_safe ) {
2023-01-31 04:39:43 +00:00
chosen_opt_modes_buf [ chosen_mode_index ] = builtin . Mode . ReleaseSafe ;
2018-09-12 18:50:26 +00:00
chosen_mode_index + = 1 ;
}
if ( ! skip_release_fast ) {
2023-01-31 04:39:43 +00:00
chosen_opt_modes_buf [ chosen_mode_index ] = builtin . Mode . ReleaseFast ;
2018-09-12 18:50:26 +00:00
chosen_mode_index + = 1 ;
}
if ( ! skip_release_small ) {
2023-01-31 04:39:43 +00:00
chosen_opt_modes_buf [ chosen_mode_index ] = builtin . Mode . ReleaseSmall ;
2018-09-12 18:50:26 +00:00
chosen_mode_index + = 1 ;
}
2023-01-31 04:39:43 +00:00
const optimization_modes = chosen_opt_modes_buf [ 0 . . chosen_mode_index ] ;
2017-11-07 08:22:27 +00:00
2019-02-26 23:10:40 +00:00
// run stage1 `zig fmt` on this build.zig file just to make sure it works
2022-08-18 05:17:19 +00:00
test_step . dependOn ( & fmt_build_zig . step ) ;
2019-02-26 23:10:40 +00:00
const fmt_step = b . step ( " test-fmt " , " Run zig fmt against build.zig to make sure it works " ) ;
fmt_step . dependOn ( & fmt_build_zig . step ) ;
2022-08-18 05:17:19 +00:00
test_step . dependOn ( tests . addPkgTests (
2021-05-13 09:03:44 +00:00
b ,
test_filter ,
2021-05-16 04:44:38 +00:00
" test/behavior.zig " ,
2021-05-13 09:03:44 +00:00
" behavior " ,
" Run the behavior tests " ,
2023-01-31 04:39:43 +00:00
optimization_modes ,
2022-06-01 21:05:58 +00:00
skip_single_threaded ,
2021-05-13 09:03:44 +00:00
skip_non_native ,
skip_libc ,
2022-04-22 03:28:36 +00:00
skip_stage1 ,
2022-08-18 05:17:19 +00:00
skip_stage2_tests ,
2021-05-13 09:03:44 +00:00
) ) ;
2022-08-18 05:17:19 +00:00
test_step . dependOn ( tests . addPkgTests (
2021-05-13 09:03:44 +00:00
b ,
test_filter ,
2022-05-07 02:22:40 +00:00
" lib/compiler_rt.zig " ,
2021-05-13 09:03:44 +00:00
" compiler-rt " ,
" Run the compiler_rt tests " ,
2023-01-31 04:39:43 +00:00
optimization_modes ,
2021-06-03 17:06:22 +00:00
true , // skip_single_threaded
2021-05-13 09:03:44 +00:00
skip_non_native ,
2021-06-03 17:06:22 +00:00
true , // skip_libc
2022-04-22 03:28:36 +00:00
skip_stage1 ,
2022-08-18 05:17:19 +00:00
skip_stage2_tests or true , // TODO get these all passing
2021-05-13 09:03:44 +00:00
) ) ;
2022-08-18 05:17:19 +00:00
test_step . dependOn ( tests . addPkgTests (
2021-05-13 09:03:44 +00:00
b ,
test_filter ,
2022-05-07 02:22:40 +00:00
" lib/c.zig " ,
" universal-libc " ,
" Run the universal libc tests " ,
2023-01-31 04:39:43 +00:00
optimization_modes ,
2021-06-03 17:06:22 +00:00
true , // skip_single_threaded
2021-05-13 09:03:44 +00:00
skip_non_native ,
2021-06-03 17:06:22 +00:00
true , // skip_libc
2022-04-22 03:28:36 +00:00
skip_stage1 ,
2022-08-18 05:17:19 +00:00
skip_stage2_tests or true , // TODO get these all passing
2021-05-13 09:03:44 +00:00
) ) ;
2021-04-30 21:41:28 +00:00
2023-01-31 04:39:43 +00:00
test_step . dependOn ( tests . addCompareOutputTests ( b , test_filter , optimization_modes ) ) ;
2022-08-18 05:17:19 +00:00
test_step . dependOn ( tests . addStandaloneTests (
2022-07-20 19:51:18 +00:00
b ,
test_filter ,
2023-01-31 04:39:43 +00:00
optimization_modes ,
2022-07-20 19:51:18 +00:00
skip_non_native ,
enable_macos_sdk ,
target ,
2022-08-18 05:17:19 +00:00
skip_stage2_tests ,
2022-07-20 19:51:18 +00:00
b . enable_darling ,
b . enable_qemu ,
b . enable_rosetta ,
b . enable_wasmtime ,
b . enable_wine ,
2022-11-26 19:23:32 +00:00
enable_symlinks_windows ,
2022-07-20 19:51:18 +00:00
) ) ;
2023-01-11 15:25:02 +00:00
test_step . dependOn ( tests . addCAbiTests ( b , skip_non_native , skip_release ) ) ;
2023-01-31 04:39:43 +00:00
test_step . dependOn ( tests . addLinkTests ( b , test_filter , optimization_modes , enable_macos_sdk , skip_stage2_tests , enable_symlinks_windows ) ) ;
test_step . dependOn ( tests . addStackTraceTests ( b , test_filter , optimization_modes ) ) ;
test_step . dependOn ( tests . addCliTests ( b , test_filter , optimization_modes ) ) ;
test_step . dependOn ( tests . addAssembleAndLinkTests ( b , test_filter , optimization_modes ) ) ;
2022-08-18 05:17:19 +00:00
test_step . dependOn ( tests . addTranslateCTests ( b , test_filter ) ) ;
2021-04-15 06:10:51 +00:00
if ( ! skip_run_translated_c ) {
2022-08-18 05:17:19 +00:00
test_step . dependOn ( tests . addRunTranslatedCTests ( b , test_filter , target ) ) ;
2021-04-15 06:10:51 +00:00
}
2020-03-20 22:33:36 +00:00
// tests for this feature are disabled until we have the self-hosted compiler available
2022-08-18 05:17:19 +00:00
// test_step.dependOn(tests.addGenHTests(b, test_filter));
2021-04-30 21:41:28 +00:00
2022-08-18 05:17:19 +00:00
test_step . dependOn ( tests . addPkgTests (
2021-05-13 09:03:44 +00:00
b ,
test_filter ,
" lib/std/std.zig " ,
" std " ,
" Run the standard library tests " ,
2023-01-31 04:39:43 +00:00
optimization_modes ,
2022-06-01 21:05:58 +00:00
skip_single_threaded ,
2021-05-13 09:03:44 +00:00
skip_non_native ,
skip_libc ,
2022-04-22 03:28:36 +00:00
skip_stage1 ,
2022-08-08 01:17:31 +00:00
true , // TODO get these all passing
2022-08-18 05:17:19 +00:00
) ) ;
2022-12-01 23:34:15 +00:00
try addWasiUpdateStep ( b , version ) ;
}
fn addWasiUpdateStep ( b : * Builder , version : [ : 0 ] const u8 ) ! void {
const semver = try std . SemanticVersion . parse ( version ) ;
var target : std . zig . CrossTarget = . {
. cpu_arch = . wasm32 ,
. os_tag = . wasi ,
} ;
target . cpu_features_add . addFeature ( @enumToInt ( std . Target . wasm . Feature . bulk_memory ) ) ;
2023-01-31 04:39:43 +00:00
const exe = addCompilerStep ( b , . ReleaseSmall , target ) ;
2022-12-01 23:34:15 +00:00
const exe_options = b . addOptions ( ) ;
exe . addOptions ( " build_options " , exe_options ) ;
exe_options . addOption ( u32 , " mem_leak_frames " , 0 ) ;
exe_options . addOption ( bool , " have_llvm " , false ) ;
exe_options . addOption ( bool , " force_gpa " , false ) ;
exe_options . addOption ( bool , " only_c " , true ) ;
exe_options . addOption ( [ : 0 ] const u8 , " version " , version ) ;
exe_options . addOption ( std . SemanticVersion , " semver " , semver ) ;
exe_options . addOption ( bool , " enable_logging " , false ) ;
exe_options . addOption ( bool , " enable_link_snapshots " , false ) ;
exe_options . addOption ( bool , " enable_tracy " , false ) ;
exe_options . addOption ( bool , " enable_tracy_callstack " , false ) ;
exe_options . addOption ( bool , " enable_tracy_allocation " , false ) ;
exe_options . addOption ( bool , " value_tracing " , false ) ;
const run_opt = b . addSystemCommand ( & . { " wasm-opt " , " -Oz " , " --enable-bulk-memory " } ) ;
run_opt . addArtifactArg ( exe ) ;
run_opt . addArg ( " -o " ) ;
run_opt . addFileSourceArg ( . { . path = " stage1/zig1.wasm " } ) ;
2022-12-09 23:33:32 +00:00
const update_zig1_step = b . step ( " update-zig1 " , " Update stage1/zig1.wasm " ) ;
update_zig1_step . dependOn ( & run_opt . step ) ;
2022-12-01 23:34:15 +00:00
}
2023-01-31 04:39:43 +00:00
fn addCompilerStep (
b : * Builder ,
optimize : std . builtin . OptimizeMode ,
target : std . zig . CrossTarget ,
) * std . build . LibExeObjStep {
const exe = b . addExecutable ( . {
. name = " zig " ,
. root_source_file = . { . path = " src/main.zig " } ,
. target = target ,
. optimize = optimize ,
} ) ;
2022-12-01 23:34:15 +00:00
exe . stack_size = stack_size ;
return exe ;
2017-04-19 05:13:15 +00:00
}
2017-12-12 04:34:59 +00:00
2021-01-03 15:48:52 +00:00
const exe_cflags = [ _ ] [ ] const u8 {
" -std=c++14 " ,
" -D__STDC_CONSTANT_MACROS " ,
" -D__STDC_FORMAT_MACROS " ,
" -D__STDC_LIMIT_MACROS " ,
" -D_GNU_SOURCE " ,
" -fvisibility-inlines-hidden " ,
" -fno-exceptions " ,
" -fno-rtti " ,
" -Werror=type-limits " ,
" -Wno-missing-braces " ,
" -Wno-comment " ,
} ;
fn addCmakeCfgOptionsToExe (
b : * Builder ,
cfg : CMakeConfig ,
exe : * std . build . LibExeObjStep ,
2021-09-16 20:09:32 +00:00
use_zig_libcxx : bool ,
2021-01-03 15:48:52 +00:00
) ! void {
2023-01-02 03:43:09 +00:00
if ( exe . target . isDarwin ( ) ) {
// useful for package maintainers
exe . headerpad_max_install_names = true ;
}
2021-01-03 15:48:52 +00:00
exe . addObjectFile ( fs . path . join ( b . allocator , & [ _ ] [ ] const u8 {
cfg . cmake_binary_dir ,
" zigcpp " ,
2022-12-07 08:44:15 +00:00
b . fmt ( " {s}{s}{s} " , . {
cfg . cmake_static_library_prefix ,
" zigcpp " ,
cfg . cmake_static_library_suffix ,
} ) ,
2021-01-03 15:48:52 +00:00
} ) catch unreachable ) ;
assert ( cfg . lld_include_dir . len ! = 0 ) ;
2022-01-24 18:15:32 +00:00
exe . addIncludePath ( cfg . lld_include_dir ) ;
2022-10-12 22:11:46 +00:00
exe . addIncludePath ( cfg . llvm_include_dir ) ;
exe . addLibraryPath ( cfg . llvm_lib_dir ) ;
2021-01-03 15:48:52 +00:00
addCMakeLibraryList ( exe , cfg . clang_libraries ) ;
addCMakeLibraryList ( exe , cfg . lld_libraries ) ;
addCMakeLibraryList ( exe , cfg . llvm_libraries ) ;
2021-09-16 20:09:32 +00:00
if ( use_zig_libcxx ) {
exe . linkLibCpp ( ) ;
} else {
// System -lc++ must be used because in this code path we are attempting to link
// against system-provided LLVM, Clang, LLD.
2023-01-06 05:57:08 +00:00
const need_cpp_includes = true ;
const static = cfg . llvm_linkage = = . static ;
const lib_suffix = if ( static ) exe . target . staticLibSuffix ( ) [ 1 . . ] else exe . target . dynamicLibSuffix ( ) [ 1 . . ] ;
2023-01-03 00:18:33 +00:00
switch ( exe . target . getOsTag ( ) ) {
. linux = > {
// First we try to link against gcc libstdc++. If that doesn't work, we fall
// back to -lc++ and cross our fingers.
addCxxKnownPath ( b , cfg , exe , b . fmt ( " libstdc++.{s} " , . { lib_suffix } ) , " " , need_cpp_includes ) catch | err | switch ( err ) {
error . RequiredLibraryNotFound = > {
2023-01-12 01:05:14 +00:00
exe . linkLibCpp ( ) ;
2023-01-03 00:18:33 +00:00
} ,
else = > | e | return e ,
} ;
exe . linkSystemLibrary ( " unwind " ) ;
} ,
2023-01-15 18:10:19 +00:00
. ios , . macos , . watchos , . tvos = > {
2023-01-12 01:05:14 +00:00
exe . linkLibCpp ( ) ;
2023-01-03 00:18:33 +00:00
} ,
2023-01-15 18:10:19 +00:00
. windows = > {
if ( exe . target . getAbi ( ) ! = . msvc ) exe . linkLibCpp ( ) ;
} ,
2023-01-03 00:18:33 +00:00
. freebsd = > {
2023-01-06 05:57:08 +00:00
if ( static ) {
try addCxxKnownPath ( b , cfg , exe , b . fmt ( " libc++.{s} " , . { lib_suffix } ) , null , need_cpp_includes ) ;
try addCxxKnownPath ( b , cfg , exe , b . fmt ( " libgcc_eh.{s} " , . { lib_suffix } ) , null , need_cpp_includes ) ;
} else {
try addCxxKnownPath ( b , cfg , exe , b . fmt ( " libc++.{s} " , . { lib_suffix } ) , null , need_cpp_includes ) ;
}
2023-01-03 00:18:33 +00:00
} ,
. openbsd = > {
try addCxxKnownPath ( b , cfg , exe , b . fmt ( " libc++.{s} " , . { lib_suffix } ) , null , need_cpp_includes ) ;
try addCxxKnownPath ( b , cfg , exe , b . fmt ( " libc++abi.{s} " , . { lib_suffix } ) , null , need_cpp_includes ) ;
} ,
2023-01-06 05:57:08 +00:00
. netbsd , . dragonfly = > {
if ( static ) {
try addCxxKnownPath ( b , cfg , exe , b . fmt ( " libstdc++.{s} " , . { lib_suffix } ) , null , need_cpp_includes ) ;
try addCxxKnownPath ( b , cfg , exe , b . fmt ( " libgcc_eh.{s} " , . { lib_suffix } ) , null , need_cpp_includes ) ;
} else {
try addCxxKnownPath ( b , cfg , exe , b . fmt ( " libstdc++.{s} " , . { lib_suffix } ) , null , need_cpp_includes ) ;
}
2023-01-03 00:18:33 +00:00
} ,
else = > { } ,
2021-09-16 20:09:32 +00:00
}
2021-01-03 15:48:52 +00:00
}
if ( cfg . dia_guids_lib . len ! = 0 ) {
exe . addObjectFile ( cfg . dia_guids_lib ) ;
}
}
2022-11-13 08:42:51 +00:00
fn addStaticLlvmOptionsToExe ( exe : * std . build . LibExeObjStep ) ! void {
2021-01-03 15:48:52 +00:00
// Adds the Zig C++ sources which both stage1 and stage2 need.
//
// We need this because otherwise zig_clang_cc1_main.cpp ends up pulling
// in a dependency on llvm::cfg::Update<llvm::BasicBlock*>::dump() which is
// unavailable when LLVM is compiled in Release mode.
const zig_cpp_cflags = exe_cflags + + [ _ ] [ ] const u8 { " -DNDEBUG=1 " } ;
exe . addCSourceFiles ( & zig_cpp_sources , & zig_cpp_cflags ) ;
for ( clang_libs ) | lib_name | {
exe . linkSystemLibrary ( lib_name ) ;
}
for ( lld_libs ) | lib_name | {
exe . linkSystemLibrary ( lib_name ) ;
}
for ( llvm_libs ) | lib_name | {
exe . linkSystemLibrary ( lib_name ) ;
}
2021-10-02 19:58:16 +00:00
exe . linkSystemLibrary ( " z " ) ;
2022-11-13 08:42:51 +00:00
exe . linkSystemLibrary ( " zstd " ) ;
2022-11-08 07:14:39 +00:00
2022-11-09 05:50:29 +00:00
if ( exe . target . getOs ( ) . tag ! = . windows or exe . target . getAbi ( ) ! = . msvc ) {
2022-11-08 07:14:39 +00:00
// This means we rely on clang-or-zig-built LLVM, Clang, LLD libraries.
exe . linkSystemLibrary ( " c++ " ) ;
}
if ( exe . target . getOs ( ) . tag = = . windows ) {
exe . linkSystemLibrary ( " version " ) ;
exe . linkSystemLibrary ( " uuid " ) ;
exe . linkSystemLibrary ( " ole32 " ) ;
}
2021-01-03 15:48:52 +00:00
}
2020-12-08 00:23:17 +00:00
fn addCxxKnownPath (
b : * Builder ,
ctx : CMakeConfig ,
exe : * std . build . LibExeObjStep ,
objname : [ ] const u8 ,
errtxt : ? [ ] const u8 ,
need_cpp_includes : bool ,
) ! void {
2022-02-03 22:27:01 +00:00
if ( ! std . process . can_spawn )
return error . RequiredLibraryNotFound ;
2020-12-08 00:23:17 +00:00
const path_padded = try b . exec ( & [ _ ] [ ] const u8 {
ctx . cxx_compiler ,
2020-11-26 12:28:38 +00:00
b . fmt ( " -print-file-name={s} " , . { objname } ) ,
2020-12-08 00:23:17 +00:00
} ) ;
2022-03-27 18:05:42 +00:00
var tokenizer = mem . tokenize ( u8 , path_padded , " \r \n " ) ;
const path_unpadded = tokenizer . next ( ) . ? ;
2020-12-08 00:23:17 +00:00
if ( mem . eql ( u8 , path_unpadded , objname ) ) {
if ( errtxt ) | msg | {
2021-11-30 07:13:07 +00:00
std . debug . print ( " {s} " , . { msg } ) ;
2020-12-08 00:23:17 +00:00
} else {
2021-11-30 07:13:07 +00:00
std . debug . print ( " Unable to determine path to {s} \n " , . { objname } ) ;
2020-12-08 00:23:17 +00:00
}
return error . RequiredLibraryNotFound ;
}
exe . addObjectFile ( path_unpadded ) ;
// TODO a way to integrate with system c++ include files here
2022-10-27 01:17:49 +00:00
// c++ -E -Wp,-v -xc++ /dev/null
2020-12-08 00:23:17 +00:00
if ( need_cpp_includes ) {
// I used these temporarily for testing something but we obviously need a
// more general purpose solution here.
2022-10-27 01:17:49 +00:00
//exe.addIncludePath("/nix/store/2lr0fc0ak8rwj0k8n3shcyz1hz63wzma-gcc-11.3.0/include/c++/11.3.0");
//exe.addIncludePath("/nix/store/2lr0fc0ak8rwj0k8n3shcyz1hz63wzma-gcc-11.3.0/include/c++/11.3.0/x86_64-unknown-linux-gnu");
2020-12-08 00:23:17 +00:00
}
}
fn addCMakeLibraryList ( exe : * std . build . LibExeObjStep , list : [ ] const u8 ) void {
2021-08-06 09:01:47 +00:00
var it = mem . tokenize ( u8 , list , " ; " ) ;
2020-12-08 00:23:17 +00:00
while ( it . next ( ) ) | lib | {
if ( mem . startsWith ( u8 , lib , " -l " ) ) {
exe . linkSystemLibrary ( lib [ " -l " . len . . ] ) ;
2023-01-04 07:18:51 +00:00
} else if ( exe . target . isWindows ( ) and mem . endsWith ( u8 , lib , " .lib " ) and ! fs . path . isAbsolute ( lib ) ) {
exe . linkSystemLibrary ( lib [ 0 . . lib . len - " .lib " . len ] ) ;
2020-12-08 00:23:17 +00:00
} else {
exe . addObjectFile ( lib ) ;
}
}
}
const CMakeConfig = struct {
2022-07-23 16:02:51 +00:00
llvm_linkage : std . build . LibExeObjStep . Linkage ,
2020-12-08 00:23:17 +00:00
cmake_binary_dir : [ ] const u8 ,
cmake_prefix_path : [ ] const u8 ,
2022-12-07 08:44:15 +00:00
cmake_static_library_prefix : [ ] const u8 ,
cmake_static_library_suffix : [ ] const u8 ,
2020-12-08 00:23:17 +00:00
cxx_compiler : [ ] const u8 ,
lld_include_dir : [ ] const u8 ,
lld_libraries : [ ] const u8 ,
clang_libraries : [ ] const u8 ,
2022-10-12 22:11:46 +00:00
llvm_lib_dir : [ ] const u8 ,
llvm_include_dir : [ ] const u8 ,
2020-12-08 00:23:17 +00:00
llvm_libraries : [ ] const u8 ,
dia_guids_lib : [ ] const u8 ,
} ;
const max_config_h_bytes = 1 * 1024 * 1024 ;
2022-07-16 00:25:38 +00:00
fn findConfigH ( b : * Builder , config_h_path_option : ? [ ] const u8 ) ? [ ] const u8 {
if ( config_h_path_option ) | path | {
var config_h_or_err = fs . cwd ( ) . openFile ( path , . { } ) ;
if ( config_h_or_err ) | * file | {
file . close ( ) ;
return path ;
} else | _ | {
std . log . err ( " Could not open provided config.h: \" {s} \" " , . { path } ) ;
std . os . exit ( 1 ) ;
}
}
var check_dir = fs . path . dirname ( b . zig_exe ) . ? ;
while ( true ) {
var dir = fs . cwd ( ) . openDir ( check_dir , . { } ) catch unreachable ;
defer dir . close ( ) ;
// Check if config.h is present in dir
var config_h_or_err = dir . openFile ( " config.h " , . { } ) ;
if ( config_h_or_err ) | * file | {
file . close ( ) ;
return fs . path . join (
b . allocator ,
& [ _ ] [ ] const u8 { check_dir , " config.h " } ,
) catch unreachable ;
} else | e | switch ( e ) {
error . FileNotFound = > { } ,
else = > unreachable ,
}
// Check if we reached the source root by looking for .git, and bail if so
var git_dir_or_err = dir . openDir ( " .git " , . { } ) ;
if ( git_dir_or_err ) | * git_dir | {
git_dir . close ( ) ;
return null ;
} else | _ | { }
// Otherwise, continue search in the parent directory
const new_check_dir = fs . path . dirname ( check_dir ) ;
if ( new_check_dir = = null or mem . eql ( u8 , new_check_dir . ? , check_dir ) ) {
return null ;
}
check_dir = new_check_dir . ? ;
} else unreachable ; // TODO should not need `else unreachable`.
}
2020-12-08 00:23:17 +00:00
2022-07-16 00:25:38 +00:00
fn parseConfigH ( b : * Builder , config_h_text : [ ] const u8 ) ? CMakeConfig {
2020-12-08 00:23:17 +00:00
var ctx : CMakeConfig = . {
2022-07-23 16:02:51 +00:00
. llvm_linkage = undefined ,
2020-12-08 00:23:17 +00:00
. cmake_binary_dir = undefined ,
. cmake_prefix_path = undefined ,
2022-12-07 08:44:15 +00:00
. cmake_static_library_prefix = undefined ,
. cmake_static_library_suffix = undefined ,
2020-12-08 00:23:17 +00:00
. cxx_compiler = undefined ,
. lld_include_dir = undefined ,
. lld_libraries = undefined ,
. clang_libraries = undefined ,
2022-10-12 22:11:46 +00:00
. llvm_lib_dir = undefined ,
. llvm_include_dir = undefined ,
2020-12-08 00:23:17 +00:00
. llvm_libraries = undefined ,
. dia_guids_lib = undefined ,
} ;
const mappings = [ _ ] struct { prefix : [ ] const u8 , field : [ ] const u8 } {
. {
. prefix = " #define ZIG_CMAKE_BINARY_DIR " ,
. field = " cmake_binary_dir " ,
} ,
. {
. prefix = " #define ZIG_CMAKE_PREFIX_PATH " ,
. field = " cmake_prefix_path " ,
} ,
2022-12-07 08:44:15 +00:00
. {
. prefix = " #define ZIG_CMAKE_STATIC_LIBRARY_PREFIX " ,
. field = " cmake_static_library_prefix " ,
} ,
. {
. prefix = " #define ZIG_CMAKE_STATIC_LIBRARY_SUFFIX " ,
. field = " cmake_static_library_suffix " ,
} ,
2020-12-08 00:23:17 +00:00
. {
. prefix = " #define ZIG_CXX_COMPILER " ,
. field = " cxx_compiler " ,
} ,
. {
. prefix = " #define ZIG_LLD_INCLUDE_PATH " ,
. field = " lld_include_dir " ,
} ,
. {
. prefix = " #define ZIG_LLD_LIBRARIES " ,
. field = " lld_libraries " ,
} ,
. {
. prefix = " #define ZIG_CLANG_LIBRARIES " ,
. field = " clang_libraries " ,
} ,
. {
. prefix = " #define ZIG_LLVM_LIBRARIES " ,
. field = " llvm_libraries " ,
} ,
. {
. prefix = " #define ZIG_DIA_GUIDS_LIB " ,
. field = " dia_guids_lib " ,
} ,
2022-10-12 22:11:46 +00:00
. {
. prefix = " #define ZIG_LLVM_INCLUDE_PATH " ,
. field = " llvm_include_dir " ,
} ,
. {
. prefix = " #define ZIG_LLVM_LIB_PATH " ,
. field = " llvm_lib_dir " ,
} ,
2022-07-23 16:02:51 +00:00
// .prefix = ZIG_LLVM_LINK_MODE parsed manually below
2020-12-08 00:23:17 +00:00
} ;
2021-08-06 09:01:47 +00:00
var lines_it = mem . tokenize ( u8 , config_h_text , " \r \n " ) ;
2020-12-08 00:23:17 +00:00
while ( lines_it . next ( ) ) | line | {
inline for ( mappings ) | mapping | {
if ( mem . startsWith ( u8 , line , mapping . prefix ) ) {
2021-08-06 09:01:47 +00:00
var it = mem . split ( u8 , line , " \" " ) ;
2022-07-25 19:04:30 +00:00
_ = it . first ( ) ; // skip the stuff before the quote
2020-12-08 00:23:17 +00:00
const quoted = it . next ( ) . ? ; // the stuff inside the quote
@field ( ctx , mapping . field ) = toNativePathSep ( b , quoted ) ;
}
}
2022-07-23 16:02:51 +00:00
if ( mem . startsWith ( u8 , line , " #define ZIG_LLVM_LINK_MODE " ) ) {
var it = mem . split ( u8 , line , " \" " ) ;
_ = it . next ( ) . ? ; // skip the stuff before the quote
const quoted = it . next ( ) . ? ; // the stuff inside the quote
ctx . llvm_linkage = if ( mem . eql ( u8 , quoted , " shared " ) ) . dynamic else . static ;
}
2020-12-08 00:23:17 +00:00
}
return ctx ;
}
fn toNativePathSep ( b : * Builder , s : [ ] const u8 ) [ ] u8 {
2021-11-30 07:13:07 +00:00
const duplicated = b . allocator . dupe ( u8 , s ) catch unreachable ;
2020-12-08 00:23:17 +00:00
for ( duplicated ) | * byte | switch ( byte . * ) {
'/' = > byte . * = fs . path . sep ,
else = > { } ,
} ;
return duplicated ;
}
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
const softfloat_sources = [ _ ] [ ] const u8 {
" deps/SoftFloat-3e/source/8086/f128M_isSignalingNaN.c " ,
2022-02-16 20:50:47 +00:00
" deps/SoftFloat-3e/source/8086/extF80M_isSignalingNaN.c " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" deps/SoftFloat-3e/source/8086/s_commonNaNToF128M.c " ,
2022-02-16 20:50:47 +00:00
" deps/SoftFloat-3e/source/8086/s_commonNaNToExtF80M.c " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" deps/SoftFloat-3e/source/8086/s_commonNaNToF16UI.c " ,
" deps/SoftFloat-3e/source/8086/s_commonNaNToF32UI.c " ,
" deps/SoftFloat-3e/source/8086/s_commonNaNToF64UI.c " ,
" deps/SoftFloat-3e/source/8086/s_f128MToCommonNaN.c " ,
2022-02-16 20:50:47 +00:00
" deps/SoftFloat-3e/source/8086/s_extF80MToCommonNaN.c " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" deps/SoftFloat-3e/source/8086/s_f16UIToCommonNaN.c " ,
" deps/SoftFloat-3e/source/8086/s_f32UIToCommonNaN.c " ,
" deps/SoftFloat-3e/source/8086/s_f64UIToCommonNaN.c " ,
" deps/SoftFloat-3e/source/8086/s_propagateNaNF128M.c " ,
2022-02-16 20:50:47 +00:00
" deps/SoftFloat-3e/source/8086/s_propagateNaNExtF80M.c " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" deps/SoftFloat-3e/source/8086/s_propagateNaNF16UI.c " ,
" deps/SoftFloat-3e/source/8086/softfloat_raiseFlags.c " ,
" deps/SoftFloat-3e/source/f128M_add.c " ,
" deps/SoftFloat-3e/source/f128M_div.c " ,
" deps/SoftFloat-3e/source/f128M_eq.c " ,
" deps/SoftFloat-3e/source/f128M_eq_signaling.c " ,
" deps/SoftFloat-3e/source/f128M_le.c " ,
" deps/SoftFloat-3e/source/f128M_le_quiet.c " ,
" deps/SoftFloat-3e/source/f128M_lt.c " ,
" deps/SoftFloat-3e/source/f128M_lt_quiet.c " ,
" deps/SoftFloat-3e/source/f128M_mul.c " ,
" deps/SoftFloat-3e/source/f128M_mulAdd.c " ,
" deps/SoftFloat-3e/source/f128M_rem.c " ,
" deps/SoftFloat-3e/source/f128M_roundToInt.c " ,
" deps/SoftFloat-3e/source/f128M_sqrt.c " ,
" deps/SoftFloat-3e/source/f128M_sub.c " ,
" deps/SoftFloat-3e/source/f128M_to_f16.c " ,
" deps/SoftFloat-3e/source/f128M_to_f32.c " ,
" deps/SoftFloat-3e/source/f128M_to_f64.c " ,
2022-02-16 20:50:47 +00:00
" deps/SoftFloat-3e/source/f128M_to_extF80M.c " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" deps/SoftFloat-3e/source/f128M_to_i32.c " ,
" deps/SoftFloat-3e/source/f128M_to_i32_r_minMag.c " ,
" deps/SoftFloat-3e/source/f128M_to_i64.c " ,
" deps/SoftFloat-3e/source/f128M_to_i64_r_minMag.c " ,
" deps/SoftFloat-3e/source/f128M_to_ui32.c " ,
" deps/SoftFloat-3e/source/f128M_to_ui32_r_minMag.c " ,
" deps/SoftFloat-3e/source/f128M_to_ui64.c " ,
" deps/SoftFloat-3e/source/f128M_to_ui64_r_minMag.c " ,
2022-02-16 20:50:47 +00:00
" deps/SoftFloat-3e/source/extF80M_add.c " ,
" deps/SoftFloat-3e/source/extF80M_div.c " ,
" deps/SoftFloat-3e/source/extF80M_eq.c " ,
" deps/SoftFloat-3e/source/extF80M_le.c " ,
" deps/SoftFloat-3e/source/extF80M_lt.c " ,
" deps/SoftFloat-3e/source/extF80M_mul.c " ,
" deps/SoftFloat-3e/source/extF80M_rem.c " ,
" deps/SoftFloat-3e/source/extF80M_roundToInt.c " ,
" deps/SoftFloat-3e/source/extF80M_sqrt.c " ,
" deps/SoftFloat-3e/source/extF80M_sub.c " ,
" deps/SoftFloat-3e/source/extF80M_to_f16.c " ,
" deps/SoftFloat-3e/source/extF80M_to_f32.c " ,
" deps/SoftFloat-3e/source/extF80M_to_f64.c " ,
" deps/SoftFloat-3e/source/extF80M_to_f128M.c " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" deps/SoftFloat-3e/source/f16_add.c " ,
" deps/SoftFloat-3e/source/f16_div.c " ,
" deps/SoftFloat-3e/source/f16_eq.c " ,
" deps/SoftFloat-3e/source/f16_isSignalingNaN.c " ,
" deps/SoftFloat-3e/source/f16_lt.c " ,
" deps/SoftFloat-3e/source/f16_mul.c " ,
" deps/SoftFloat-3e/source/f16_mulAdd.c " ,
" deps/SoftFloat-3e/source/f16_rem.c " ,
" deps/SoftFloat-3e/source/f16_roundToInt.c " ,
" deps/SoftFloat-3e/source/f16_sqrt.c " ,
" deps/SoftFloat-3e/source/f16_sub.c " ,
2022-02-16 20:50:47 +00:00
" deps/SoftFloat-3e/source/f16_to_extF80M.c " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" deps/SoftFloat-3e/source/f16_to_f128M.c " ,
" deps/SoftFloat-3e/source/f16_to_f64.c " ,
2022-02-16 20:50:47 +00:00
" deps/SoftFloat-3e/source/f32_to_extF80M.c " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" deps/SoftFloat-3e/source/f32_to_f128M.c " ,
2022-02-16 20:50:47 +00:00
" deps/SoftFloat-3e/source/f64_to_extF80M.c " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" deps/SoftFloat-3e/source/f64_to_f128M.c " ,
" deps/SoftFloat-3e/source/f64_to_f16.c " ,
" deps/SoftFloat-3e/source/i32_to_f128M.c " ,
" deps/SoftFloat-3e/source/s_add256M.c " ,
" deps/SoftFloat-3e/source/s_addCarryM.c " ,
" deps/SoftFloat-3e/source/s_addComplCarryM.c " ,
" deps/SoftFloat-3e/source/s_addF128M.c " ,
2022-02-16 20:50:47 +00:00
" deps/SoftFloat-3e/source/s_addExtF80M.c " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" deps/SoftFloat-3e/source/s_addM.c " ,
" deps/SoftFloat-3e/source/s_addMagsF16.c " ,
" deps/SoftFloat-3e/source/s_addMagsF32.c " ,
" deps/SoftFloat-3e/source/s_addMagsF64.c " ,
" deps/SoftFloat-3e/source/s_approxRecip32_1.c " ,
" deps/SoftFloat-3e/source/s_approxRecipSqrt32_1.c " ,
" deps/SoftFloat-3e/source/s_approxRecipSqrt_1Ks.c " ,
" deps/SoftFloat-3e/source/s_approxRecip_1Ks.c " ,
" deps/SoftFloat-3e/source/s_compare128M.c " ,
" deps/SoftFloat-3e/source/s_compare96M.c " ,
2022-02-16 20:50:47 +00:00
" deps/SoftFloat-3e/source/s_compareNonnormExtF80M.c " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" deps/SoftFloat-3e/source/s_countLeadingZeros16.c " ,
" deps/SoftFloat-3e/source/s_countLeadingZeros32.c " ,
" deps/SoftFloat-3e/source/s_countLeadingZeros64.c " ,
" deps/SoftFloat-3e/source/s_countLeadingZeros8.c " ,
" deps/SoftFloat-3e/source/s_eq128.c " ,
" deps/SoftFloat-3e/source/s_invalidF128M.c " ,
2022-02-16 20:50:47 +00:00
" deps/SoftFloat-3e/source/s_invalidExtF80M.c " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" deps/SoftFloat-3e/source/s_isNaNF128M.c " ,
" deps/SoftFloat-3e/source/s_le128.c " ,
" deps/SoftFloat-3e/source/s_lt128.c " ,
" deps/SoftFloat-3e/source/s_mul128MTo256M.c " ,
" deps/SoftFloat-3e/source/s_mul64To128M.c " ,
" deps/SoftFloat-3e/source/s_mulAddF128M.c " ,
" deps/SoftFloat-3e/source/s_mulAddF16.c " ,
" deps/SoftFloat-3e/source/s_mulAddF32.c " ,
" deps/SoftFloat-3e/source/s_mulAddF64.c " ,
" deps/SoftFloat-3e/source/s_negXM.c " ,
2022-02-16 20:50:47 +00:00
" deps/SoftFloat-3e/source/s_normExtF80SigM.c " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" deps/SoftFloat-3e/source/s_normRoundPackMToF128M.c " ,
2022-02-16 20:50:47 +00:00
" deps/SoftFloat-3e/source/s_normRoundPackMToExtF80M.c " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" deps/SoftFloat-3e/source/s_normRoundPackToF16.c " ,
" deps/SoftFloat-3e/source/s_normRoundPackToF32.c " ,
" deps/SoftFloat-3e/source/s_normRoundPackToF64.c " ,
" deps/SoftFloat-3e/source/s_normSubnormalF128SigM.c " ,
" deps/SoftFloat-3e/source/s_normSubnormalF16Sig.c " ,
" deps/SoftFloat-3e/source/s_normSubnormalF32Sig.c " ,
" deps/SoftFloat-3e/source/s_normSubnormalF64Sig.c " ,
" deps/SoftFloat-3e/source/s_remStepMBy32.c " ,
" deps/SoftFloat-3e/source/s_roundMToI64.c " ,
" deps/SoftFloat-3e/source/s_roundMToUI64.c " ,
2022-02-16 20:50:47 +00:00
" deps/SoftFloat-3e/source/s_roundPackMToExtF80M.c " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" deps/SoftFloat-3e/source/s_roundPackMToF128M.c " ,
" deps/SoftFloat-3e/source/s_roundPackToF16.c " ,
" deps/SoftFloat-3e/source/s_roundPackToF32.c " ,
" deps/SoftFloat-3e/source/s_roundPackToF64.c " ,
" deps/SoftFloat-3e/source/s_roundToI32.c " ,
" deps/SoftFloat-3e/source/s_roundToI64.c " ,
" deps/SoftFloat-3e/source/s_roundToUI32.c " ,
" deps/SoftFloat-3e/source/s_roundToUI64.c " ,
" deps/SoftFloat-3e/source/s_shiftLeftM.c " ,
" deps/SoftFloat-3e/source/s_shiftNormSigF128M.c " ,
" deps/SoftFloat-3e/source/s_shiftRightJam256M.c " ,
" deps/SoftFloat-3e/source/s_shiftRightJam32.c " ,
" deps/SoftFloat-3e/source/s_shiftRightJam64.c " ,
" deps/SoftFloat-3e/source/s_shiftRightJamM.c " ,
" deps/SoftFloat-3e/source/s_shiftRightM.c " ,
" deps/SoftFloat-3e/source/s_shortShiftLeft64To96M.c " ,
" deps/SoftFloat-3e/source/s_shortShiftLeftM.c " ,
" deps/SoftFloat-3e/source/s_shortShiftRightExtendM.c " ,
" deps/SoftFloat-3e/source/s_shortShiftRightJam64.c " ,
" deps/SoftFloat-3e/source/s_shortShiftRightJamM.c " ,
" deps/SoftFloat-3e/source/s_shortShiftRightM.c " ,
" deps/SoftFloat-3e/source/s_sub1XM.c " ,
" deps/SoftFloat-3e/source/s_sub256M.c " ,
" deps/SoftFloat-3e/source/s_subM.c " ,
" deps/SoftFloat-3e/source/s_subMagsF16.c " ,
" deps/SoftFloat-3e/source/s_subMagsF32.c " ,
" deps/SoftFloat-3e/source/s_subMagsF64.c " ,
" deps/SoftFloat-3e/source/s_tryPropagateNaNF128M.c " ,
2022-02-16 20:50:47 +00:00
" deps/SoftFloat-3e/source/s_tryPropagateNaNExtF80M.c " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" deps/SoftFloat-3e/source/softfloat_state.c " ,
" deps/SoftFloat-3e/source/ui32_to_f128M.c " ,
" deps/SoftFloat-3e/source/ui64_to_f128M.c " ,
2022-02-16 20:50:47 +00:00
" deps/SoftFloat-3e/source/ui32_to_extF80M.c " ,
" deps/SoftFloat-3e/source/ui64_to_extF80M.c " ,
2017-12-12 04:34:59 +00:00
} ;
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
const zig_cpp_sources = [ _ ] [ ] const u8 {
// These are planned to stay even when we are self-hosted.
" src/zig_llvm.cpp " ,
" src/zig_clang.cpp " ,
2021-06-06 00:33:16 +00:00
" src/zig_llvm-ar.cpp " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" src/zig_clang_driver.cpp " ,
" src/zig_clang_cc1_main.cpp " ,
" src/zig_clang_cc1as_main.cpp " ,
// https://github.com/ziglang/zig/issues/6363
" src/windows_sdk.cpp " ,
2018-07-11 00:18:43 +00:00
} ;
2020-04-04 15:57:28 +00:00
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
const clang_libs = [ _ ] [ ] const u8 {
" clangFrontendTool " ,
" clangCodeGen " ,
" clangFrontend " ,
" clangDriver " ,
" clangSerialization " ,
" clangSema " ,
" clangStaticAnalyzerFrontend " ,
" clangStaticAnalyzerCheckers " ,
" clangStaticAnalyzerCore " ,
" clangAnalysis " ,
" clangASTMatchers " ,
" clangAST " ,
" clangParse " ,
" clangSema " ,
" clangBasic " ,
" clangEdit " ,
" clangLex " ,
" clangARCMigrate " ,
" clangRewriteFrontend " ,
" clangRewrite " ,
" clangCrossTU " ,
" clangIndex " ,
" clangToolingCore " ,
2022-08-03 00:14:19 +00:00
" clangExtractAPI " ,
" clangSupport " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
} ;
const lld_libs = [ _ ] [ ] const u8 {
" lldMinGW " ,
" lldELF " ,
" lldCOFF " ,
" lldWasm " ,
2022-07-04 01:41:43 +00:00
" lldMachO " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" lldCommon " ,
} ;
// This list can be re-generated with `llvm-config --libfiles` and then
// reformatting using your favorite text editor. Note we do not execute
2021-04-15 17:58:53 +00:00
// `llvm-config` here because we are cross compiling. Also omit LLVMTableGen
// from these libs.
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
const llvm_libs = [ _ ] [ ] const u8 {
" LLVMWindowsManifest " ,
2022-08-02 23:57:32 +00:00
" LLVMWindowsDriver " ,
2021-04-15 17:43:39 +00:00
" LLVMXRay " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" LLVMLibDriver " ,
" LLVMDlltoolDriver " ,
" LLVMCoverage " ,
2021-04-15 17:43:39 +00:00
" LLVMLineEditor " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" LLVMXCoreDisassembler " ,
" LLVMXCoreCodeGen " ,
" LLVMXCoreDesc " ,
" LLVMXCoreInfo " ,
2022-07-04 01:41:43 +00:00
" LLVMX86TargetMCA " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" LLVMX86Disassembler " ,
" LLVMX86AsmParser " ,
2021-04-15 17:43:39 +00:00
" LLVMX86CodeGen " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" LLVMX86Desc " ,
" LLVMX86Info " ,
" LLVMWebAssemblyDisassembler " ,
2021-04-15 17:43:39 +00:00
" LLVMWebAssemblyAsmParser " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" LLVMWebAssemblyCodeGen " ,
" LLVMWebAssemblyDesc " ,
2021-10-02 19:40:07 +00:00
" LLVMWebAssemblyUtils " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" LLVMWebAssemblyInfo " ,
2022-07-04 01:41:43 +00:00
" LLVMVEDisassembler " ,
" LLVMVEAsmParser " ,
" LLVMVECodeGen " ,
" LLVMVEDesc " ,
" LLVMVEInfo " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" LLVMSystemZDisassembler " ,
" LLVMSystemZAsmParser " ,
2021-04-15 17:43:39 +00:00
" LLVMSystemZCodeGen " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" LLVMSystemZDesc " ,
" LLVMSystemZInfo " ,
" LLVMSparcDisassembler " ,
" LLVMSparcAsmParser " ,
2021-04-15 17:43:39 +00:00
" LLVMSparcCodeGen " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" LLVMSparcDesc " ,
" LLVMSparcInfo " ,
" LLVMRISCVDisassembler " ,
" LLVMRISCVAsmParser " ,
2021-04-15 17:43:39 +00:00
" LLVMRISCVCodeGen " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" LLVMRISCVDesc " ,
" LLVMRISCVInfo " ,
" LLVMPowerPCDisassembler " ,
" LLVMPowerPCAsmParser " ,
2021-04-15 17:43:39 +00:00
" LLVMPowerPCCodeGen " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" LLVMPowerPCDesc " ,
" LLVMPowerPCInfo " ,
" LLVMNVPTXCodeGen " ,
" LLVMNVPTXDesc " ,
" LLVMNVPTXInfo " ,
" LLVMMSP430Disassembler " ,
" LLVMMSP430AsmParser " ,
2021-04-15 17:43:39 +00:00
" LLVMMSP430CodeGen " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" LLVMMSP430Desc " ,
" LLVMMSP430Info " ,
" LLVMMipsDisassembler " ,
" LLVMMipsAsmParser " ,
2021-04-15 17:43:39 +00:00
" LLVMMipsCodeGen " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" LLVMMipsDesc " ,
" LLVMMipsInfo " ,
" LLVMLanaiDisassembler " ,
" LLVMLanaiCodeGen " ,
" LLVMLanaiAsmParser " ,
" LLVMLanaiDesc " ,
" LLVMLanaiInfo " ,
" LLVMHexagonDisassembler " ,
" LLVMHexagonCodeGen " ,
" LLVMHexagonAsmParser " ,
" LLVMHexagonDesc " ,
" LLVMHexagonInfo " ,
" LLVMBPFDisassembler " ,
" LLVMBPFAsmParser " ,
2021-04-15 17:43:39 +00:00
" LLVMBPFCodeGen " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" LLVMBPFDesc " ,
" LLVMBPFInfo " ,
" LLVMAVRDisassembler " ,
" LLVMAVRAsmParser " ,
2021-04-15 17:43:39 +00:00
" LLVMAVRCodeGen " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" LLVMAVRDesc " ,
" LLVMAVRInfo " ,
" LLVMARMDisassembler " ,
" LLVMARMAsmParser " ,
2021-04-15 17:43:39 +00:00
" LLVMARMCodeGen " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" LLVMARMDesc " ,
" LLVMARMUtils " ,
" LLVMARMInfo " ,
2022-07-04 01:41:43 +00:00
" LLVMAMDGPUTargetMCA " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" LLVMAMDGPUDisassembler " ,
" LLVMAMDGPUAsmParser " ,
2021-04-15 17:43:39 +00:00
" LLVMAMDGPUCodeGen " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" LLVMAMDGPUDesc " ,
" LLVMAMDGPUUtils " ,
" LLVMAMDGPUInfo " ,
" LLVMAArch64Disassembler " ,
2021-04-15 17:43:39 +00:00
" LLVMAArch64AsmParser " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" LLVMAArch64CodeGen " ,
2021-04-15 17:43:39 +00:00
" LLVMAArch64Desc " ,
" LLVMAArch64Utils " ,
" LLVMAArch64Info " ,
" LLVMOrcJIT " ,
" LLVMMCJIT " ,
" LLVMJITLink " ,
" LLVMInterpreter " ,
" LLVMExecutionEngine " ,
" LLVMRuntimeDyld " ,
2021-10-02 19:40:07 +00:00
" LLVMOrcTargetProcess " ,
" LLVMOrcShared " ,
" LLVMDWP " ,
2021-04-15 17:43:39 +00:00
" LLVMDebugInfoGSYM " ,
" LLVMOption " ,
" LLVMObjectYAML " ,
2022-08-02 23:57:32 +00:00
" LLVMObjCopy " ,
2021-04-15 17:43:39 +00:00
" LLVMMCA " ,
" LLVMMCDisassembler " ,
" LLVMLTO " ,
" LLVMPasses " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" LLVMCFGuard " ,
2021-04-15 17:43:39 +00:00
" LLVMCoroutines " ,
" LLVMObjCARCOpts " ,
" LLVMipo " ,
" LLVMVectorize " ,
" LLVMLinker " ,
" LLVMInstrumentation " ,
" LLVMFrontendOpenMP " ,
" LLVMFrontendOpenACC " ,
" LLVMExtensions " ,
" LLVMDWARFLinker " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" LLVMGlobalISel " ,
2021-04-15 17:43:39 +00:00
" LLVMMIRParser " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" LLVMAsmPrinter " ,
2021-04-15 17:43:39 +00:00
" LLVMSelectionDAG " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" LLVMCodeGen " ,
2021-04-15 17:43:39 +00:00
" LLVMIRReader " ,
" LLVMAsmParser " ,
" LLVMInterfaceStub " ,
" LLVMFileCheck " ,
" LLVMFuzzMutate " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" LLVMTarget " ,
" LLVMScalarOpts " ,
" LLVMInstCombine " ,
" LLVMAggressiveInstCombine " ,
" LLVMTransformUtils " ,
" LLVMBitWriter " ,
" LLVMAnalysis " ,
" LLVMProfileData " ,
2022-08-02 23:57:32 +00:00
" LLVMSymbolize " ,
" LLVMDebugInfoPDB " ,
" LLVMDebugInfoMSF " ,
2022-07-04 01:41:43 +00:00
" LLVMDebugInfoDWARF " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" LLVMObject " ,
" LLVMTextAPI " ,
" LLVMMCParser " ,
" LLVMMC " ,
" LLVMDebugInfoCodeView " ,
2021-04-15 17:43:39 +00:00
" LLVMBitReader " ,
2022-08-02 23:57:32 +00:00
" LLVMFuzzerCLI " ,
2021-04-15 17:43:39 +00:00
" LLVMCore " ,
" LLVMRemarks " ,
" LLVMBitstreamReader " ,
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
" LLVMBinaryFormat " ,
" LLVMSupport " ,
" LLVMDemangle " ,
} ;