Ecere SDK/eC Forums https://ec-lang.org/community/ Print view |
|
64 bit support https://ec-lang.org/community/viewtopic.php?f=28&t=246 |
Page 1 of 2 |
Author: | jerome [ Thu Aug 09, 2012 10:18 pm ] |
Post subject: | 64 bit support |
So we've been wanting to run in 64 bit for the longest time... At first I did not have a 64 bit PC so I had a good excuse, but those times are long gone... We still have the excuse that MinGW32 does not support 64 bit, but we have MinGW-W64 to try It seems that it'd be easier to get this started on Linux, however, and there's already some basic awareness in the IDE to build in 32 vs 64 bit. The options are still missing a GUI in Project settings however (contributions welcome to add it - http://ecere.com/mantis/view.php?id=743), so we'll have to hack at the project files with a text editor for now... vendu mentionned the interest to get this 64 bit support in eC going, so here's why I'm bothering with this at all The problem of 64 bit lies in a few areas... The eC compiler will need some awareness of the size of data types, and so will the eC runtime. I'm almost certain some generated C code makes some bad assumptions, and coded code in the runtime and/or compiler as well... Note that ideally a distinction should be made between host and target, so a 64 bit eC compiler should be able to compile eC code meant to run on a 32 bit machine... Ideally, there won't be too much attention that must be given to this, and generated C code should be able to build on both 32 and 64 bit systems (In fact, this is a requirement for the bootstrapping compiler at the minimum, which is generated C code, to be able to run on both 32 and 64 bit!) So things to watch for: sticking void * in int (I've done that a lot). e.g. in Window::id, DataRow::tag, etc. The new collection classes (containers) were thought with 64 bit in mind, but there might still be some issues with them. The old containers however, which are still used in many areas (especially throughout the compiling tools), must be making a lot of sizeof(int) == sizeof(void *) assumptions. We need to phase them out completely, in favor of the new containers, but for now it might be easier to just fix them to work in both 32 and 64 bit. These are: - OldArray - OldList (Along with related classes NamedItem, NamedLink, Item, OldLink) - BinaryTree (Along with BTNode) Multiple-data types unions and such are used, and we'll have to be careful about the offset (little-endian vs big-endian 64 bit machines!) So... here's how I propose to start. First we should try to get a very basic hello world application compiled and running in 64 bit. Code: Select all
First of all, checkout the dev branch from github @ https://github.com/ecere/sdk/tree/dev . make yourself some work folder, say /ecere64/ And in there make a subfolder /ecere64/ecereCOM Copy sdk/ecere/src and sdk/ecere/ecereCOM.epj in there . Then make a new empty project in /ecere64/hello/ and add the above snippet in to a file called hello.ec Now we'll text edit these .epj to make them build in 64 bit. We need to add the option "BuildBitDepth" : "Bits64" under the top level options, so Hello.epj will look like this Code: Select all
To link and/or run this Hello application however, we'll need to build ecereCOM in 64 bit as well. So do a Project/Add project to workspace and add /ecere64/ecereCOM.epj , which you text-edited to build as 64 bit as well. Try to build it, and see how far you get Once this hello world is going, we can try to build the full ecere runtime, and see how far we get with a GUI application =) Let's keep this thread going till we can do 64 bit =) -Jerome |
Author: | D.Bane [ Fri Aug 10, 2012 5:55 am ] |
Post subject: | Re: 64 bit support |
Hi Jerome, this is certainly a good news. I have checked the Mantis link.. Would it not be better to instead of do a Code: Select all
Also Jerome when compiling the 64bit app, the int class would still be 32 bit in the 64bit application, and the int64 would be of the same size as well, am I right? Will start with the compilation at the evening (hopefully) and will let you know (<- I need to update the ecere as well) Best Regards, D.Bane |
Author: | jerome [ Fri Aug 10, 2012 7:59 am ] |
Post subject: | Re: 64 bit support |
Hi D.Bane! Well the idea is that the platform is Windows, or Linux... And the bit depth can be checked independently... (Although ideally, the application would not need to know about that... The only major difference being the size of pointers). Yes, that's correct. int/uint will always be 32-bit in eC, and int64/uint64 will always be 64 bit. Regards, Jerome |
Author: | redj [ Sun Oct 21, 2012 6:12 pm ] |
Post subject: | Re: 64 bit support |
Hi all! Is anyone actively working on this? Can we work together to get this done? https://github.com/redj/sdk/tree/bit64 -redj |
Author: | redj [ Sun Oct 21, 2012 6:14 pm ] |
Post subject: | Re: 64 bit support |
here's the output of building hello64.epj so far... Code: Select all
-redj |
Author: | redj [ Sun Oct 21, 2012 6:15 pm ] |
Post subject: | Re: 64 bit support |
now the output of building ecereCOM.epj in 64 bit... Code: Select all
the command: Code: Select all
Code: Select all
any thoughts? -redj |
Author: | redj [ Sun Oct 21, 2012 6:50 pm ] |
Post subject: | Re: 64 bit support |
say we charge ahead having added dl and pthread to bit64/ecere/ecereCOM.epj... adding ../ecere/obj/ecereCOM.release.linux to the additional library dirs of bit64/hello64/hellp64.epj we can now link hello64 successfully: Code: Select all
-redj |
Author: | redj [ Sun Oct 21, 2012 6:52 pm ] |
Post subject: | Re: 64 bit support |
now running hello64 in debug mode... not surprisingly: Code: Select all
Code: Select all
could we please have some pointers on how to fix our good friends BinaryTree and BTNode? could the issue at hand be this code: Code: Select all
this could be more complex and involve a compiler issue... who's going to help? the latest code is at https://github.com/redj/sdk/tree/bit64 I'm leaving the bit64 branch as it is for now... please help me keep this going! -redj |
Author: | redj [ Sun Oct 21, 2012 7:23 pm ] |
Post subject: | Re: 64 bit support |
oh, regarding editing project files manually to add the building in 64 bit (or 32 bit) option: Code: Select all
see the commit. -redj |
Author: | jerome [ Sun Oct 21, 2012 11:59 pm ] |
Post subject: | Re: 64 bit support |
In fact pthread and dl should probably be there, they must somehow just be picked up automatically in 32 bit or something... - pthread is used for mutexex which is used by the eC memory manager (included in ecereCOM) - dl is used for loading eC shared library modules (dlopen) You'll also notice they are already in the Release config, and in Makefile.ecereCOM (Should probably be moved to Common). |
All times are UTC-05:00 | Page 1 of 2 |
Powered by phpBB® Forum Software © phpBB Limited |