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

Add -no-pie flag to CMake #4365

Merged
merged 2 commits into from Oct 31, 2016
Merged

Add -no-pie flag to CMake #4365

merged 2 commits into from Oct 31, 2016

Conversation

RisingFog
Copy link
Member

@RisingFog RisingFog commented Oct 19, 2016

This works around the issue of our x64 JIT not working with PIE, which is now enabled by default in Ubuntu as of 16.10.


This change is Reviewable

@JosJuice
Copy link
Member

If PIE is a requirement, disabling PIE isn't going to make Dolphin work on Ubuntu 16.10, is it? I thought it only was enabled by default, not required.

@RisingFog
Copy link
Member Author

@JosJuice It's enabled by default, requirement I guess isn't the right word.

@RisingFog RisingFog changed the title [WIP/RFC] Add -no-pie flag to CMake Add -no-pie flag to CMake Oct 21, 2016
@ligfx
Copy link
Contributor

ligfx commented Oct 21, 2016

What's the difference between -fno-pie, -nopie, and -no-pie?

@RisingFog
Copy link
Member Author

@ligfx -no-pie and -nopie do the same thing, but -nopie was used for certain patched versions of GCC, while -no-pie was what the flag was eventually called when made upstream on GCC. -fno-pie was there before, but I can't find any examples of it being a flag. It if turns out to be useless, I'll remove it.

@ligfx
Copy link
Contributor

ligfx commented Oct 21, 2016

Ah, cool, thanks. Looks like Clang on macOS, at least, uses -fno-pie instead of the others.

@JosJuice
Copy link
Member

@cristianrm650 Did you actually review the PR, or did you press the review button without reviewing?

@johnsondelbert1
Copy link

johnsondelbert1 commented Oct 27, 2016

so where do you add this flag? I am compiling it via the command line and cant seem to figure this out, Kinda new to compiling things and using cmake

@RisingFog
Copy link
Member Author

If you pulled the PR's repository, it should just compile as normal.

Otherwise, use the patch from this PR to edit the CMakeLists.txt file, then compile as you normally would.

@BhaaLseN
Copy link
Member

FYI, r2rX on the forums also confirms that it works.

@degasus
Copy link
Member

degasus commented Oct 31, 2016

There are too many ubuntu users. Let's just merge this and wait for some other compilers to cry ...

@degasus degasus merged commit 4cf873e into dolphin-emu:master Oct 31, 2016
@RisingFog RisingFog deleted the patch-1 branch October 31, 2016 13:14
@r2rX
Copy link

r2rX commented Nov 1, 2016

Hey all,

I wanted to confirm that this PR (pre & post merge) resolved the ability to compile Dolphin in Ubuntu 16.10. Thanks alot!

@insanemal
Copy link

insanemal commented Aug 1, 2019

Why is this still broken?
[ 19%] Linking CXX executable ../../../Binaries/traversal_server /usr/bin/ld: /usr/local/lib/libmbedcrypto.a(entropy.c.o): relocation R_X86_64_32S against hidden symbol mbedtls_platform_entropy_poll' can not be used when making a PIE object
/usr/bin/ld: /usr/local/lib/libmbedcrypto.a(entropy_poll.c.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: /usr/local/lib/libmbedcrypto.a(hmac_drbg.c.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libmbedcrypto.a(md.c.o): relocation R_X86_64_32 against .rodata' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: /usr/local/lib/libmbedcrypto.a(ripemd160.c.o): relocation R_X86_64_32 against .rodata' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libmbedcrypto.a(sha1.c.o): relocation R_X86_64_32 against .rodata' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: /usr/local/lib/libmbedcrypto.a(sha256.c.o): relocation R_X86_64_32 against .rodata' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libmbedcrypto.a(sha512.c.o): relocation R_X86_64_32 against .rodata' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: /usr/local/lib/libmbedcrypto.a(timing.c.o): relocation R_X86_64_32 against .text' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libmbedcrypto.a(md5.c.o): relocation R_X86_64_32 against .rodata' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: final link failed: nonrepresentable section on output collect2: error: ld returned 1 exit status make[2]: *** [Source/Core/Common/CMakeFiles/traversal_server.dir/build.make:97: Binaries/traversal_server] Error 1 make[1]: *** [CMakeFiles/Makefile2:812: Source/Core/Common/CMakeFiles/traversal_server.dir/all] Error 2 make: *** [Makefile:152: all] Error 2

@TheGag96
Copy link

Getting this also...

@degasus
Copy link
Member

degasus commented Oct 26, 2019

"/usr/local/lib/libmbedcrypto.a"

You try to link with a static compiled library, which you have manually installed (/usr/local). Please just delete them.

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