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

error: ld returned 1 exit status #25

Open
KarelWintersky opened this issue Mar 3, 2022 · 8 comments
Open

error: ld returned 1 exit status #25

KarelWintersky opened this issue Mar 3, 2022 · 8 comments

Comments

@KarelWintersky
Copy link

$ make
g++ -O3 -std=c++11 -Wall -Werror   -c -o ethq.o ethq.cc
g++ -O3 -std=c++11 -Wall -Werror   -c -o interface.o interface.cc
g++ -O3 -std=c++11 -Wall -Werror   -c -o parser.o parser.cc
g++ -O3 -std=c++11 -Wall -Werror   -c -o drv_generic.o drv_generic.cc
g++ -O3 -std=c++11 -Wall -Werror   -c -o drv_bcm.o drv_bcm.cc
g++ -O3 -std=c++11 -Wall -Werror   -c -o drv_emulex.o drv_emulex.cc
g++ -O3 -std=c++11 -Wall -Werror   -c -o drv_intel.o drv_intel.cc
g++ -O3 -std=c++11 -Wall -Werror   -c -o drv_mellanox.o drv_mellanox.cc
g++ -O3 -std=c++11 -Wall -Werror   -c -o drv_amazon.o drv_amazon.cc
g++ -O3 -std=c++11 -Wall -Werror   -c -o drv_virtio.o drv_virtio.cc
g++ -O3 -std=c++11 -Wall -Werror   -c -o drv_vmware.o drv_vmware.cc
g++ -o ethq ethq.o ethtool++.o interface.o parser.o util.o drv_generic.o drv_bcm.o drv_emulex.o drv_intel.o drv_mellanox.o drv_amazon.o drv_virtio.o drv_vmware.o -O3 -std=c++11 -Wall -Werror -s -lncurses -ltinfo
/usr/bin/ld: ethtool++.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: util.o: relocation R_X86_64_32 against symbol `_ZNSt12system_errorD1Ev@@GLIBCXX_3.4.11' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: util.o: warning: relocation against `__errno_location@@GLIBC_2.2.5' in read-only section `.text'
collect2: error: ld returned 1 exit status
make: *** [Makefile:16: ethq] Error 1

@raybellis
Copy link
Collaborator

What specific Linux distro is this happening on?

@KarelWintersky
Copy link
Author

KarelWintersky commented Mar 4, 2022

Debian 11 (on VPS)

@raybellis
Copy link
Collaborator

raybellis commented Mar 4, 2022

@oerdnj Hi Ondrej - do you have any idea what might cause this C++ compilation error under Debian?

@oerdnj
Copy link

oerdnj commented Mar 4, 2022

Adding -fPIE doesn't help?

@raybellis
Copy link
Collaborator

raybellis commented Mar 4, 2022

Without a Debian 11 system I can't test that.

It doesn't hurt at least, on my FC32 system, but I'm mystified as to why it would be necessary.

@raybellis
Copy link
Collaborator

It does build perfectly well with gcc 9.3.0 on one of our Ubuntu 20.04.3 LTS systems (without -fPIE).

@KarelWintersky
Copy link
Author

I compiled it on my server (Debian 11 on real hardware). No errors.
I think, it is a problem with virtual network card.

Also, in VULTR VPS compiled without errors.
in Timeweb VPS - had errors.

Adding -fPIE doesn't help?

where?

@raybellis
Copy link
Collaborator

They'd be added to the CXXFLAGS in the Makefile.

FWIW, the virtual network card can't affect compilation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants