Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[GCC] Compiling for a generic x86 Architecture

2 views
Skip to first unread message

Mario

unread,
Jun 4, 2010, 2:06:58 PM6/4/10
to
Hi,
I wrote a simple C program, and I need it to run on a generic x86 machine,
in other words I do not need an executable optimized for my processor but
for the most common processors.

- what specific options should I pass to GCC for this purpuse?

Looking at GCC manual I found the -mtune=generic option,

- What does this option exactly do? Do it mean -mtune=i386 or there are
some differences?

Seebs

unread,
Jun 4, 2010, 2:44:05 PM6/4/10
to
On 2010-06-04, Mario <mari...@gmail.com> wrote:
> - what specific options should I pass to GCC for this purpuse?

The options the friendly people in the GCC help newsgroup would point you
at. This question is entirely about a compiler, and unrelated to the C
language.

Hint:

* The answer will be *IDENTICAL* for C++ or Objective-C.
* The answer will be *UNRELATED* for any other C compiler.

That's a big clue that this has nothing to do with the language. (And
no, I don't have high confidence that you'll get a good answer here, since
gcc options are something about which a very large number of developers
have unsupportable superstitions.)

I'd point out that what you want is generally impossible, though. At the
very least, you have to pick a target operating system and C library and
so on, and by the time you've gotten that far, you're probably excluding
thousands of platforms.

-s
--
Copyright 2010, all wrongs reversed. Peter Seebach / usenet...@seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!

0 new messages