GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — platform_triplet.c uses possibly undefined TARGET_OS_* macros · Issue #117886 · python/cpython

platform_triplet.c uses possibly undefined TARGET_OS_* macros #117886

New issue
Copy link
New issue
Copy link
Closed
#118073
Closed
platform_triplet.c uses possibly undefined TARGET_OS_* macros#117886
#118073
Copy link
Labels
OS-macbuildThe build process and cross-buildThe build process and cross-buildtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@jmroot
jmroot
opened on Apr 15, 2024
Issue body actions

Bug report

Bug description:

The symptom is:

configure:6892: checking for the platform triplet based on compiler characteristics
configure:6900: result: none

which of course leads to all kinds of problems later in the build. The problem is that platform_triplet.c uses TARGET_OS_IOS, TARGET_OS_SIMULATOR and TARGET_OS_OSX without checking if they are defined. While this is valid according to the C standard with undefined macros evaluating to 0, it's a problem for two reasons: Older macOS SDKs don't define these, and the code assumes that TARGET_OS_OSX being false means it's not building for macOS, and secondly some clang versions will error if you use any macro starting with TARGET_OS_ without checking if it is defined.

CPython versions tested on:

3.13

Operating systems tested on:

macOS

Linked PRs

  • gh-117886: platform_triplet.c: check if TARGET_OS_* defined #117887

Activity

  1. jmroot
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Apr 15, 2024
  2. jmroot
    added a commit that references this issue on Apr 15, 2024

    pythongh-117886: platform_triplet.c: check if TARGET_OS_* defined

    c36fce1
  3. erlend-aasland
    added
    buildThe build process and cross-buildThe build process and cross-build
    OS-mac
    on Apr 15, 2024
  4. ronaldoussoren commented on Apr 15, 2024

    @ronaldoussoren
    ronaldoussoren
    on Apr 15, 2024
    Contributor
    More actions

    @jmroot, Out of interest: How old are the old SDKs you mention? And which clang versions are problematic?

  5. jmroot commented on Apr 15, 2024

    @jmroot
    jmroot
    on Apr 15, 2024
    ContributorAuthor
    More actions

    We got a downstream report from a user on 10.11. AFAIK the very latest clang versions default to -Werror,-Wundef-prefix=TARGET_OS_ and it started doing that in version 11 or earlier.

  6. ned-deily
    closed this as completedin #118073on Apr 19, 2024
  7. ned-deily commented on Apr 19, 2024

    @ned-deily
    ned-deily
    on Apr 19, 2024
    Member
    More actions

    Thanks again for the issue. As discussed in the associated PR #117887, the suggested change has been rolled up and merged in PR #118073.

    Reacted by Joshua Root
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-macbuildThe build process and cross-buildThe build process and cross-buildtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.