Merged
Conversation
This affects Fedora >= 35, where debuginfod is enabled by default. On such systems, gdb shows the following interactive prompt and then waits forever: ``` This GDB supports auto-downloading debuginfo from the following URLs: https://debuginfod.fedoraproject.org/ Enable debuginfod for this session? (y or [n]) ``` Unsetting the `DEBUGINFOD_URLS` environment variable disables the prompt as documented here: https://fedoraproject.org/wiki/Debuginfod#Disabling Signed-off-by: Christoph Erhardt <github@sicherha.de>
Fixes #430. Signed-off-by: Christoph Erhardt <github@sicherha.de>
Skip test if `dwarfdump` is unavailable
Fix hanging unit test `gdb-index`
Sensitivity to this kind of image varies and could be an unneeded friction to adopt the mold linker.
I didn't want to write a Python one-liner in the Makefile, but it looks like it is in practice one of the most portable way to compute a relative path. #425
Previously, --gdb-index tries to read bogus compressed data from input sections if input debug sections are compressed. Fixes #431
Pointed out by Kévin Le Gouguec in #425.
mold used to support only DWARF4. Fixes #436
mold is usually built for all supported tagets, namely, x86-64, i386, ARM32, ARM64 and RISCV64. This is a good thing because it makes cross compilation easy. That is, as long as you have a copy of the mold linker, it is guaranteed to work as a cross linker. However, during a quick debug session in which you build mold many times, you may want to build mold only for your native target. That greatly reduces build time because it reduces the amount of code after template instantiation. Therefore, in this commit, I introduced new macros, MOLD_DEBUG_X86_64_ONLY and MOLD_DEBUG_ARM64_ONLY, to build mold for x86-64 and ARM64 only, respectively. These flags should never be used for production. They are solely for debugging purpose.
This test fails on some Linux systems, and it is essentially testing not the mold's capabilities but the running platform's capabilities. I don't think there's a portable, guaranteed way to create an executable shared object on Linux, so even if it happens to work, I don't think we can guarantee that.
If a system has only Python 3, it may not have `python` command.
We don't need values of hte se DW_FORM tags, but we have to be able to skip them in order to read a .debug_info section.
Fixes #437
So that the dependency info is printed out even if the link will eventually fail.
They are defined as aliases for
--plugin-opt=thinlto-{single-module,cache-dir,cache-policy}.
#336
.gdb_index contains two maps: a map from identifiers (type names, function names or variable names) to compunits, and a map from function address ranges to compunits. The latter is harder to create because we needed to parse DWARF debug records to read function address ranges. We generally don't want to do that. This commit stops emitting address ranges. Now, .gdb_index sections created by our linker contains the zero-length map as address ranges. Though I'm not 100% sure if this is actually OK, it looks like gdb works fine with that. It's at least worth a try. #439 #396
We are not using pkg-config for zlib, so I think we can live without it for libcrypto too.
With this fix, mold can now link git and successfully run all git test suites.
This is an unusual scenario, but it can happen on Arch Linux, where apparently even crt1.o has no .debug_info . So if one for whatever reason omits -g for all compilations and then uses --gdb-index, mold aborts. Signed-off-by: Luboš Luňák <l.lunak@centrum.cz>
don't abort with --gdb-index if there's no .debug_info
blentle
pushed a commit
that referenced
this pull request
Jul 6, 2022
mold: error: undefined symbol: __atomic_fetch_add_8
>>> referenced by compress.cc
>>> out/compress.o:(void tbb::detail::d1::fold_tree<tbb::detail::d1::tree_node>(tbb::detail::d1::node*, tbb::detail::d1::execution_data const&))>>> referenced by arch-arm64.cc
>>> out/elf/arch-arm64.o:(tbb::detail::d2::for_each_root_task_base<__gnu_cxx::__normal_iterator<mold::elf::InputSection<mold::elf::ARM64>**, std::span<mold::elf::InputSection<mold::elf::ARM64>*, 4294967295u> >, mold::elf::create_range_extension_thunks(mold::elf::Context<mold::elf::ARM64>&, mold::elf::OutputSection<mold::elf::ARM64>&)::{lambda(mold::elf::InputSection<mold::elf::ARM64>*)#2}, mold::elf::InputSection<mold::elf::ARM64>*>::cancel(tbb::detail::d1::execution_data&))>>> referenced by arch-arm64.cc
>>> out/elf/arch-arm64.o:(tbb::detail::d2::for_each_root_task_base<__gnu_cxx::__normal_iterator<mold::elf::InputSection<mold::elf::ARM64>**, std::span<mold::elf::InputSection<mold::elf::ARM64>*, 4294967295u> >, mold::elf::create_range_extension_thunks(mold::elf::Context<mold::elf::ARM64>&, mold::elf::OutputSection<mold::elf::ARM64>&)::{lambda(mold::elf::InputSection<mold::elf::ARM64>*)#4}, mold::elf::InputSection<mold::elf::ARM64>*>::cancel(tbb::detail::d1::execution_data&))>>> referenced 971 more times
mold: error: undefined symbol: __atomic_load_8
>>> referenced by main.cc
>>> out/elf/main.o:(mold::elf::Context<mold::elf::X86_64>::~Context())>>> referenced by output-chunks.cc
>>> out/macho/output-chunks.o:(mold::macho::ExportEncoder::finish())>>> referenced by main.cc
>>> out/elf/main.o:(mold::elf::Context<mold::elf::I386>::~Context())>>> referenced 3 more times
Signed-off-by: Jan Palus <jpalus@fastmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.