Is the difference primarily in the build process, or is it in code as well? Can I download any source package and build it for both 64-bit and 32-bit?
I'm on an OS with so-called "multilib" enabled and this is confusing me. I have been able to download packages for my 64-bit OS and build them under a 32-bit build environment with no problems and I'm not really sure how it's possible.
I'm not sure if those links answer my question. Mainly I just want to know if there's something in source code that says "this is a 64-bit program", or if that is up to the compiler, meaning any program I download can be compiled to work with either 64-bit or 32-bit software.
It helps to know what your talking about. What;s the point of discussing this any further if you don't know what an 8, 16, 32 or 64 bit computer is, or why a computer can simultaneously appear to be more than one?
The compiler just interprets source code. It will generate code for a particular platform, but cannot determine the system calls that are made.
I just want to know if there's something in source code that says "this is a 64-bit program"
Yes.
or if that is up to the compiler
A compiler for a 32 bit system will generate 32 bit code, and a compiler for a 64 bit compiler will generate a 64 bit system. But this is rhetorical and not really helpful, but is the only answer.
The program will be engineered for a particular version of a particular platform. The platform is part of the package specification/description. It is what it is.
My only question is if/how a single piece of software can be compiled to both 32-bit and 64-bit, and whether it is the software or the compiler that decides which it is.