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.

classification
Title: Python3 error while building on Alt-F
Type: compile error Stage: resolved
Components: Build Versions: Python 3.6
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: Honza Skýpala, iritkatriel, martin.panter
Priority: normal Keywords:

Created on 2017-02-13 07:52 by Honza Skýpala, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
build.log Honza Skýpala, 2017-02-13 07:52 Log from build process
Messages (7)
msg287666 - (view) Author: Honza Skýpala (Honza Skýpala) Date: 2017-02-13 07:52
While trying to build Python 3.6.0 on emmbedded Linux device — D-Link DNS-320L running Alt-F firmware (Linux 3.18.28 #1 Fri Jun 17 14:44:39 WEST 2016 armv5tel GNU/Linux), it fails with

./python: can't resolve symbol 'crypt'
make: *** [sharedmods] Error 1

I can see the python executable is compiled fine in the source directory, if I try to run it, then it does work, including some quick tests (calculations, os.getcwd, random.randint -- works fine). 

I can also see that compiling the crypt modules did not report any errors and the .o file is present on the disk. I guess it is some kind of linking error?

Attaching the log from the build.
msg287667 - (view) Author: (yan12125) * Date: 2017-02-13 08:04
My patch at https://hg.python.org/cpython/rev/ca2f024ce7cb may help. It points out missing symbols earlier.
msg287669 - (view) Author: Honza Skýpala (Honza Skýpala) Date: 2017-02-13 09:39
Hi Chi Hsuan Yen, thanks for trying to help, unfortunately no change, still getting the same error.
msg287690 - (view) Author: (yan12125) * Date: 2017-02-13 13:28
That's super strange. crypt() is used in _crypt module only, and this modules is not used elsewhere in Python. A few more tests may help diagnostics

1. What's the result of ```./python -E```?
2. Does `import crypt` run fine in ./python?
3. Are there pre-installed Python on Alt-F? Uninstall them first may help
4. Is there a symbol called crypt in `nm ./python`?
msg287723 - (view) Author: Honza Skýpala (Honza Skýpala) Date: 2017-02-13 20:12
1. What's the result of ```./python -E```?

Python 3.6.0 (default, Feb 13 2017, 08:16:44)
[GCC 4.5.4 20120202 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.

2. Does `import crypt` run fine in ./python?

No, gives the error
./python: can't resolve symbol 'crypt'

3. Are there pre-installed Python on Alt-F? Uninstall them first may help

No, there is no python preinstalled (no python3, not even python2)

4. Is there a symbol called crypt in `nm ./python`?

No, `nm ./python | grep crypt` gives no results
msg330879 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2018-12-02 11:15
The missing “crypt” symbol is probably this function: <http://pubs.opengroup.org/onlinepubs/9699919799/functions/crypt.html>. It is defined by the OS or a separate library, not by Python. You may need to link the “_crypt” Python module to the library that contains the function. E.g. in Glibc <http://man7.org/linux/man-pages/man3/crypt.3.html> you are meant to “link with -lcrypt”, although I suspect Python’s “setup.py” normally does that automatically.
msg411157 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2022-01-21 17:32
3.6 is no longer maintained, please create a new issue if you are seeing this problem on a current version (>= 3.9).
History
Date User Action Args
2022-04-11 14:58:43adminsetgithub: 73727
2022-01-21 17:32:40iritkatrielsetstatus: open -> closed

nosy: + iritkatriel
messages: + msg411157

resolution: out of date
stage: resolved
2019-01-28 03:32:38yan12125setnosy: - yan12125
2018-12-02 11:15:07martin.pantersetnosy: + martin.panter
messages: + msg330879
2017-02-13 20:12:06Honza Skýpalasetmessages: + msg287723
2017-02-13 13:28:47yan12125setmessages: + msg287690
2017-02-13 09:39:30Honza Skýpalasetmessages: + msg287669
2017-02-13 08:04:53yan12125setnosy: + yan12125
messages: + msg287667
2017-02-13 07:52:21Honza Skýpalacreate