This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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

Created on 2017-04-12 12:50 by brechtm, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
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 (3)
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 <http://gnu.org/licenses/gpl.html>
    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:
    <http://www.gnu.org/software/gdb/bugs/>.
    Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.
    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
    Continuing.
    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/Xcode.app/Contents/Developer/usr --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/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

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
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

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.
msg411407 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2022-01-23 19:10
3.7 is no longer maintained. Please create a new issue if you are having this problem with a current version (>= 3.9).
History
Date User Action Args
2022-04-11 14:58:45adminsetgithub: 74239
2022-01-23 19:10:43iritkatrielsetstatus: open -> closed

nosy: + iritkatriel
messages: + msg411407

resolution: out of date
stage: resolved
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