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.
Created on 2014年02月25日 13:33 by Antoine.Brodin.FreeBSD, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| python-issue20767.diff | koobs, 2014年02月28日 09:04 | review | ||
| Messages (33) | |||
|---|---|---|---|
| msg212176 - (view) | Author: Antoine Brodin.FreeBSD (Antoine.Brodin.FreeBSD) | Date: 2014年02月25日 13:33 | |
Hi, On FreeBSD -current, clang 3.4 is now the default compiler. Clang 3.4 rejects "-R/path/to/lib" flag (previously in version 3.3 it just ignored it). This leads to some errors with some python extensions: cc -shared -O2 -pipe -fno-strict-aliasing build/temp.freebsd-11.0-CURRENT-amd64-2.7/_sqlite/cache.o build/temp.freebsd-11.0-CURRENT-amd64-2.7/_sqlite/connection.o build/temp.freebsd-11.0-CURRENT-amd64-2.7/_sqlite/cursor.o build/temp.freebsd-11.0-CURRENT-amd64-2.7/_sqlite/microprotocols.o build/temp.freebsd-11.0-CURRENT-amd64-2.7/_sqlite/module.o build/temp.freebsd-11.0-CURRENT-amd64-2.7/_sqlite/prepare_protocol.o build/temp.freebsd-11.0-CURRENT-amd64-2.7/_sqlite/row.o build/temp.freebsd-11.0-CURRENT-amd64-2.7/_sqlite/statement.o build/temp.freebsd-11.0-CURRENT-amd64-2.7/_sqlite/util.o -L/usr/local/lib -R/usr/local/lib -lsqlite3 -o build/lib.freebsd-11.0-CURRENT-amd64-2.7/_sqlite3.so cc: error: unknown argument: '-R/usr/local/lib' error: command 'cc' failed with exit status 1 cc -shared -O2 -pipe -DLDAP_DEPRECATED -fno-strict-aliasing build/temp.freebsd-11.0-CURRENT-amd64-2.7/Modules/LDAPObject.o build/temp.freebsd-11.0-CURRENT-amd64-2.7/Modules/ldapcontrol.o build/temp.freebsd-11.0-CURRENT-amd64-2.7/Modules/common.o build/temp.freebsd-11.0-CURRENT-amd64-2.7/Modules/constants.o build/temp.freebsd-11.0-CURRENT-amd64-2.7/Modules/errors.o build/temp.freebsd-11.0-CURRENT-amd64-2.7/Modules/functions.o build/temp.freebsd-11.0-CURRENT-amd64-2.7/Modules/schema.o build/temp.freebsd-11.0-CURRENT-amd64-2.7/Modules/ldapmodule.o build/temp.freebsd-11.0-CURRENT-amd64-2.7/Modules/message.o build/temp.freebsd-11.0-CURRENT-amd64-2.7/Modules/version.o build/temp.freebsd-11.0-CURRENT-amd64-2.7/Modules/options.o build/temp.freebsd-11.0-CURRENT-amd64-2.7/Modules/berval.o -L/usr/local/lib -L/usr/lib -R/usr/local/lib -R/usr/lib -lldap_r -o build/lib.freebsd-11.0-CURRENT-amd64-2.7/_ldap.so cc: error: unknown argument: '-R/usr/local/lib' cc: error: unknown argument: '-R/usr/lib' error: command 'cc' failed with exit status 1 cc -shared -O2 -pipe -fno-strict-aliasing build/temp.freebsd-11.0-CURRENT-amd64-2.7/Modules/_bsddb.o -L/usr/local/lib -R/usr/local/lib -o build/lib.freebsd-11.0-CURRENT-amd64-2.7/bsddb3/_pybsddb.so -ldb-4.3 cc: error: unknown argument: '-R/usr/local/lib' error: command 'cc' failed with exit status 1 I found the patch below to help, it is for function runtime_library_dir_option in Lib/distutils/unixccompiler.py -Wl,-rpath works for both gcc and clang on freebsd --- ./Lib/distutils/unixccompiler.py.orig +++ ./Lib/distutils/unixccompiler.py @@ -228,6 +228,8 @@ if sys.platform[:6] == "darwin": # MacOSX's linker doesn't understand the -R flag at all return "-L" + dir + elif sys.platform[:7] == "freebsd": + return "-Wl,-rpath=" + dir elif sys.platform[:5] == "hp-ux": if self._is_gcc(compiler): return ["-Wl,+s", "-L" + dir] |
|||
| msg212177 - (view) | Author: Kubilay Kocak (koobs) (Python triager) | Date: 2014年02月25日 13:40 | |
Details on how clang 3.4 changes behaviour for compiler flags: http://llvm.org/releases/3.4/tools/clang/docs/ReleaseNotes.html#new-compiler-flags |
|||
| msg212185 - (view) | Author: Matthias Klose (doko) * (Python committer) | Date: 2014年02月25日 15:48 | |
this looks safe from my point of view. However the real problem is that you unconditionally add a runtime path for a standard system path. I think the better way to fix this is not to pass the -L and -R arguments at all if the library is found in a system path. |
|||
| msg212188 - (view) | Author: Antoine Brodin.FreeBSD (Antoine.Brodin.FreeBSD) | Date: 2014年02月25日 16:45 | |
For the python-ldap extension, this seems to be a buglet in its setup.cfg, it lists /usr/lib in library_dirs and /usr/include in library_dirs For the others, /usr/local/lib is not in the default library search path (only /lib and /usr/lib) so at least -L has to be specified. |
|||
| msg212193 - (view) | Author: Martin v. Löwis (loewis) * (Python committer) | Date: 2014年02月25日 18:26 | |
doko: how do you know the addition of the -R option is unconditional? and whom do you refer to by "you" who is adding the option? In any case, the patch is independent of whether the option is added unconditionally, and I agree that the patch looks safe. The question is whether it should be extended to the other *BSDs as well. |
|||
| msg212415 - (view) | Author: Kubilay Kocak (koobs) (Python triager) | Date: 2014年02月28日 09:04 | |
Attaching patch against default |
|||
| msg212419 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2014年02月28日 10:32 | |
> The question is whether it should be extended to the other *BSDs as well. The change is not needed on Linux (if Clang 3.4 is used to compile extensions too)? |
|||
| msg212718 - (view) | Author: Kubilay Kocak (koobs) (Python triager) | Date: 2014年03月04日 13:23 | |
It would be great if this could make it into 3.4, extended to include other OS's if necessary at a later date. |
|||
| msg212719 - (view) | Author: Arfrever Frehtes Taifersar Arahesis (Arfrever) * (Python triager) | Date: 2014年03月04日 13:38 | |
https://bugs.gentoo.org/show_bug.cgi?id=503352 suggests that this problem occurs also on Linux when using Clang. |
|||
| msg215310 - (view) | Author: Dirkjan Ochtman (djc) * (Python committer) | Date: 2014年04月01日 13:12 | |
Can we have some more feedback on this? |
|||
| msg215312 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2014年04月01日 13:16 | |
See also issue #21122. |
|||
| msg215315 - (view) | Author: Dirkjan Ochtman (djc) * (Python committer) | Date: 2014年04月01日 13:29 | |
That does look to be a different issue, though. |
|||
| msg257021 - (view) | Author: Stefan Krah (skrah) * (Python committer) | Date: 2015年12月26日 10:27 | |
Over at the llvm bug tracker this is marked as a release blocker: https://llvm.org/bugs/show_bug.cgi?id=18164 |
|||
| msg270077 - (view) | Author: Stefan Krah (skrah) * (Python committer) | Date: 2016年07月10日 08:50 | |
Strange, why can anyone edit the classification? It happens a lot lately. |
|||
| msg270767 - (view) | Author: Stéphane Wirtel (matrixise) * (Python committer) | Date: 2016年07月18日 15:58 | |
I have checked the status of the FreeBSD issue, and it's "New". What do you think for the fix ? |
|||
| msg271845 - (view) | Author: Evelyn Mitchell (Evelyn Mitchell) * (Python triager) | Date: 2016年08月02日 19:39 | |
The patch looks reasonable, but needs to be tested on FreeBSD. |
|||
| msg271850 - (view) | Author: Kubilay Kocak (koobs) (Python triager) | Date: 2016年08月02日 20:56 | |
Nothing is required (as far as I'm aware) other than commit/merge on a two line change scoped only to FreeBSD. The issue was reported for and on FreeBSD and the patch has been carried locally in all FreeBSD Python ports/packages (2.7, 3.3, 3.4, 3.5) for over two years: https://svnweb.freebsd.org/ports?view=revision&revision=346428 https://svnweb.freebsd.org/ports?view=revision&revision=351610 |
|||
| msg271851 - (view) | Author: Evelyn Mitchell (Evelyn Mitchell) * (Python triager) | Date: 2016年08月02日 21:00 | |
I think this patch should pass to the next stage. Thank you, koobs. |
|||
| msg271852 - (view) | Author: Stefan Krah (skrah) * (Python committer) | Date: 2016年08月02日 21:08 | |
We can of course commit this, but could you also lobby here? https://llvm.org/bugs/show_bug.cgi?id=18164 I'm seeing this quite often that we fix something here and no one insists on the upstream bug trackers. |
|||
| msg271856 - (view) | Author: Evelyn Mitchell (Evelyn Mitchell) * (Python triager) | Date: 2016年08月02日 21:35 | |
Stefan, I've commented on the llvm bugzilla. Thanks for suggesting that. |
|||
| msg271857 - (view) | Author: Kubilay Kocak (koobs) (Python triager) | Date: 2016年08月02日 21:35 | |
@Stefan I've notified our FreeBSD Clang/LLVM people of the upstream bug status, though there are indications that the "-Wl,-rpath" method is considered the recommended/canonical/future way to do things properly. |
|||
| msg271883 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2016年08月03日 09:19 | |
New changeset 441bbf4cc914 by Stefan Krah in branch '3.5': Issue #20767: Fix -R option for FreeBSD/clang. https://hg.python.org/cpython/rev/441bbf4cc914 |
|||
| msg271884 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2016年08月03日 09:23 | |
New changeset 65eb8d0ede75 by Stefan Krah in branch '2.7': Issue #20767: Fix -R option for FreeBSD/clang. https://hg.python.org/cpython/rev/65eb8d0ede75 |
|||
| msg271885 - (view) | Author: Stefan Krah (skrah) * (Python committer) | Date: 2016年08月03日 09:26 | |
@Evelyn @koobs Thanks for communicating with the other projects that are involved in this issue! Could you double-check that especially the 2.7 patch does exactly what you want? For 2.7 it's practically a one time chance. |
|||
| msg271889 - (view) | Author: Kubilay Kocak (koobs) (Python triager) | Date: 2016年08月03日 10:19 | |
@Stefan I'll touch base with Antoine (OP) and confirm that this is a root-cause, permanent solution |
|||
| msg271890 - (view) | Author: Kubilay Kocak (koobs) (Python triager) | Date: 2016年08月03日 10:26 | |
Not sure why the stage field changed on last submission. Restore accordingly to previous state |
|||
| msg281845 - (view) | Author: Stefan Krah (skrah) * (Python committer) | Date: 2016年11月28日 08:07 | |
I guess the FreeBSD people are happy with the solution. |
|||
| msg310437 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2018年01月22日 17:35 | |
> I guess the FreeBSD people are happy with the solution. According to the discussion on https://github.com/python/cpython/pull/5233 : some FreeBSD people are unhappy :-) |
|||
| msg310446 - (view) | Author: Stefan Krah (skrah) * (Python committer) | Date: 2018年01月22日 18:27 | |
Well, they had ample time to articulate themselves. :) |
|||
| msg311315 - (view) | Author: Kubilay Kocak (koobs) (Python triager) | Date: 2018年01月31日 07:48 | |
The changeset(s) applied in this issue were/are fine (thus no response on the issue) It is the *removal* of the changesets included in this issue (as proposed in https://github.com/python/cpython/pull/5233) that would re-break compilation of extensions with clang (requiring re-opening this issue) The root cause of the current confusion is the special case added here was conditional on the OS ('freebsd'), whereas it should (arguably) have been for a specific compiler (clang). In order to do this, this leads to the compiler detection code requiring improvement, see: https://github.com/python/cpython/pull/5233#issuecomment-358906977 as it currently does not detect clang as the default compiler (cc), see: https://github.com/python/cpython/pull/5233#issuecomment-358948425 |
|||
| msg311316 - (view) | Author: Kubilay Kocak (koobs) (Python triager) | Date: 2018年01月31日 07:51 | |
If the intent is to use this issue to track the resolution of the original issue (clang compilation broken) and cover the new PR (which just moves the code from os detection to compiler detection), then it can remain open. Otherwise it can be closed, as the original issue 'has' been fixed. |
|||
| msg334606 - (view) | Author: Larry Hastings (larry) * (Python committer) | Date: 2019年01月31日 06:00 | |
It's too late to fix this for Python 3.4 and 3.5, as those are now in security-fixes-only mode. Also, please don't select every possible component that could be remotely connected. |
|||
| msg334620 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2019年01月31日 10:26 | |
> If the intent is to use this issue to track the resolution of the original issue (clang compilation broken) and cover the new PR (which just moves the code from os detection to compiler detection), then it can remain open. Otherwise it can be closed, as the original issue 'has' been fixed. Ok, I close the issue. On https://github.com/python/cpython/pull/5233 bapt asked "code changes", but I don't understand what exactly and I'm not interested to continue to work on these changes. If someone is interested, please open a new issue (pointing to this one). |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:59 | admin | set | github: 64966 |
| 2019年01月31日 22:45:10 | r.david.murray | set | nosy:
- r.david.murray |
| 2019年01月31日 10:26:46 | vstinner | set | status: open -> closed resolution: fixed messages: + msg334620 |
| 2019年01月31日 10:02:57 | terry.reedy | set | nosy:
- terry.reedy |
| 2019年01月31日 06:01:45 | larry | set | priority: high -> normal type: resource usage -> compile error |
| 2019年01月31日 06:00:11 | larry | set | messages:
+ msg334606 components: - Build, Demos and Tools, Distutils, Documentation, IDLE, Installation, Interpreter Core, Library (Lib), Regular Expressions, Tests, Tkinter, Unicode, XML, 2to3 (2.x to 3.x conversion tool), ctypes, IO, Cross-Build, email, asyncio, Argument Clinic, FreeBSD, SSL versions: - Python 3.4, Python 3.5 |
| 2019年01月31日 05:57:26 | Pascal van der Donck | set | versions:
+ Python 3.4 nosy: + terry.reedy, larry, asvetlov, mrabarnett, yselivanov, barry, Alex.Willmer, r.david.murray, docs@python assignee: docs@python components: + Build, Demos and Tools, Documentation, Extension Modules, IDLE, Installation, Interpreter Core, Library (Lib), Regular Expressions, Tests, Tkinter, Unicode, XML, 2to3 (2.x to 3.x conversion tool), ctypes, IO, Cross-Build, email, asyncio, Argument Clinic, FreeBSD, SSL type: compile error -> resource usage |
| 2018年01月31日 07:51:48 | koobs | set | messages: + msg311316 |
| 2018年01月31日 07:48:49 | koobs | set | messages: + msg311315 |
| 2018年01月22日 18:27:28 | skrah | set | messages: + msg310446 |
| 2018年01月22日 17:35:02 | vstinner | set | status: closed -> open resolution: fixed -> (no value) messages: + msg310437 |
| 2016年11月28日 08:07:33 | skrah | set | status: open -> closed resolution: fixed messages: + msg281845 stage: commit review -> resolved |
| 2016年08月03日 10:26:08 | koobs | set | messages:
+ msg271890 stage: patch review -> commit review |
| 2016年08月03日 10:19:02 | koobs | set | messages:
+ msg271889 stage: commit review -> patch review |
| 2016年08月03日 09:28:02 | skrah | set | stage: patch review -> commit review |
| 2016年08月03日 09:26:58 | skrah | set | messages: + msg271885 |
| 2016年08月03日 09:23:50 | python-dev | set | messages: + msg271884 |
| 2016年08月03日 09:19:23 | python-dev | set | nosy:
+ python-dev messages: + msg271883 |
| 2016年08月02日 21:35:30 | koobs | set | messages: + msg271857 |
| 2016年08月02日 21:35:04 | Evelyn Mitchell | set | messages: + msg271856 |
| 2016年08月02日 21:08:06 | skrah | set | messages: + msg271852 |
| 2016年08月02日 21:00:57 | Evelyn Mitchell | set | messages: + msg271851 |
| 2016年08月02日 20:56:05 | koobs | set | messages: + msg271850 |
| 2016年08月02日 19:39:23 | Evelyn Mitchell | set | nosy:
+ Evelyn Mitchell messages: + msg271845 |
| 2016年07月18日 15:58:48 | matrixise | set | nosy:
+ matrixise messages: + msg270767 |
| 2016年07月10日 09:25:45 | berker.peksag | set | type: performance -> compile error components: - Installation, Interpreter Core, Library (Lib), Tests versions: - Python 3.3, Python 3.4 |
| 2016年07月10日 08:50:52 | skrah | set | messages: + msg270077 |
| 2016年07月10日 05:26:56 | Pes2009k | set | type: compile error -> performance components: + Installation, Interpreter Core, Library (Lib), Tests versions: + Python 3.3, Python 3.4 |
| 2016年04月12日 18:52:57 | zach.ware | set | hgrepos: - hgrepo339 |
| 2016年04月12日 16:41:12 | berker.peksag | set | stage: patch review components: - Build, Extension Modules, Interpreter Core, Tkinter, Unicode, Windows, XML versions: - Python 3.2, Python 3.3, Python 3.4 |
| 2016年04月12日 15:46:51 | supriyantomaftuh | set | hgrepos:
+ hgrepo339 nosy: + ezio.melotti, paul.moore, tim.golden, eric.araujo, zach.ware, dstufft, steve.dower components: + Build, Extension Modules, Interpreter Core, Tkinter, Unicode, Windows, XML versions: + Python 3.2 |
| 2015年12月26日 10:27:56 | skrah | set | nosy:
+ skrah messages: + msg257021 |
| 2015年12月26日 02:43:19 | koobs | set | keywords:
+ easy, needs review versions: + Python 3.6 |
| 2014年04月01日 13:29:58 | djc | set | messages: + msg215315 |
| 2014年04月01日 13:16:22 | vstinner | set | messages: + msg215312 |
| 2014年04月01日 13:12:52 | djc | set | messages: + msg215310 |
| 2014年04月01日 13:12:27 | djc | set | nosy:
+ djc |
| 2014年03月04日 13:38:57 | Arfrever | set | messages: + msg212719 |
| 2014年03月04日 13:23:03 | koobs | set | messages: + msg212718 |
| 2014年02月28日 10:32:18 | vstinner | set | nosy:
+ vstinner messages: + msg212419 |
| 2014年02月28日 09:04:49 | koobs | set | files:
+ python-issue20767.diff type: compile error messages: + msg212415 keywords: + patch |
| 2014年02月26日 04:50:02 | Arfrever | set | nosy:
+ Arfrever |
| 2014年02月25日 18:26:18 | loewis | set | messages: + msg212193 |
| 2014年02月25日 16:45:44 | Antoine.Brodin.FreeBSD | set | messages: + msg212188 |
| 2014年02月25日 15:48:31 | doko | set | messages: + msg212185 |
| 2014年02月25日 15:44:47 | rhettinger | set | priority: normal -> high |
| 2014年02月25日 13:40:55 | koobs | set | messages: + msg212177 |
| 2014年02月25日 13:38:36 | koobs | set | versions: + Python 3.3, Python 3.4, Python 3.5 |
| 2014年02月25日 13:34:27 | vstinner | set | nosy:
+ loewis, doko, thomas-petazzoni |
| 2014年02月25日 13:33:18 | Antoine.Brodin.FreeBSD | create | |