Add precompiled headers for framework and RELs#2597
Conversation
Report for GZ2E01 (8a30030 - ffd010d)📈 Matched code: 79.56% (+0.02%, +2208 bytes) ✅ 5 new matches
💔 3 broken matches
|
21b386c to
f25f454
Compare
23dfef7 to
2934b5f
Compare
0b69ac6 to
d684b62
Compare
| return l_dzbName; | ||
| } | ||
|
|
||
| static const char* dummy() { |
There was a problem hiding this comment.
It's there to force it to be placed earlier in .rodata, not sure if there's a more elegant way to do this though.
| Object(MatchingFor("GZ2E01", "GZ2J01"), "d/d_map.cpp"), | ||
| Object(MatchingFor("GZ2E01", "GZ2J01"), "d/d_com_inf_game.cpp", extra_cflags=['-pragma "nosyminline on"']), | ||
| Object(MatchingFor("GZ2E01", "GZ2J01"), "d/d_stage.cpp"), | ||
| Object(Equivalent, "d/d_map.cpp"), # weak func order |
There was a problem hiding this comment.
are these ones that were changed from matching to equivalent not compatible with this?
There was a problem hiding this comment.
For d_map including the PCH completely messes up the function order - I think that this object may actually not have included it. For d_select_cursor I think the PCH is correct, but it messes up the vtable padding which was previously solved with a fakematch (which I think ultimately comes down to a vtable ordering issue). I'll revert the first change for now and add a comment that it might be fake - let me know if you want me to revert the second change as well.
c9d412a to
3c310ef
Compare
This PR adds a precompiled header (
dolzel.pch) for use in RELs to match the original build process. This has a huge effect on weak function ordering and as a result many TUs are now matching as a result of these changes. This also seems to solve (at least partly) theZ2Calc::cNullVec,lit_1787, andlbl_*_data_10.dataentries andlit_1109-lit_1009.bssentries seen across the codebase.This PR also removes
nosyminline onfrom the default REL flags (and from many individual framework objects) since it is no longer necessary in the majority of cases.One issue with the changeset in its current state involves the handling of the
sqrtfconstants. The PCH needs to be built with.sdataand.sdata2enabled in order ford_kankyoandd_resorceto match; however, this causes the constants to be placed in.sdata2even in RELs such as ind_a_b_yoord_a_L7op_demo_dr(where they should be in.rodata). This not only breaks matches, but also breaks linking entirely with this message:The solution to this for now is to build the PCH twice: once with framework flags, and once with REL flags. Each object links one version or the other as appropriate. This may or may not be a fakematch and should be replaced if a better solution is found in the future.
This PR includes the changes from encounter/dtk-template#60 in order to support building the PCHs. objdiff isn't yet capable of understanding the weak data stripping going on here, so there are a LOT of false data regressions reported as a result.
See zeldaret/tww#860 for the corresponding Wind Waker PR for PCH changes.