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

Does not compile, relocation truncated to fit error. #1

Open
YibaiMeng opened this issue Jun 6, 2018 · 0 comments
Open

Does not compile, relocation truncated to fit error. #1

YibaiMeng opened this issue Jun 6, 2018 · 0 comments

Comments

@YibaiMeng
Copy link

Does not compile on Ubuntu 18.04, with gcc 7.3.0. Error message is:

g++ -o pyramid main.cpp -Wall -O3 -std=c++11 -lm -w
/tmp/ccqffTD2.o: In function `_GLOBAL__sub_I_big_prime':
main.cpp:(.text.startup+0x2f13): relocation truncated to fit: R_X86_64_PC32 against `.bss'
main.cpp:(.text.startup+0x2f31): relocation truncated to fit: R_X86_64_PC32 against `.bss'
collect2: error: ld returned 1 exit status
Makefile:8: recipe for target 'main' failed
make: *** [main] Error 1

I've found a workaround by modifying the makefile, adding -mcmodel=medium to CPPFLAGS. The project compiles right after this modification.

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

1 participant