Is it possible to do x64 bit software engineering in 32 bit based pc? - 64-bit

I want to be a software engineer. I have both 32 bit and 64 bit based pc. But i wondered, is it possible to make 64 bit softwares in 32 bit based pc? If not, then what can be alternative?

Related

C++ 64 Bit compiler, what does it output?

I have suddenly had a bout of confusion around Mingw-64 compilers and other compilers which are said to be 64-bit. Does this mean that the compiler is built to run on a 64 bit platform and compiles in 32-bit (this seems to be the case for all the Mingw-64 compilers I have found)? Or does it mean that it will actually copile and build 64 bit binaries.
I want to build 64 bit binaries on a 64-bit compiler and am a little confused as to whether I am actually getting 64-bit outputs despite installing a 64-bit compiler?
There are a number of versions of Ming-64 bit around, eg: tdm, ming-64.. their binary directory seems to contain wing-32 binary files?
A "64 bit compiler" will output 64 bit executables. It may or may not be 64 bit itself; MSVC++ for instance has a 64 bit compiler that's 32 bits itself.

Is a 64 bit system safer than a 32 bit one, because there are less exploits for them

Most books and papers on writing software exploits are written for the x86 processor family.
So there are probably a lot of "hackers" or crackers that only know x86 assembly.
Can you conclude from this, that 64 bit software is safer than 32 bit?
No. The x86_64 CPUs out there can run x86 (32bit) code natively, and most operating systems that cater for x86_64 allow this (optionally or not, transparently or not).
You get all the attack vectors that existed for x86, plus anything else that was added with x86_64.
But the x86_64 generation of chips also brought security features like the NX bit. This type of thing can help reducing risk.
I don't think so. 64bit OSes get more common these days, so there will be exploits in the near future too.
What you are talking about is security through obscurity, and in your particular question, it's not security at all.

Does do_div() in Linux work in 32 and 64 bit architectures?

I need to do an integer division in a kernel module and I am using do_div() for that. It seems to work on my machine (I have an i686 processor), however I am not sure that it works everywhere. Could anyone confirm whether do_div() should function correctly in 32 bit and 64 bit architectures, or whether there are any know limitations ?
I use Ubuntu 10.04 with kernel 2.6.38, so I am interested in support for kernels >= 2.6.38.
I would also be interested if anyone knows a better way to do an integer division in the kernel than do_div().
Best Regards
Daniel
do_div() does work on 64bit arch, but unless you really need the remainder and is fully aware of the effects of using do_div(), you should probably be doing bit shifts instead.

Difference between 32-bit and 64-bit Excel 2007

I had an argument with my colleagues over the difference between 32-bit and 64-bit Excel 2007. I said the main difference is that in 64-bit version, we'll be able to add more than 65536 rows where as in 32-bit we won't be able to add more than 65536 rows.
Please clarify this.
No, both 32 and 64 bit versions support more than 65536 rows, and have done since Excel 2007 was released.
The main difference is that you can work with very large workbooks in the 64 bit version. The downside of the 64 bit version is that, at present, there is poor support from 3rd party add-ins.
Update
This was written back in 2011. I'm sure that support for 3rd party add-ins is better now. However, it may still be an issue, and before installing the 64 bit version it is worth checking that all your required tools that are built on top of Excel are compatible with the 64 bit version.
Excel 2007 has only a 32-bit version. Excel 2010 introduced the 64-bit option, which Microsoft actually doesn't recommend unless you really really need it for huge databases.
The main difference is that the 32 bit version only has access to 2GB of memory. Very large integer calculations might also be faster in the 64 bit version.
Both versions can deal with more than 65536 rows.

Is it that hard to port an application to 64 bits?

I was surprised to read that Adobe discontinued the 64 bits version of Flash for Linux. While there is a new 32 bits version, and Adobe advises users to use the 32 bits version of Firefox instead.
Was wondering, as I didn't have to do that yet, is it that hard to port an application to 64 bits? Besides the libraries changes and the recompilation (settings in the Makefile), what makes the port difficult? (Flash is an example)
As noted in an Adobe blog post, Flash's ActionScript engine has a JIT compiler, that compiles the ActionScript code into native code.
x64 has a very different instruction set from x86. Therefore, making the JIT compiler generate x64 code is a non-trivial task, and is far more complicated than just making all the words 64 bits. :-)
The real kicker with porting apps to 64-bit is that every OS seems to treat the primitive types as they please. For example, under most linux environments a long is 4 bytes on a 32 bit system and 8 bytes on a 64 bit system (32bit=4bytes 64bit=8bytes.) Meanwhile, the int stays 4 bytes across 64bit and 32 bit systems. Under windows, the opposite seems to be true, the long stays consistently 4 bytes while the int switches between 32 and 64 bit.
That said, I have ported a medium sized project at work before from 32 bit to 64 bit linux (about 25,000 lines of code) only having to make changes in the the assembly code (GASM) which made several faulty assumptions about datatypes being 4 bytes long. Other than this, I had no problems, which suggests that provided you payed strict attention to your data types when you were first developing, porting should be seemless, perhaps only requiring certain compile switches be changed (like -fpic.) There were a few really bizzare corner cases that came up in my porting experience but I think they were mostly due to undefined behaviour of some GASM more than the porting itself.
If you use a lot of ints and floats, it can be amazingly complex to get it to work suitably, esp. if it is a networked app.
It took over 2 years to port xMule to 64 bits and I don't believe its parent project, eMule, has 64 bit at all.
Ideally it should be a recompilation, in reality it takes a significant amount of effort. Even if it is simple there still has to be a full sweep by the QA team to prove it works and that always takes a while.
The obvious problems I guess would be variable sizes (e.g. longs are 64 bits on most 64 bit compilers), this messes up anything that uses size related operations such as bit shifting / some pointer arithmetic. I think adobe just can't be be bothered to scan through and ensure cross compatibility. Especially when 90%+ of browser use is on 32bit versions, I know flash hasn't ever worked on the 64bit IE but even 64bit Windows 7 defaults to the 32-bit version.
Lot of information on it here if your interested:
http://www.viva64.com/content/articles/64-bit-development/?f=20_issues_of_porting_C++_code_on_the_64-bit_platform.html&lang=en&content=64-bit-development
the coding part of porting to 64bits generally isn't that hard, but can require some time and a lot of hairpulling regarding builds/libs etc. however, the real problem, especially for a widely deployed project like flash is going through the proper testing coverage to cover the many code paths and platforms. 64bit is a horizontal feature, so it can possibly break everything, so everything needs to be tested.
for flash on linux in particular, its probably more of a cost-benefit issue. is catering to the percentage of users actually use linux and 64bit worth the development costs for adobe? probably not, at this point.

Resources