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

x64: build a Position-Independent Executable (PIE) #2358

Merged
merged 3 commits into from Jun 3, 2015

Conversation

Tilka
Copy link
Member

@Tilka Tilka commented May 2, 2015

This is needed to run on x86_64 OSes that require PIC for strong ASLR, e.g. Android or Hardened Gentoo (issue 7467).

I feel like I forgot something, can't remember what...

@Tilka Tilka changed the title x86: build a Position-Independent Executable (PIE) x64: build a Position-Independent Executable (PIE) May 2, 2015
@BhaaLseN
Copy link
Member

BhaaLseN commented May 2, 2015

Mh, other than the broken builders, wasn't there a difference in hardened GCCs that uses a different command line switch for this? Might not be PIE tho, can't remember atm (but it was related to not working on hardened).

@Sonicadvance1
Copy link
Contributor

You're most like thinking of the -fno-pie flag that we were looking at.

@BhaaLseN
Copy link
Member

BhaaLseN commented May 2, 2015

Sounds like it. Guess this clears that up :)

@Tilka Tilka force-pushed the pie branch 2 times, most recently from 3a62773 to 3280987 Compare May 3, 2015 07:43
@phire
Copy link
Member

phire commented May 6, 2015

I'm very weary about getHeapOp explicitly using a scratch register. Sounds like a good way to introduce bugs. Especially since it only uses the scratch register sometimes at random.

@Tilka
Copy link
Member Author

Tilka commented May 11, 2015

@phire Dropped that function.

@Tilka
Copy link
Member Author

Tilka commented May 18, 2015

Note to self: If we ever want to run multiple CPUs in parallel with the same block cache, we'll get problems with PIE.

@degasus
Copy link
Member

degasus commented May 26, 2015

Anything still missing?

@Tilka
Copy link
Member Author

Tilka commented May 26, 2015

Didn't change anything, just rebased to current master. Should be ready.

@@ -169,16 +169,17 @@ void Jit64AsmRoutineManager::Generate()
TEST(32, R(RSCRATCH), R(RSCRATCH));
FixupBranch notfound = J_CC(CC_L);
//grab from list and jump to it
u64 codePointers = (u64)jit->GetBlockCache()->GetCodePointers();
if (codePointers <= INT_MAX)
const u8** codePointers = jit->GetBlockCache()->GetCodePointers();

This comment was marked as off-topic.

@Tilka Tilka force-pushed the pie branch 3 times, most recently from a3a41e6 to a143a05 Compare June 3, 2015 00:29
Tilka added a commit that referenced this pull request Jun 3, 2015
x64: build a Position-Independent Executable (PIE)
@Tilka Tilka merged commit 0f7f8f8 into dolphin-emu:master Jun 3, 2015
@Tilka Tilka deleted the pie branch June 3, 2015 20:00
phire added a commit to phire/dolphin that referenced this pull request Jul 5, 2015
This reverts commit 0f7f8f8, reversing
changes made to 9f15054.
phire added a commit that referenced this pull request Jul 7, 2015
Revert "Merge pull request #2358 from Tilka/pie"
CarlKenner pushed a commit to CarlKenner/dolphin that referenced this pull request Sep 2, 2015
This reverts commit 0f7f8f8, reversing
changes made to 9f15054.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
7 participants