Compilation with '--lto' fails with "In function `loadConstantsBlob': undefined reference to `constant_bin_data'"
See original GitHub issue- Nuitka version, full Python version and Platform (Windows, OSX, Linux …)
0.6.11.2
Python: 3.6.9 (default, Oct 8 2020, 12:12:24)
Executable: /usr/bin/python3
OS: Linux
Arch: x86_64
-
How did you install Nuitka and Python pip
-
Many times when you get an error from Nuitka, your setup may be special Every time.
-
Note if this is a regression Starting to get error after upgrade from Nuitka version 0.6.9.4.
-
Issue itself I have a project with with wide dependencies that was building for about half a year but broke after version upgrade. I want to add that on Ubuntu 20.04 it’s still working, so I don’t know whether it is Python or libc version matters.
Doesn’t work with optmization:
nuitka3 --standalone --plugin-enable=pylint-warnings --follow-imports --lto --output-dir=./build ./bootstrap.py
the error is:
Nuitka-Options:INFO: Recursing all is the default for standalone mode and need not be specified.
Nuitka:INFO: Starting Python compilation.
Nuitka:INFO: Completed Python level compilation and optimization.
Nuitka:INFO: Generating source code for C backend compiler.
Nuitka:INFO: Running data composer tool for optimal constant value handling.
Nuitka:INFO: Running C level backend compilation via Scons.
Nuitka-Scons:INFO: Backend C compiler: gcc (gcc).
Nuitka-Scons:INFO: Slow C compilation detected, used 60s so far, this might indicate scalability problems.
/tmp/ccT7dRnO.ltrans30.ltrans.o: In function `loadConstantsBlob':
<artificial>:(.text+0x24512): undefined reference to `constant_bin_data'
<artificial>:(.text+0x24519): undefined reference to `constant_bin_data'
<artificial>:(.text+0x245da): undefined reference to `constant_bin_data'
collect2: error: ld returned 1 exit status
Nuitka-Scons:INFO: Running gcc -o .../build/bootstrap.dist/bootstrap -flto=8 -O3 -fpartial-inlining -freorder-functions -z noexecstack -s -Wl,-R,'$ORIGIN' -Wl,--disable-new-dtags @"./@link_input.txt -L/usr/lib -ldl -lm -lpython3.6m took 98.56 seconds
Works w/o –lto:
nuitka3 --standalone --plugin-enable=pylint-warnings --follow-imports -output-dir=./build ./bootstrap.py
Issue Analytics
- State:
- Created 3 years ago
- Comments:17 (13 by maintainers)
Top Results From Across the Web
1564581 – ld problem with LTO optimisation - Red Hat Bugzilla
After few successful tests with LTO optimisation on smaller and less ... In function `main': <artificial>:(.text.startup+0x17d): undefined reference to ...
Read more >Conspy: "Undefined reference" errors when trying to compile ...
It looks like it is failing to link the libncurses library ( -lncurses ), perhaps because your system doesn't have the libncurses5-dev package ......
Read more >88550 – A compiler error when use lto
Recently I try to switch my project from GCC 7 to GCC 8, but when linking, it turned out this error: to1: internal...
Read more >What am I doing wrong? Library functions have undefined ...
But when I compile the script (gcc -o example example.c) it returns ... example.c:(.text+0x22): undefined reference to `randombytes_buf'.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I wonder what this
artificial
is about. Never seen that before. Maybe some hardening options are used that prevent it.Please do not hijack issues, and fill out the issue template and make a new issue @wrchen-voxel