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

gdb: fix Add python3 linkage support #17979

Closed
wants to merge 1 commit into from
Closed

gdb: fix Add python3 linkage support #17979

wants to merge 1 commit into from

Conversation

ttimasdf
Copy link

@ttimasdf ttimasdf commented Sep 12, 2017

  • Have you followed the guidelines for contributing?
  • Have you checked that there aren't other open pull requests for the same formula update/change?
  • Have you built your formula locally with brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • Does your build pass brew audit --strict <formula> (after doing brew install <formula>)?

Description:
I've made a patch to configure process and make it possible to compile gdb against python3. When launched with python3, gdb/python/python-config.py in the source file generates some flags that clang may not recognize. I tried to patch it but with no luck. So instead I choose the python3-config that comes with python, it works.

The difference of their output:

$ python3 python/python-config.py --ldflags
-L/usr/local/opt/python3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/config-3.6m-darwin -ldl -framework CoreFoundation -lpython3.6m -Wl,-stack_size,1000000 -framework CoreFoundation Python.framework/Versions/3.6/Python

$ python3-config --ldflags
-L/usr/local/opt/python3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/config-3.6m-darwin -lpython3.6m -ldl -framework CoreFoundation

@ilovezfs
Copy link
Contributor

Not sure I understand this.

iMac-TMP:~ joe$ gdb
GNU gdb (GDB) 8.0.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-darwin15.6.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".
(gdb) 

@ttimasdf
Copy link
Author

@ilovezfs sorry I was a bit lazy writing a description. now updated. After applied the patch in the commit, we could choose to build gdb with python3, just another option ;-p

@ilovezfs
Copy link
Contributor

@ttimasdf Thanks for explaining ❤️. We'll need to get the patch reported and accepted upstream before we can ship this, I'm afraid.

@ttimasdf
Copy link
Author

Debian/Ubuntu guys have already had a patch years ago at version 7.8-0ubuntu2 and 7.6.2-1.1(jessie) But it has never been accepted by upstream, regarding the maybe-broken python-config on other platforms. Maybe we should add the patch by our own as well.

@ttimasdf
Copy link
Author

another fix that should work, inspired from original python3.6-config

diff --git a/gdb/python/python-config.py.origin b/gdb/python/python-config.py
index c2b2969..554dac9 100644
--- a/gdb/python/python-config.py.origin
+++ b/gdb/python/python-config.py
@@ -72,7 +72,7 @@ for opt in opt_flags:
                     libs.insert(0, '-L' + getvar('LIBPL'))
                 elif os.name == 'nt':
                     libs.insert(0, '-L' + sysconfig.PREFIX + '/libs')
-            if getvar('LINKFORSHARED') is not None:
+            if not getvar('PYTHONFRAMEWORK'):
                 libs.extend(getvar('LINKFORSHARED').split())
         print (to_unix_path(' '.join(libs)))

Any suggestions?

@ilovezfs
Copy link
Contributor

@BrewTestBot test this please

1 similar comment
@ilovezfs
Copy link
Contributor

@BrewTestBot test this please

@ilovezfs
Copy link
Contributor

ilovezfs commented Oct 7, 2017

We'll need this patch upstreamed before it can be accepted in Homebrew. Sorry @ttimasdf and thanks for the PR nonetheless!

@ilovezfs ilovezfs closed this Oct 7, 2017
@Homebrew Homebrew locked and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants