question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 3 years ago
  • Comments:17 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
kayhayencommented, Jul 7, 2021

I wonder what this artificial is about. Never seen that before. Maybe some hardening options are used that prevent it.

0reactions
kayhayencommented, Oct 11, 2021

Please do not hijack issues, and fill out the issue template and make a new issue @wrchen-voxel

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found