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

zlibmodule undefined reference #77528

Closed
LucianCristian mannequin opened this issue Apr 24, 2018 · 4 comments
Closed

zlibmodule undefined reference #77528

LucianCristian mannequin opened this issue Apr 24, 2018 · 4 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes build The build process and cross-build

Comments

@LucianCristian
Copy link
Mannequin

LucianCristian mannequin commented Apr 24, 2018

BPO 33347
Nosy @Yhg1s, @serhiy-storchaka, @iritkatriel

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 2021-10-20.23:34:08.511>
created_at = <Date 2018-04-24.11:06:00.942>
labels = ['3.8', 'build', '3.7']
title = 'zlibmodule undefined reference'
updated_at = <Date 2021-10-20.23:34:08.510>
user = 'https://bugs.python.org/LucianCristian'

bugs.python.org fields:

activity = <Date 2021-10-20.23:34:08.510>
actor = 'iritkatriel'
assignee = 'none'
closed = True
closed_date = <Date 2021-10-20.23:34:08.511>
closer = 'iritkatriel'
components = ['Build']
creation = <Date 2018-04-24.11:06:00.942>
creator = 'Lucian Cristian'
dependencies = []
files = []
hgrepos = []
issue_num = 33347
keywords = []
message_count = 4.0
messages = ['315693', '315705', '363429', '401581']
nosy_count = 5.0
nosy_names = ['twouters', 'serhiy.storchaka', 'Lucian Cristian', 'Martin Ni', 'iritkatriel']
pr_nums = []
priority = 'normal'
resolution = 'out of date'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'compile error'
url = 'https://bugs.python.org/issue33347'
versions = ['Python 2.7', 'Python 3.6', 'Python 3.7', 'Python 3.8']

@LucianCristian
Copy link
Mannequin Author

LucianCristian mannequin commented Apr 24, 2018

trying to compile a utility in Openwrt and when pip-install is selected and zlib is linked to python I get this:

staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function PyZlib_crc32': build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:1045: undefined reference to crc32'
build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:1053: undefined reference to crc32' staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function PyZlib_adler32':
build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:1013: undefined reference to adler32' build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:1021: undefined reference to adler32'
staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function Decomp_dealloc': build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:469: undefined reference to inflateEnd'
staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function Comp_dealloc': build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:459: undefined reference to deflateEnd'
staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function PyZlib_objcompress': build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:504: undefined reference to deflate'
staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function PyZlib_copy': build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:772: undefined reference to deflateCopy'
staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function PyZlib_uncopy': build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:821: undefined reference to inflateCopy'
staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function PyZlib_decompressobj': build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:434: undefined reference to inflateInit2_'
staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function PyZlib_compressobj': build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:398: undefined reference to deflateInit2_'
staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function PyZlib_objdecompress': build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:632: undefined reference to inflate'
staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function PyZlib_decompress': build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:308: undefined reference to inflateInit2_'
build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:335: undefined reference to inflate' build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:360: undefined reference to inflateEnd'
build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:318: undefined reference to inflateEnd' build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:344: undefined reference to inflateEnd'
build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:349: undefined reference to inflateEnd' build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:330: undefined reference to inflateEnd'
staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o):build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:365: more undefined references to inflateEnd' follow staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function PyZlib_unflush':
build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:892: undefined reference to inflate' build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:918: undefined reference to inflateEnd'
staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function PyZlib_flush': build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:713: undefined reference to deflate'
build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:728: undefined reference to deflateEnd' staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function PyZlib_compress':
build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:220: undefined reference to deflateInit_' build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:233: undefined reference to deflateEnd'
build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:250: undefined reference to deflate' build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:245: undefined reference to deflateEnd'
build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:254: undefined reference to deflateEnd' build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:265: undefined reference to deflateEnd'
collect2: error: ld returned 1 exit status

python has access to zlib headers and libraries

@LucianCristian LucianCristian mannequin added 3.7 (EOL) end of life build The build process and cross-build labels Apr 24, 2018
@LucianCristian
Copy link
Mannequin Author

LucianCristian mannequin commented Apr 24, 2018

it seems that python-config --libs doesn't detect -lz and appending -lz fixes the problem

  • PYTHON_LIBS="\"${PYTHONCONFIG}\" --libs"
  • PYTHON_LIBS="\"${PYTHONCONFIG}\" --libs -lz"

@terryjreedy terryjreedy added the 3.8 only security fixes label Apr 27, 2018
@MartinNi
Copy link
Mannequin

MartinNi mannequin commented Mar 5, 2020

Hello sir! I got exactly same issue when compile some ipk in Openwrt. Would tell how to add "-lz" to python-config? I am not so familiar with Python coding. Thanks!

@iritkatriel
Copy link
Member

The report only shows output for 2.7. Is this issue really relevant to 3.x?

@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.7 (EOL) end of life 3.8 only security fixes build The build process and cross-build
Projects
None yet
Development

No branches or pull requests

2 participants