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
clang: error: linker command failed with exit code 1 (use -v to see invocation) on m1 mac #91131
Comments
Hello, Here is my configuration mac os 12.2.1 step to reproduce
Could you help me please to fix this issus ? Best regards Battant |
Without more details, this is only a guess but the messages seem to indicate that your build is detecting an installed version of the GNU gettext library, which is optional for Python builds and is not provided by default on macOS, and most likely that version is an Intel-only build of the package and its libintl shared library. Check whether you have an outdated version of gettext and libintl*.dylib installed somewhere, perhaps in /usr/local/, possibly via a third-party package manager like Homebrew or MacPorts, and either remove it or update it with a arm64 (or universal2 fat) build. |
I've had the same issue and fixed it with: brew remove --ignore-dependencies gettext @ned thanks for help! |
I ran into this same issue. I notice that gettext is a dependency of git, so a common dependency when developing. Is there perhaps a way that CPython could be made to ignore gettext on macos Silicon or to detect an incompatible platform and thus ignore it? |
There shouldn't be a problem as long as gettext is properly installed on an M1 Mac, i.e. with an arm64 arch or a universal build that includes arm64. |
Well, I'm using a mac with gettext installed as part of Only after running Do you have any advice on how to "properly install" gettext using homebrew on an M1 mac? |
This also applies to any other third-party library that a cpython build may link to, like the OpenSSL libs. Some legacy tools that depend on them may work in Rosetta 2 Intel-64 emulation mode on an Apple Silicon Mac but eventually that will go away so it is important to move away from any inadvertent Rosetta dependencies. I don't use Homebrew myself but a quick web search comes up with a number of hits on how to proceed. It looks like the general idea is to save your list of installed brew packages, reinstall the base homebrew to install Apple Silicon native versions, and then reinstall the top-level packages you had and want and you should be good to go from there on. |
SG. Thanks for the advice. I'll dive in and experiment and report back when I have progress. |
I did this search, which surfaced a few related results. This article seemed promising, but the symptoms there are different than mine. I don't have any gettext libs showing up in /usr/local (only in /opt/homebrew as expected). I noticed this comment reports the same issue I have, but no solution is present. I saw a suggestion to set FLAGS, but I do that as a matter of course. I don't have an x86 install of homebrew. This machine is less than a month old and has had ARM-based homebrew installed from the beginning. I'll keep investigating. |
As suggested, I uninstalled and reinstalled everything in homebrew: $ brew list | xargs brew remove
$ brew install python@3.10 python-launcher python@3.9 python@3.8 gh git Even after following those steps and setting LDFLAGS and CPPFLAGS to point to |
Aha. If I configure/make without LDFLAGS or CPPFLAGS set, compilation works. Then I noticed for |
It's possible my bad experience may have been avoided through bpo-35905. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: