-
Notifications
You must be signed in to change notification settings - Fork 71
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
64-bit support #313
Comments
I've started work on this in the x64 branch. I'm not sure what adjustments need to be made in the pro for the qmake stuff yet though. Testing has been limited without offsets yet, so there will be more work for sure. There's still going to be the need for a 32-bit DT while DF supports 32-bit so keeping two builds is probably easiest... although there may need to be some tweaking for the updater and/or layout directory structure to split 32 vs 64 layouts. |
I'm strongly in favor of moving to CMake entirely, because qmake sucks (more than CMake anyways). I started a local branch for it but got distracted by proper OS X support.
right, I'm saying that there are two ways to handle 32-bit support:
I think option 2 is easier. |
Related to option 1, would a union like this work? union df_ptr {
uint32_t ptr32;
uint64_t ptr64;
} Alternatively, maybe using |
edit: Hello71 is correct, this statement makes no sense. |
wat |
In hindsight I'm not sure what I meant by that statement. The union would be 8bytes long regardless of architecture, but other than wasting space on 32bit, accessing the 32bit pointer field would work correctly. I'm guessing I had a brain fart and was thinking about accessing the union without specifying which field. Regardless, it still won't work because you need to specify the field.
How do you put the address of "foo" into "bar" in an architecture independent manner using that union? Even if you set the pointer (say by always writing to the 64bit field), how do you access it without knowing what architecture you are building for? |
you do it... based on the bitness of the connected process? we are already doing highly arch-specific hacks (including but not limited to injecting |
you are correct, but that means you are back to where you were before and the union itself doesn't add anything. In fact, just using a plain pointer that isn't of a fixed width (unless needed) would likely be way less of a headache across the board anyhow. though I am wary to fully commit to that statement. It would make my day job obscenely easier, but I can't remember what edge cases that would cause pain with. |
sigh, that's option 2 of my 2 options above. |
narrowing conversions are legal but you would need to be sure in the case of pointers to do |
Hello71, yes, but my response was initially in reply to lethosor, so I had neglected to read back further up during our conversation |
I think I might roll a patch combining all the changes I want to do some time in the next few days, supporting Linux only. |
@Hello71, thanks for working on this. I just pulled your forks latest changes and have been testing tonight. I got it working after starting a new fortress and was able to correctly set some labors, but DT starts crashing after getting my first migration wave. Here is output of GDB:
My build environment is described in my fork's Dockerfile. I've also added the memfile. You can recreate using my docker newb pack Let me know where and how best to give you feedback. I might be able to submit patches if you're interested (and i get up to speed on the specific challenges here)... Thanks! |
What do you mean, "added the memfile"? If you mean the save, where? Otherwise, compile with |
By So I rebuilt your latest commit 680274b with debugging flags enabled and seems to be better. I can at least set some labors. However if I wait a while and read again it eventually crashes. backtrace debugging here I'll get these new dwarves busy filling the quantum stockpiles and keep you posted! Thanks! PS I updated ubergarm/dwarf-fortress docker image with DwarfFortress build 680274b if any other intrepid folks want to give it a try. |
I was feeling intrepid, so I tried the docker image @ubergarm provided. It worked okay until a dwarf died. After this it kept crashing each time it opened. backtrace and crashlog. I was able to mitigate the problem by saving and continue playing, but when I opened up the job manager DT crashed and couldn't be opened again without crashing. EDIT: added links to backtrace and log |
@telnoratti I appreciate your intrepidness! I just built a new container from the the latest patches to see if it helps anything out. I'd love to get this going before Toady One does the next release, lol. Just pushed a new ubergarm/dwarf-fortress docker image. Sorry no automated builds, haven't figured out best way to build/vendor everything in one place. This update has Just tested that it starts up and connects. Hopefully it keeps working with migrations and dead dwarves! Cheers have a good weekend! |
@ubergarm how do I get the 64bit patch without Ironhand? Installation instructions at all? |
You may be better off with the latest Linux lazy newb pack which caught up
to df 0.43.05 recently I believe:
http://www.bay12forums.com/smf/index.php?topic=163211.0
Otherwise, you can try building Hello71's dwarf therapist fork yourself
like I did here:
https://github.com/ubergarm/Dwarf-Therapist/blob/DF2016/Dockerfile
On Aug 4, 2017 11:31 AM, "SimplyStars" <[email protected]> wrote:
@ubergarm <https://github.com/ubergarm> how do I get the 64bit patch
without Ironhand? Installation instructions at all?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#313 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEgWYT5z1Q5wjHFxjjSZA_8fGnQC4j4xks5sUzlcgaJpZM4JM1fa>
.
|
@splintermind We have 64 bit memory layout of DF 0.44.02. Meybe we should compile ver 38 of DT with support of 64 bit and relase it as beta. What do you thing? |
Hi, I've recently updated the DT derivation in nixos, in order to be able to use it with 43.05. Similar to the LNP, I needed to use @Hello71's branch, to get a working version. I have no stake in the cmake vs qmake question, as the according change in the recipe was rather easy (NixOS/nixpkgs@d6ee81e#diff-0ca3a9429c3b2c3144eefa9018953779R20), but either way it would be awesome to get the fixes for #311 and #323 into the main branch, to free people to get 44.02 support going ;-) |
Hopefully this is not actually too hard on the DT side. In theory, the only changes needed are to change
VIRTADDR
to be typedefed tovoid *
and the memory layout parsers to be changed. However, there are probably a lot of places whereVIRTADDR
s are stuffed intoint
s which will end badly.One question is though whether we should support connecting to 32-bit DF from 64-bit DT and vice versa. I'm inclined to say "no, that's stupid, why would you use 32-bit DF on 64-bit OS", but maybe there are arguments to the contrary.
The text was updated successfully, but these errors were encountered: