Skip to content

Compile cpython on MacOS13 may result in "Symbol Not Found Error" due to the misusing of llvm-gcc #102533

Open
@hbjzxzx

Description

@hbjzxzx

Bug report

How to trigger this bug: compile cpython on macOS which has binutil installed(mostly installed by brew)

./configure --prefix=$HOME/.mypy --with-openssl=$HOME/myopenssl
make -j8

and you will see the following error, which said: "ld: warning: ld: warning: ignoring file libpython3.10.a, building for macOS-x86_64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )"

image

Mac Env is:
image

After some struggling work, I found that there is a bug in file configure:
image

this test now should fail to distinguish the real gcc and the llvm-gcc; you can test on your mac;

another thing should be noticed is that it's better to use libtool for archiving the object files rather than the ar( if brew install binutil ,the ar is prone to misuse) ; At least, use the xcrun -find ar is another choice.

I will submit a PR soon. Please Review

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-mactype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions