summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers
AgeCommit message (Collapse)Author
2025-12-08compilers: clike: Deduplicate compile and link args from actually used arg listLeonid Zaburunov
Current behaviour is to loop over 'sys_args' list which contains both included and ignored compiler arguments. This could produce unexpected results when argument is both ignored and deduplicated. With the following changes, 'cleaned_sys_args' is used to ensure only included args are deduplicated. Example: CFLAGS (or 'c_args' as Meson option) has '-I${includedir} -L${libdir}' and LDFLAGS ('c_link_args') has '-L${libdir}'. Given CFLAGS value is wrong: -L entry belongs to LDFLAGS and thus should not be included in compiler argument list. Since we have -L in 'sys_args' list this entry will not be included as linker flag too! This is definitely not our goal: wrong entry should just be ignored. Some debug prints from Meson: C_ARGS: ['-I/opt/x64-compile/include', '-L/opt/x64-compile/lib'] LINKER_ARGS: ['-L/opt/x64-compile/lib'] RESULT_CARGS: ['-I/opt/x64-compile/include', '-D_FILE_OFFSET_BITS=64'] RESULT_LDARGS: [] (this is captured during compiler.find_library() call) And this is what we see after applying patch: C_ARGS: ['-I/opt/x64-compile/include', '-L/opt/x64-compile/lib'] LINKER_ARGS: ['-L/opt/x64-compile/lib'] RESULT_CARGS: ['-I/opt/x64-compile/include', '-D_FILE_OFFSET_BITS=64'] RESULT_LDARGS: ['-L/opt/x64-compile/lib']
2025-12-08compilers/nvidia_hpc: compilers: move -std options to get_option_std_argsZephyr Lykos
Fixes: 6c88d9992192379511c4777c526786cbacf06167 Fixes: d3542ff690d0be723cfd3ebfaaac99290517837f Fixes: ff0c758b2a8015f7e7ca6fc627c29ef7bb4771b3
2025-12-08compilers/xc32: add updates for v5.00Liza Chevalier
2025-12-08compilers/xc32: add _LTO_CACHE_VERSION to match GnuCompilerLiza Chevalier
2025-12-08style: use singe quotes for stringsLiza Chevalier
2025-12-01rust: Rust-ABI dynamic libraries do not support LTOPaolo Bonzini
Attempting to use LTO on e.g. a procedural macro crate fails with error: lto cannot be used for proc-macro crate type without -Zdylib-lto Do not return -Clto for such crate types. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-01compilers: pass target to get_lto_*_argsPaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-11-23compilers: forward gen_vs_module_defs_args to linkerPaolo Bonzini
This adds support for DEF files to rust and removes some hasattr duck typing. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-11-23Add import std support to MSVC.Jussi Pakkanen
2025-11-23Add cpp_importstd option.Jussi Pakkanen
The reason it is a string array is that this allows us to add more values than true/false should it be needed. For an example see `b_lto`.
2025-11-19compilers/rust: make use the fact we have an Environment to cleanupDylan Baker
This adds a second stage initialization, which allows us to use options for setting attributes on the compiler. This is called during the detect phase, so the Compiler is never used in a partially initialized state.
2025-11-19compilers: Remove Environment parameter from RustCompiler.get_nightlyDylan Baker
2025-11-19compilers: Remove Environment parameter from RustCompiler.lib_file_to_l_argsDylan Baker
2025-11-19compilers: Remove Environment parameter from RustCompiler.get_rustdocDylan Baker
2025-11-19compilers: Remove Environment parameter from RustCompiler.get_rust_toolDylan Baker
2025-11-19compilers: Remove Environment parameter from CLikeCompiler.get_compiler_dirsDylan Baker
2025-11-19compilers: Remove Environment parameter from CLikeCompiler.gen_dynamic_link_argsDylan Baker
2025-11-19compilers: Remove Environment parameter from ↵Dylan Baker
CLikeCompiler._get_basic_compiler_args
2025-11-19compilers: Remove Environment parameter from CLikeCompiler.output_is_64bitDylan Baker
2025-11-19compilers: Remove Environment parameter from CLikeCompiler.has_argumentsDylan Baker
2025-11-19compilers: Make CudaCompiler.get_ccbin_args privateDylan Baker
It's not used outside of the compiler.
2025-11-19compilers: Remove Environment parameter from CudaCompiler.get_ccbin_argsDylan Baker
2025-11-19compilers: Remove CoreDAta parameter from Compiler.cached_compileDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.get_defineDylan Baker
2025-11-19Compilers: make CLikeCompiler.cross_compute_int privateDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.compute_intDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.has_membersDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.has_typeDylan Baker
2025-11-19compilers: Remove Environment parameter from ↵Dylan Baker
Compiler.symbols_have_underscore_prefix
2025-11-19compilers: Remove dead "update_options" methodDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.get_option_compile_argsDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.get_option_std_argsDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.get_option_link_argsDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.check_headerDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.has_headerDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.has_header_symbolDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.runDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.cached_runDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.sizeofDylan Baker
This also fixes the `_cross_sizeof` helper
2025-11-19compilers: Remove Environment parameter from Compiler.alignmentDylan Baker
This also fixes the helper `_cross_alignment` method.
2025-11-19compilers: Remove Environment parameter from Compiler.has_functionDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.sanitizer_argsDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.find_libraryDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.get_library_namingDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.get_program_dirsDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.has_multi_argumentsDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.build_rpath_argsDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.thread_flagsDylan Baker
Same logic as the openmp flags
2025-11-19compilers: Remove Environment parameter from Compiler.openmp_flagsDylan Baker
I've done the compile and link flags in one commit since they're so closely related
2025-11-19compilers: Remove Environment parameter from ↵Dylan Baker
Compiler.get_language_stdlib_only_link_flags