From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id DC6CF1396D0 for ; Wed, 6 Sep 2017 03:43:58 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B9FD11FC09E; Wed, 6 Sep 2017 03:43:53 +0000 (UTC) Received: from mail-qk0-x231.google.com (mail-qk0-x231.google.com [IPv6:2607:f8b0:400d:c09::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 694021FC093 for ; Wed, 6 Sep 2017 03:43:53 +0000 (UTC) Received: by mail-qk0-x231.google.com with SMTP id r141so16623176qke.2 for ; Tue, 05 Sep 2017 20:43:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=F68d6IKoWClXahNCtRypJVVgEVmOlmcaP2HX/F3BBI4=; b=lmUoUPhZBJJ0+K7uJ3/bJXUZMaDE6/SbHlnl9JgIYVVs0eu56xJTVUn6hy42ChYlss 71VcPWkWLtWy00imM83TNLFxn0qlW2Ul372XuBCqLBOfnI3U/CmAEPF4Q0OSVB5lDE0O oRZFnLWEl91olmVpJEti0fZ4wJjM+FKBN+rfnlaO6qch9+7bFHomBj/+pl2Ww+DZCcwY 5w9fsJ+WZcVSq7uYVccUe0FxFxSBsoepPYx1tyLr2xWDy+DR96TwEg8Z7hE3Y4dc5HtI TP4RXk3gBYm0AE69jnLvpLc+gEtNapYN+c1J0+n4GPpUtUso9LEWiVv+16pdLpj2II7L eIUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=F68d6IKoWClXahNCtRypJVVgEVmOlmcaP2HX/F3BBI4=; b=S6W4Emmw/to0PVmQVu7vT9U0j4hfRBCClLMWxku1rhQwkDgyCrSZ5+RfVfrMdPjVF+ uceRprXq616PgDgfg01m6JnoGtK6mrppRqlojGJK193SNVXy7RsgOPSG9A3jNnPx7Sd0 0XwalYvl+PHUDAcS5NyUoyoO1K0Y40YeBaAvsJpMsBsjNMT6skFBobtPWy5xSJ4cUgV3 m7gq5K/GPV6LwTRaCQJPBDmzSDqzsiQJAgf65VOlWVHNcnX5/Gu+X3SFXmZuHIJla3G0 UJUPEr3dJCXk9frR+Qz5p9G3SKQTgpKrxnvmgB52l5Y5VufgxH1k+BPacp4+Ez15vsFh Bpaw== X-Gm-Message-State: AHPjjUi64Xf2dSxSobROXoXnkfSKBF0I3Ryv/hRRSJfQG3LtYefRTqiO rn0mjppdg7WvqUmwsRQ3cxJqPAsXHovK X-Google-Smtp-Source: ADKCNb4mPMJGEc33YFXK+STwADXpznlTDMjC66OjFpd9jBysKLxS8BQr6Jb8kptJi/3+ghtext2k5beKjec6fS28BEE= X-Received: by 10.55.201.16 with SMTP id q16mr1574094qki.330.1504669432532; Tue, 05 Sep 2017 20:43:52 -0700 (PDT) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Received: by 10.140.93.65 with HTTP; Tue, 5 Sep 2017 20:43:52 -0700 (PDT) In-Reply-To: References: <20170905083727.GA23751@waltdnes.org> From: Grant Date: Tue, 5 Sep 2017 20:43:52 -0700 Message-ID: Subject: Re: [gentoo-user] Lowest common denominator compile To: Gentoo mailing list Content-Type: text/plain; charset="UTF-8" X-Archives-Salt: e85be3e9-465a-4f30-ac1f-355dc6e5df3d X-Archives-Hash: cefbe9a0a22bad27cac5769fbc3050d4 >>>>> Now I'm running into "trap invalid opcode" errors on the older >>>>> systems. Can I disable some of the newer CPU instruction sets on the >>>>> master laptop when compiling to hopefully generate binaries that will >>>>> work on the older systems? >>>> >>>> Yes. You need to find out CPU_FLAGS_X86 and "-march=" values the >>>> machines have, and use that in make.conf. Run the commands... >>>> >>>> cpuinfo2cpuflags-x86 >>>> gcc -c -Q -march=native --help=target | grep march= >>>> >>>> ...on the target machines. This will tell you what "native" is and >>>> what CPU_FLAGS_X86 values to use. >>>> >>>> https://gcc.gnu.org/onlinedocs/gcc-6.3.0/gcc/x86-Options.html#x86-Options >>>> lists available "march=" options, and what instruction sets they support. >>>> E.g. my old core2 desktop shows... >>>> >>>> [d531][waltdnes][~] cpuinfo2cpuflags-x86 >>>> CPU_FLAGS_X86="mmx mmxext sse sse2 sse3 ssse3" >>>> >>>> [d531][waltdnes][~] gcc -c -Q -march=native --help=target | grep march= >>>> -march= core2 >>>> >>>> >>>> Unless the laptops are really old, you can probably get away with... >>>> CFLAGS="-O2 march=core2 -mfpmath=sse -fopenmp -fomit-frame-pointer -pipe -fno-unwind-tables -fno-asynchronous-unwind-tables" >>>> >>>> booby trap 1) Unless all machines are Intel "Atom" family, do *NOT* use >>>> a "march=" that implements the "movbe" instruction. >>>> >>>> booby trap 2) If you throw in any AMD-based machines proceed with care. >>>> >>>> Can you post the output of... >>>> gcc -c -Q -march=native --help=target | grep march= >>>> ...for all the target machines? >>> >>> >>> Let's see how -mtune=native goes and resort to the above if necessary. >>> It doesn't look too bad though. >> >> >> emerge -e world has finished and pushed and -mtune=native seems to >> have solved the issue for now. >> > > You might be interested in "-march=x86-64 -mtune=generic" though this > will mean you might miss out on some optimizations. If I could miss out on optimizations, what is the advantage compared to -mtune=native? Better compatibility across CPUs? - Grant