Title: Problems building with --enable-profiling on macOS using homebrew GCC
Type: compile error Stage:
Components: macOS Versions: Python 3.7
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: brechtm, ned.deily, ronaldoussoren
Priority: normal Keywords:

Created on 2017-04-12 12:50 by brechtm, last changed 2020-11-27 14:20 by ronaldoussoren.

File name Uploaded Description Edit
configure.txt brechtm, 2017-04-12 12:50
make.txt brechtm, 2017-04-12 12:51
make_gcc.txt brechtm, 2017-04-12 12:51
Messages (2)
msg291547 - (view) Author: Brecht Machiels (brechtm) Date: 2017-04-12 12:50
The python.exe produced during the build process is somehow broken:

    $ ./python.exe -S
    Killed: 9

Strangely, it works when run from gdb:

    $ gdb -args ./python.exe -S
    GNU gdb (GDB) 7.12.1
    Copyright (C) 2017 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
    and "show warranty" for details.
    This GDB was configured as "x86_64-apple-darwin16.3.0".
    Type "show configuration" for configuration details.
    For bug reporting instructions, please see:
    Find the GDB manual and other documentation resources online at:
    For help, type "help".
    Type "apropos word" to search for commands related to "word"...
    Reading symbols from ./python.exe...done.
    (gdb) start
    Temporary breakpoint 1 at 0x10000109c: file ../Programs/python.c, line 28.
    Starting program: /Users/brechtm/Documents/Code/cpython/profile/python.exe -S
    [New Thread 0x1403 of process 62753]
    warning: unhandled dyld version (15)

    Thread 2 hit Temporary breakpoint 1, main (argc=2, argv=0x7fff5bfff460) at ../Programs/python.c:28
    28	    (void)_PyMem_SetupAllocators("malloc");
    (gdb) c
    Could not find platform dependent libraries <exec_prefix>
    Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
    Python 3.7.0a0 (heads/master:3e0f1fc4e0, Apr 12 2017, 14:39:47)
    [GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.41)] on darwin
    Module readline not available.
    >>> ^D
    [Inferior 1 (process 62753) exited normally]
    (gdb) q

I'm running macOS Sierra 10.12.4 (16E195) and XCode 8.3.1.

    $ gcc --version
    Configured with: --prefix=/Applications/ --with-gxx-include-dir=/usr/include/c++/4.2.1
    Apple LLVM version 8.1.0 (clang-802.0.41)
    Target: x86_64-apple-darwin16.5.0
    Thread model: posix
    InstalledDir: /Applications/

Forcing the use of the Homebrew-provided GCC by invoking "make CC=gcc-6 CXX=g++-6" has the same result.

    $ gcc-6 --version
    gcc-6 (Homebrew GCC 6.3.0_1) 6.3.0
    Copyright (C) 2016 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO

The build is fine when --enable-profiling is not specified.
msg380130 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2020-11-01 12:36
The system compiler on macOS 10.9 or later doesn't support "-pg" (profile generation) at all:

$ clang -o t -pg t.c
clang: error: the clang compiler does not support -pg option on versions of OS X 10.9 and later

This means that its unlikely I'll look into this issue.
Date User Action Args
2020-11-27 14:20:44ronaldoussorensettitle: Problems building with --enable-profiling on macOS -> Problems building with --enable-profiling on macOS using homebrew GCC
2020-11-01 12:36:24ronaldoussorensetmessages: + msg380130
2017-04-12 12:51:35brechtmsetfiles: + make_gcc.txt
2017-04-12 12:51:16brechtmsetfiles: + make.txt
2017-04-12 12:50:46brechtmcreate