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

Distutils drops -fno-strict-aliasing when CFLAGS are set #55056

Closed
skrah mannequin opened this issue Jan 6, 2011 · 2 comments
Closed

Distutils drops -fno-strict-aliasing when CFLAGS are set #55056

skrah mannequin opened this issue Jan 6, 2011 · 2 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@skrah
Copy link
Mannequin

skrah mannequin commented Jan 6, 2011

BPO 10847
Nosy @tarekziade, @merwok, @skrah
Superseder
  • bpo-969718: BASECFLAGS are not passed to module build line
  • 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/tarekziade'
    closed_at = <Date 2011-02-04.01:12:14.566>
    created_at = <Date 2011-01-06.21:21:42.324>
    labels = ['type-bug', 'library']
    title = 'Distutils drops -fno-strict-aliasing when CFLAGS are set'
    updated_at = <Date 2011-02-04.01:12:14.565>
    user = 'https://github.com/skrah'

    bugs.python.org fields:

    activity = <Date 2011-02-04.01:12:14.565>
    actor = 'eric.araujo'
    assignee = 'tarek'
    closed = True
    closed_date = <Date 2011-02-04.01:12:14.566>
    closer = 'eric.araujo'
    components = ['Distutils']
    creation = <Date 2011-01-06.21:21:42.324>
    creator = 'skrah'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 10847
    keywords = []
    message_count = 2.0
    messages = ['125591', '127849']
    nosy_count = 3.0
    nosy_names = ['tarek', 'eric.araujo', 'skrah']
    pr_nums = []
    priority = 'high'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '969718'
    type = 'behavior'
    url = 'https://bugs.python.org/issue10847'
    versions = ['Python 3.1', 'Python 2.7', 'Python 3.2']

    @skrah
    Copy link
    Mannequin Author

    skrah mannequin commented Jan 6, 2011

    When CFLAGS are set, distutils drops -fno-strict-aliasing (among other
    flags):

    $ python2.7 setup.py build
    ...
    gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I./src -I/usr/local/include -I/usr/local/include/python2.7 -c src/gmpy.c -o build/temp.linux-x86_64-2.7/src/gmpy.o
    ...
    
    $ CFLAGS="-fomit-frame-pointer" python2.7 setup.py build
    ...
    gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fomit-frame-pointer -fPIC -I./src -I/usr/local/include -I/usr/local/include/python2.7 -c src/gmpy.c -o build/temp.linux-x86_64-2.7/src/gmpy.o
    src/gmpy.c: In function ‘_cmp_to_object’:
    src/gmpy.c:4692: warning: dereferencing type-punned pointer will break strict-aliasing rules
    ...

    I'm not sure if this is intentional. The documentation says:

    "Compiler flags can also be supplied through setting the CFLAGS
    environment variable. If set, the contents of CFLAGS will be added
    to the compiler flags specified in the Setup file."

    To me, this sounds as if they should be appended to the regular flags.

    @skrah skrah mannequin assigned tarekziade Jan 6, 2011
    @skrah skrah mannequin added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Jan 6, 2011
    @merwok
    Copy link
    Member

    merwok commented Feb 4, 2011

    Thanks for the report. It came up on the debian-python ML recently too, and is actually already reported. Following up on the other report.

    @merwok merwok closed this as completed Feb 4, 2011
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant