Skip to content
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

compiler detection on macOS seems to be incorrect #88259

Closed
xrisk mannequin opened this issue May 10, 2021 · 4 comments
Closed

compiler detection on macOS seems to be incorrect #88259

xrisk mannequin opened this issue May 10, 2021 · 4 comments
Assignees
Labels
3.7 (EOL) end of life 3.8 (EOL) end of life 3.9 only security fixes 3.10 only security fixes 3.11 only security fixes build The build process and cross-build OS-mac type-bug An unexpected behavior, bug, or error

Comments

@xrisk
Copy link
Mannequin

xrisk mannequin commented May 10, 2021

BPO 44093
Nosy @ronaldoussoren, @ned-deily, @xrisk
PRs
  • bpo-43109: Fix --with-lto configure option on macOS #26341
  • 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:

    assignee = 'https://github.com/ned-deily'
    closed_at = None
    created_at = <Date 2021-05-10.03:01:36.707>
    labels = ['3.7', '3.8', '3.9', 'build', 'OS-mac', 'type-bug', '3.10', '3.11']
    title = 'compiler detection on macOS seems to be incorrect'
    updated_at = <Date 2021-05-25.02:05:34.966>
    user = 'https://github.com/xrisk'

    bugs.python.org fields:

    activity = <Date 2021-05-25.02:05:34.966>
    actor = 'ned.deily'
    assignee = 'ned.deily'
    closed = False
    closed_date = None
    closer = None
    components = ['Build', 'macOS']
    creation = <Date 2021-05-10.03:01:36.707>
    creator = 'xrisk'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 44093
    keywords = ['patch']
    message_count = 1.0
    messages = ['393346']
    nosy_count = 3.0
    nosy_names = ['ronaldoussoren', 'ned.deily', 'xrisk']
    pr_nums = ['26341']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue44093'
    versions = ['Python 3.6', 'Python 3.7', 'Python 3.8', 'Python 3.9', 'Python 3.10', 'Python 3.11']

    @xrisk
    Copy link
    Mannequin Author

    xrisk mannequin commented May 10, 2021

    On macOS devices, the configure script seems to always detect gcc, even though Apple does not ship with gcc — the gcc binary is simply a wrapper around clang (probably llvm-gcc?)

    I believe the issue is with these lines.

    cpython/configure.ac

    Lines 630 to 635 in 8e8307d

    if test -n "`"$found_gcc" --version | grep llvm-gcc`"
    then
    AC_MSG_NOTICE([Detected llvm-gcc, falling back to clang])
    CC="$found_clang"
    CXX="$found_clang++"
    fi

    Concretely, gcc —-version produces this on my computer:

    $ gcc --version
    Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
    Apple clang version 12.0.5 (clang-1205.0.22.9)
    Target: x86_64-apple-darwin20.4.0
    Thread model: posix
    InstalledDir: /Library/Developer/CommandLineTools/usr/bin

    Perhaps an additional check for “clang” would solve the issue.

    @xrisk xrisk mannequin added 3.7 (EOL) end of life 3.8 (EOL) end of life 3.9 only security fixes 3.10 only security fixes 3.11 only security fixes build The build process and cross-build type-bug An unexpected behavior, bug, or error labels May 10, 2021
    @ned-deily ned-deily self-assigned this May 10, 2021
    @ned-deily ned-deily self-assigned this May 10, 2021
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    @furkanonder
    Copy link
    Contributor

    @ned-deily The issue seems to be solved. We can close the issue.

    @ned-deily
    Copy link
    Member

    The issue seems to be solved. We can close the issue.

    Perhaps I don't understand the desired result but it doesn't look solved to me. In particular, the test:

    if test -n "`"$found_gcc" --version | grep llvm-gcc`" 
    

    fails because compilers provided by current versions of Apple's Xcode or Command Line Tools no longer include the string llvm-gcc in their reported versions:

    $ gcc --version
    Apple clang version 14.0.3 (clang-1403.0.22.14.1)
    Target: x86_64-apple-darwin22.4.0
    Thread model: posix
    InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
    
    

    @erlend-aasland
    Copy link
    Contributor

    erlend-aasland commented Apr 12, 2024

    Superseded by #110577.

    Let's continue the discussion over there.

    See also:

    @erlend-aasland erlend-aasland closed this as not planned Won't fix, can't repro, duplicate, stale Apr 12, 2024
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life 3.8 (EOL) end of life 3.9 only security fixes 3.10 only security fixes 3.11 only security fixes build The build process and cross-build OS-mac type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants