Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Feb 2001 12:50:50 +0100 (CET)
From:      Alexander Leidinger <Alexander@Leidinger.net>
To:        kris@obsecurity.org
Cc:        arch@FreeBSD.ORG
Subject:   Re: cvs commit: src/share/mk sys.mk
Message-ID:  <200102221150.f1MBopF07996@Magelan.Leidinger.net>
In-Reply-To: <20010221123835.A59024@mollari.cthul.hu>

next in thread | previous in thread | raw e-mail | index | archive | help
On 21 Feb, Kris Kennaway wrote:

> .if ${MACHINE_CPU:Mi686}
> CFLAGS += -mpentiumpro
> .elif ${MACHINE_CPU:Mi586}
> CFLAGS += -mpentium
> ...
> .endif
> 
> which may be worthwhile to do.
> 
> The -march statement doesnt matter though, since some binaries built
> with MACHINE_CPU set will already be CPU-specific (e.g. if you specify
> i686 then openssl will use the i686 blowfish code)

You want to use "-mXXX -march=XXX". You are CPU-specific already, no
need to produce parts of code which run on an i386 too.

---snip---
#include <stdio.h>

int main(void)
{
#if defined(__pentiumpro__) || defined(__i686__)
        puts("pentiumpro");
#endif
#if defined(__pentium__) || defined(__i586__)
        puts("pentium");
#endif
        exit(0);
}
---snip---

---snip---
(23) netchild@ttyp0 % rm cputest; CFLAGS=-mpentiumpro gmake cputest; md5 cputest; ./cputest        
cc -mpentiumpro    cputest.c   -o cputest
MD5 (cputest) = 577769bb73460f7bd062882a4ee44235
pentiumpro

(24) netchild@ttyp0 % rm cputest; CFLAGS=-march=pentiumpro gmake cputest; md5 cputest; ./cputest 
cc -march=pentiumpro    cputest.c   -o cputest
MD5 (cputest) = b721209c7b0089ee1442cb0880af06b8

(25) netchild@ttyp0 % rm cputest; CFLAGS="-mpentiumpro -march=pentiumpro" gmake cputest; md5 cputest; ./cputest 
cc -mpentiumpro -march=pentiumpro    cputest.c   -o cputest
MD5 (cputest) = c41ce5e5941b335c6fcf1b6d8d59f2e1
pentiumpro
---snip---

Bye,
Alexander.

-- 
   "One world, one web, one program"  -- Microsoft promotional ad
         "Ein Volk, ein Reich, ein Fuehrer"  -- Adolf Hitler

http://www.Leidinger.net                       Alexander @ Leidinger.net
  GPG fingerprint = C518 BC70 E67F 143F BE91  3365 79E2 9C60 B006 3FE7


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200102221150.f1MBopF07996>