Summary: | [bsd.cpu.mk] [patch] Add note about the 'native' mtune option | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | Scot Hetzel <swhetzel> | ||||||||
Component: | misc | Assignee: | freebsd-bugs (Nobody) <bugs> | ||||||||
Status: | Open --- | ||||||||||
Severity: | Affects Only Me | Keywords: | patch | ||||||||
Priority: | Normal | ||||||||||
Version: | 7.0-CURRENT | ||||||||||
Hardware: | Any | ||||||||||
OS: | Any | ||||||||||
Attachments: |
|
Description
Scot Hetzel
2007-05-25 16:20:02 UTC
The patch has one error, remove the second '-e' from the sed command. [linimon note: I have gone ahead and done this in the above code] -- DISCLAIMER: No electrons were mamed while sending this message. Only slightly bruised. I found another solution to this problem by patching share/mk/bsd.cpu.mk. This patch adds code to share/mk/bsd.cpu.mk which uses gcc to change the 'native' cpu_type to the a CPUTYPE that can be used to set the correct MACHINE_CPU. Scot -- DISCLAIMER: No electrons were mamed while sending this message. Only slightly bruised. Hello, The attached patch was unreadable, can you perhaps copy paste it in, or attach it as .txt file? Thanks! -- Kind regards, Remko Lodder ** remko@elvandar.org FreeBSD ** remko@FreeBSD.org /* Quis custodiet ipsos custodes */ On 8/28/07, Remko Lodder <remko@freebsd.org> wrote: > > Hello, > > The attached patch was unreadable, can you perhaps copy paste it in, or > attach it as .txt file? > I have to remember to add .txt when sending patches thru gmail. Scot On 8/28/07, Scot Hetzel <swhetzel@gmail.com> wrote: > On 8/28/07, Remko Lodder <remko@freebsd.org> wrote: > > > > Hello, > > > > The attached patch was unreadable, can you perhaps copy paste it in, or > > attach it as .txt file? > > > I have to remember to add .txt when sending patches thru gmail. > I give up, no ideal as to why gnats/gmail is converting the attachment to base64 encoding, the patch is available in this post: http://lists.freebsd.org/pipermail/freebsd-current/2007-August/076503.html Scot -- DISCLAIMER: No electrons were mamed while sending this message. Only slightly bruised. I disagree, native and ${YOUR_CPU} aren't equivalent. Here is what I get on gcc45 + core2@amd64 system: $ cc -E -v -march=core2 - </dev/null |& fgrep cc1 .../cc1 -E -quiet -v - -march=core2 $ cc -E -v -mtune=core2 - </dev/null |& fgrep cc1 .../cc1 -E -quiet -v - -mtune=core2 -march=x86-64 $ cc -E -v -march=native - </dev/null |& fgrep cc1 .../cc1 -E -quiet -v - -march=core2 -mcx16 -msahf -msse4.1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=6144 -mtune=core2 $ cc -E -v -mtune=native - </dev/null |& fgrep cc1 .../cc1 -E -quiet -v - --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=6144 -mtune=core2 -march=x86-64 And bsd.cpu.mk is oblivious about gcc43+. It will degrade native to nocona even though core2 is supported. Good example that overriding CPUTYPE is bad idea. Better leave CPUTYPE as is and populate MACHINE_CPU directly, smth like $ cat a.mk CPUTYPE = ${MACHINE_ARCH} MACHINE_CPU != echo ${MACHINE_ARCH}; ${CC} -E -dM -v -march=${CPUTYPE:S/amd64/x86-64/:S/i386/i486/} - </dev/null 2>&1 \ | awk '/SSE|MMX/ && !/MATH/ { FS="__"; gsub("_",".",$$2); print tolower($$2) }' $ make -f a.mk -V MACHINE_CPU amd64 mmx sse2 sse $ make -f a.mk -V MACHINE_CPU CPUTYPE=native amd64 sse4.1 mmx sse2 ssse3 sse sse3 $ make -f a.mk -V MACHINE_CPU CPUTYPE=native CC=/usr/bin/cc amd64 mmx sse sse2 sse3 It is very inefficient to invoke gcc, grep, and/or awk every time this makefile is processed. (In the past, we've gone to a great deal of trouble to avoid this kind of thing: http://lists.freebsd.org/pipermail/freebsd-ports/2008-July/049777.html http://lists.freebsd.org/pipermail/cvs-ports/2008-July/153224.html ) Instead, I think that comments in /etc/make.conf instructing users to how to correctly specify their CPUTYPE would be appropriate. The list of overrides for the base system compiler should be expanded, and perhaps relaxed if CC != cc. But _all_ overrides cannot be removed, and MACHINE_CPU cannot be expanded to include all features recognized by compilers from ports, because the kernel lacks the necessary support for things like SSE5/XOP+FMA4+CVT16, LWP, AVX, etc. b. For bugs matching the following criteria: Status: In Progress Changed: (is less than) 2014-06-01 Reset to default assignee and clear in-progress tags. Mail being skipped Keyword: patch or patch-ready – in lieu of summary line prefix: [patch] * bulk change for the keyword * summary lines may be edited manually (not in bulk). Keyword descriptions and search interface: <https://bugs.freebsd.org/bugzilla/describekeywords.cgi> |