Skip to content

fix: don't try to use a cross-architecture objdump on the native arch… #725

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pcc
Copy link

@pcc pcc commented May 26, 2025

…itecture

If the host architecture is aarch64, aarch64-linux-gnu-objdump may not exist, which is the case on at least Fedora and NixOS, so disassembly doesn't work by default. Similar logic likely also applies to arm-linux-gnueabi-objdump. Fix the problem by only trying to use the cross-architecture objdump if we are not building for the given architecture.

return isArm ? QStringLiteral("arm-linux-gnueabi-objdump") : QStringLiteral("objdump");
#endif
#ifndef __arm__
if (m_arch.startsWith(QLatin1String("arm"))) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume __arm__ will be defined together with __aarch64__, right?

generally though, I wonder if we should instead just do something like this instead:

      if (m_arch.startsWith(QLatin1String("armv8")) || m_arch.startsWith(QLatin1String("aarch64"))) {
            if (auto aarch64Objdump = QStandardPaths::findExecutable(QStringLiteral("aarch64-linux-gnu-objdump")); !aarch64Objdump.isEmpty()))
                return aarch64Objdump;
        }

and dito for the other one - this should always work and is independent of the compile time macros? what do you think?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, done

…itecture

If the host architecture is aarch64, aarch64-linux-gnu-objdump
may not exist, which is the case on at least Fedora and NixOS, so
disassembly doesn't work by default. Similar logic likely also applies
to arm-linux-gnueabi-objdump. Fix the problem by only trying to use the
cross-architecture objdump if it is found in $PATH.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants