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

Linker failure when creating main binary with python-config --libs #81364

Closed
tiran opened this issue Jun 6, 2019 · 4 comments
Closed

Linker failure when creating main binary with python-config --libs #81364

tiran opened this issue Jun 6, 2019 · 4 comments
Labels
3.8 only security fixes 3.9 only security fixes build The build process and cross-build interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@tiran
Copy link
Member

tiran commented Jun 6, 2019

BPO 37183
Nosy @vstinner, @tiran

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2019-06-06.20:21:00.593>
created_at = <Date 2019-06-06.19:55:36.479>
labels = ['interpreter-core', 'invalid', 'build', '3.8', '3.9']
title = 'Linker failure when creating main binary with python-config --libs'
updated_at = <Date 2019-06-06.20:32:08.824>
user = 'https://github.com/tiran'

bugs.python.org fields:

activity = <Date 2019-06-06.20:32:08.824>
actor = 'vstinner'
assignee = 'none'
closed = True
closed_date = <Date 2019-06-06.20:21:00.593>
closer = 'christian.heimes'
components = ['Interpreter Core']
creation = <Date 2019-06-06.19:55:36.479>
creator = 'christian.heimes'
dependencies = []
files = []
hgrepos = []
issue_num = 37183
keywords = []
message_count = 4.0
messages = ['344864', '344866', '344869', '344872']
nosy_count = 2.0
nosy_names = ['vstinner', 'christian.heimes']
pr_nums = []
priority = 'high'
resolution = 'not a bug'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'compile error'
url = 'https://bugs.python.org/issue37183'
versions = ['Python 3.8', 'Python 3.9']

@tiran
Copy link
Member Author

tiran commented Jun 6, 2019

With 3.8 it is no longer possible to compile a custom Python interpreter with linker flags from python-config. The config helper omits the main Python library:

$ python3.8-config --ldflags
 -L/usr/lib64  -lcrypt -lpthread -ldl  -lutil -lm -lm

$ gcc  -L/usr/lib64  -lcrypt -lpthread -ldl  -lutil -lm -lm -o custompython custompython.o
/usr/bin/ld: custompython.o: in function `main':
custompython.c:10: undefined reference to `Py_BytesMain'
collect2: error: ld returned 1 exit status

@tiran tiran added 3.8 only security fixes 3.9 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) build The build process and cross-build labels Jun 6, 2019
@tiran
Copy link
Member Author

tiran commented Jun 6, 2019

python-3.8.pc also omits -lpython3.8:

$ pkg-config python-3.8 --libs

@tiran
Copy link
Member Author

tiran commented Jun 6, 2019

memo to me: read the **whole** what's new document.

https://docs.python.org/3.8/whatsnew/3.8.html#debug-build-uses-the-same-abi-as-release-build

@tiran tiran closed this as completed Jun 6, 2019
@tiran tiran added the invalid label Jun 6, 2019
@vstinner
Copy link
Member

vstinner commented Jun 6, 2019

It is a deliberate change but matbe it is not well documented? Should we
update the C API doc?

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.8 only security fixes 3.9 only security fixes build The build process and cross-build interpreter-core (Objects, Python, Grammar, and Parser dirs)
Projects
None yet
Development

No branches or pull requests

2 participants