Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

New Computer, what should I install?



Matthew Gillen wrote:
>>From the gcc man page:
>> While picking a specific cpu-type will schedule things appropriately for
>> that particular chip, the compiler will not generate any code that does not
>> run on the i386 without the -march=cpu-type option being used.
> 
> Check the "-mtune=cpu-type" and "march=cpu-type" command line switches.

This is not entirely correct.  I generate code from gcc (amd64) 
targeting i386 all the time using only the -m32 option.  For instance:

administrator at khermans-um64:/tmp$ uname -a
Linux khermans-um64 2.6.20-15-generic #2 SMP Sun Apr 15 06:17:24 UTC 
2007 x86_64 GNU/Linux
administrator at khermans-um64:/tmp$ cat hello.c
#include <stdio.h>

int main() {
   printf("Hello World!\n");
}
administrator at khermans-um64:/tmp$ gcc -o hello64 hello.c
administrator at khermans-um64:/tmp$ file hello64
hello64: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), for 
GNU/Linux 2.6.0, dynamically linked (uses shared libs), not stripped
administrator at khermans-um64:/tmp$ ./hello64
Hello World!
administrator at khermans-um64:/tmp$ gcc -m32 -o hello32 hello.c
administrator at khermans-um64:/tmp$ file hello32
hello32: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for 
GNU/Linux 2.6.0, dynamically linked (uses shared libs), not stripped
administrator at khermans-um64:/tmp$ ./hello32
Hello World!

Any questions?
-- 
Kristian Hermansen

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.







BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org