Re: Intel Makefile Suggestion

Damon Buckwalter (damon@meta-x.net)
Wed, 30 Dec 1998 19:39:53 -0800


This is a multi-part message in MIME format.
--------------1E9F6650B2A84756BA54826C
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Shaw Terwilliger wrote:
>
> While it's not too inconvenient to open up the Makefile and
> alter it to include my options, I wonder how many people
> grab the latest EGCS, do a 3-stage compile with their specific
> optimizations, and end up compiling a kernel for a 486 without
> knowing it. :)

I think the best solution (okay, maybe not, but you're going to hear it
anyway :) is to hack up your 'specs' file for egcs. Drop the
-mwhatever from the kernel Makefiles, and set it up to by default
compile for whatever your computer is (pentium/ppro/486/386).

With the attached 'specs' file, it will, by default compile for
pentiumpro, _but_ can be overridden. e.g. if you specify -m486 it will
use 486 only.

Anyway, I thought it was cool. It works for my humble purposes. And
changing the default architecture to pentium or something else should be
pretty obvious.

--
damon@meta-x.net -- PGP and GPG public keys at http://meta-x.net/keys/
--------------1E9F6650B2A84756BA54826C
Content-Type: text/plain; charset=us-ascii;
 name="specs"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="specs"

*asm: %{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}

*asm_final: %|

*cpp: %(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}

*cc1: %(cc1_cpu) %{profile:-p}

*cc1plus:

*endfile: %{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s

*link: -m elf_i386 %{shared:-shared} %{!shared: %{!ibcs: %{!static: %{rdynamic:-export-dynamic} %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} %{static:-static}}}

*lib: %{shared: -lc} %{!shared: %{mieee-fp:-lieee} %{pthread:-lpthread} %{profile:-lc_p} %{!profile: -lc}}

*libgcc: -lgcc

*startfile: %{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:%{profile:gcrt1.o%s} %{!profile:crt1.o%s}}}} crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}

*switches_need_spaces:

*signed_char: %{funsigned-char:-D__CHAR_UNSIGNED__}

*predefines: -D__ELF__ -Dunix -Di386 -D__i386__ -Dlinux -Asystem(posix)

*cross_compile: 0

*version: egcs-2.91.60

*multilib: . ;

*multilib_defaults:

*multilib_extra:

*multilib_matches:

*linker: collect2

*cpp_486: %{!ansi:-Di486} -D__i486 -D__i486__

*cpp_586: %{!ansi:-Di586 -Dpentium} -D__i586 -D__i586__ -D__pentium -D__pentium__

*cpp_686: %{!ansi:-Di686 -Dpentiumpro} -D__i686 -D__i686__ -D__pentiumpro -D__pentiumpro__

*cpp_cpu_default: %(cpp_686)

*cpp_cpu: -Asystem(unix) -Acpu(i386) -Amachine(i386) %{!ansi:-Di386} -D__i386 -D__i386__ %{mcpu=i486:%(cpp_486)} %{m486:%(cpp_486)} %{mpentium:%(cpp_586)} %{mcpu=pentium:%(cpp_586)} %{mpentiumpro:%(cpp_686)} %{mcpu=pentiumpro:%(cpp_686)} %{!mcpu*:%{!m486:%{!mpentium*:%(cpp_cpu_default)}}}

*cc1_386: -mcpu=i386 -march=i386

*cc1_486: -mcpu=i486 -march=i486

*cc1_586: -mcpu=pentium

*cc1_686: -mcpu=pentiumpro

*cc1_cpu_default: %(cc1_686)

*cc1_cpu: %{!mcpu*: %{m386:%(cc1_386)} %{mno-486:%(cc1_386)} %{m486:%(cc1_486)} %{mno-386:%(cc1_486)} %{mno-pentium:%(cc1_486)} %{mpentium:-mcpu=pentium} %{mno-pentiumpro:%(cc1_586)} %{mpentiumpro:-mcpu=pentiumpro} %{!m486:%{!mpentium*:%(cc1_cpu_default)}}}

--------------1E9F6650B2A84756BA54826C--

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/