classification
Title: Python 3.9.0a4 fails to build when configured with --with-dtrace
Type: compile error Stage: resolved
Components: Build Versions: Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: David Carlier, Dormouse759, devnexen, hroncok, jcea, petr.viktorin
Priority: normal Keywords: patch

Created on 2020-02-26 16:56 by Dormouse759, last changed 2020-03-12 11:29 by petr.viktorin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 18672 open devnexen, 2020-02-26 22:36
PR 18766 merged petr.viktorin, 2020-03-03 15:00
Messages (13)
msg362700 - (view) Author: Marcel Plch (Dormouse759) * Date: 2020-02-26 16:56
Steps to reproduce:

$ wget https://www.python.org/ftp/python/3.9.0/Python-3.9.0a4.tar.xz
$ tar xvf Python-3.9.0a4.tar.xz
$ cd Python-3.9.0a4
$ ./configure --with-dtrace
$ make -j12
/usr/bin/ld: libpython3.9.a(ceval.o): in function `_PyEval_EvalFrameDefault':
/home/mplch/Work/fedpkg/Python-3.9.0a4/Python/ceval.c:1117: undefined reference to `python_function__entry_semaphore'
/usr/bin/ld: /home/mplch/Work/fedpkg/Python-3.9.0a4/Python/ceval.c:1254: undefined reference to `python_line_semaphore'
/usr/bin/ld: /home/mplch/Work/fedpkg/Python-3.9.0a4/Python/ceval.c:3697: undefined reference to `python_function__return_semaphore'
/usr/bin/ld: /home/mplch/Work/fedpkg/Python-3.9.0a4/Python/ceval.c:1445: undefined reference to `python_line_semaphore'

...

/usr/bin/ld: libpython3.9.a(gcmodule.o):(.note.stapsdt+0x70): undefined reference to `python_gc__done_semaphore'
collect2: error: ld returned 1 exit status
make: *** [Makefile:709: Programs/_testembed] Error 1


Additional info:
$ gcc --version
gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1)
Copyright (C) 2019 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.
msg362701 - (view) Author: Miro Hrončok (hroncok) * Date: 2020-02-26 17:05
I can reproduce this from git and will try to bisect the introducer.
msg362703 - (view) Author: Miro Hrončok (hroncok) * Date: 2020-02-26 17:28
aabdeb766b7fa581e7de01f3c953b12792f0736d is the first new commit
commit aabdeb766b7fa581e7de01f3c953b12792f0736d
Author: David Carlier <dcarlier@afilias.info>
Date:   Tue Jan 28 12:53:32 2020 +0000

    bpo-38960: DTrace build fix for FreeBSD. (GH-17451)
    
    DTrace build fix for FreeBSD.
    
    - allowing passing an extra flag as it need to define the arch size.
    - casting some probe's arguments.

 .../next/Core and Builtins/2019-12-03-16-41-22.bpo-38960.kvoFM0.rst | 1 +
 Python/ceval.c                                                      | 6 +++---
 Python/import.c                                                     | 4 ++--
 Python/sysmodule.c                                                  | 2 +-
 configure                                                           | 3 +--
 configure.ac                                                        | 3 +--
 6 files changed, 9 insertions(+), 10 deletions(-)
 create mode 100644 Misc/NEWS.d/next/Core and Builtins/2019-12-03-16-41-22.bpo-38960.kvoFM0.rst
msg362704 - (view) Author: David Carlier (David Carlier) * Date: 2020-02-26 17:45
Sorry for the inconveniences. I can reproduce on FreeBSD too if I do not set the DFLAGS env var (because FreeBSD needs architecture bits in addition). What happens when make distclean && export DFLAGS="" && ./configure --with-dtrace ?
msg362712 - (view) Author: Miro Hrončok (hroncok) * Date: 2020-02-26 18:58
export DFLAGS="" does not seem to workaround this.

$ make distclean && export DFLAGS="" && ./configure --with-dtrace && make
...
undefined reference to `python_line_semaphore'
...
msg362720 - (view) Author: David Carlier (David Carlier) * Date: 2020-02-26 19:22
What about DFFLAGS=" " ?
msg362721 - (view) Author: Miro Hrončok (hroncok) * Date: 2020-02-26 19:25
Nope.
msg362723 - (view) Author: David Carlier (David Carlier) * Date: 2020-02-26 19:28
Weird I just tried on ubuntu/systemtap...
msg362733 - (view) Author: Miro Hrončok (hroncok) * Date: 2020-02-26 20:44
$ make clean && make distclean
$ git clean -x
$ export DFLAGS=""
$ export DFFLAGS=""
$ ./configure --with-dtrace && make
...
undefined reference to `python_audit_semaphore'
...
msg362735 - (view) Author: David Carlier (David Carlier) * Date: 2020-02-26 20:56
ah sorry I meant DFLAGS=" " (with a space).
msg362737 - (view) Author: David Carlier (David Carlier) * Date: 2020-02-26 20:57
If it works for you, it might mean making a specific case for Linux systems in configure.ac as a proper fix.
msg362739 - (view) Author: Miro Hrončok (hroncok) * Date: 2020-02-26 21:05
Oh, my bad.

DFLAGS=" "

^ that indeed works.
msg363915 - (view) Author: Petr Viktorin (petr.viktorin) * (Python committer) Date: 2020-03-11 13:27
New changeset 3c97e1e457033bbb8bbe0b7198bd13fc794a12b0 by Petr Viktorin in branch 'master':
bpo-39761: Fix dtrace build with empty $DFLAGS (GH-18766)
https://github.com/python/cpython/commit/3c97e1e457033bbb8bbe0b7198bd13fc794a12b0
History
Date User Action Args
2020-03-12 11:29:28petr.viktorinsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-03-11 13:27:50petr.viktorinsetmessages: + msg363915
2020-03-03 15:00:51petr.viktorinsetpull_requests: + pull_request18122
2020-03-03 02:13:50jceasetnosy: + jcea
2020-02-26 22:36:58devnexensetkeywords: + patch
nosy: + devnexen

pull_requests: + pull_request18029
stage: patch review
2020-02-26 21:05:29hroncoksetmessages: + msg362739
2020-02-26 20:57:49David Carliersetmessages: + msg362737
2020-02-26 20:56:09David Carliersetmessages: + msg362735
2020-02-26 20:44:54hroncoksetmessages: + msg362733
2020-02-26 19:28:05David Carliersetmessages: + msg362723
2020-02-26 19:25:12hroncoksetmessages: + msg362721
2020-02-26 19:22:47David Carliersetmessages: + msg362720
2020-02-26 18:58:57hroncoksetmessages: + msg362712
2020-02-26 17:45:40David Carliersetmessages: + msg362704
2020-02-26 17:28:16hroncoksetnosy: + petr.viktorin, David Carlier
messages: + msg362703
2020-02-26 17:05:35hroncoksetnosy: + hroncok
messages: + msg362701
2020-02-26 16:56:28Dormouse759create