Re: -ffast-math in Ports and wrong generated code

2012-04-04 Thread Andrey Simonenko
On Wed, Apr 04, 2012 at 09:45:25AM -0500, Pedro Giffuni wrote:
> On 04/04/12 04:29, Andrey Simonenko wrote:
> > On Tue, Apr 03, 2012 at 06:43:00AM -0700, Steve Kargl wrote:
> >> On Tue, Apr 03, 2012 at 02:21:11PM +0300, Andrey Simonenko wrote:
> >>> I use one port from the Ports Collection, that works with FP.  Having
> >>> reinstalled it (its version was not changed) I noticed that it started
> >>> to work incorrectly.  After debugging and disassembling its code I found
> >>> out that the -ffast-math option used for building was the result of
> >>> wrongly generated code (I did not specify this option in /etc/make.conf).
> >>>
> >>> At least finite() function call was eliminated from the result Assembler
> >>> code when -ffast-math option is used, tested on 9.0-STABLE and 
> >>> 10.0-CURRENT.
> >>>
> >>> Example test source code and generated code under 9.0-STABLE on amd64
> >>> by gcc from the base system:
> >>>
> >>> -
> >>> #include
> >>> #include
> >>>
> >>> void
> >>> check_finite(double x)
> >>> {
> >>>   printf("%d\n", finite(x));
> >>> }
> >>> -
> >>>
> >>> % gcc -Wall -O2 -S finite.c
> >>> -
> >>> check_finite:
> >>> .LFB3:
> >>>   subq$8, %rsp
> >>> .LCFI0:
> >>>   callfinite  <-- call to finite()
> >>>   movl$.LC0, %edi
> >>>   movl%eax, %esi
> >>>   addq$8, %rsp
> >>>   xorl%eax, %eax
> >>>   jmp printf
> >>> .LFE3:
> >>>   .size   check_finite, .-check_finite
> >>> -
> >>>
> >>> % gcc -Wall -O2 -ffast-math -S finite.c
> >>> -
> >>> check_finite:
> >>> .LFB3:
> >>>   xorl%esi, %esi  <-- fake result from finite()
> >>>   movl$.LC0, %edi
> >>>   xorl%eax, %eax
> >>>   jmp printf
> >>> .LFE3:
> >>>   .size   check_finite, .-check_finite
> >>> -
> >>>
> >>> Can somebody comment this?
> >> Read the man page for gcc.  With --fast-math,
> >> gcc assumes that the result of any FP operation
> >> is finite.  So, the function call to finite()
> >> is eliminated as it is always true.
> > Looks like that I was misunderstood.  I did not ask why finite() was
> > eliminated, I asked why fake result from finite() is wrong.  Obviously
> > that -ffast-math can optimize FP arithmetics and as a result some functions
> > can be eliminated.  The problem is not respecting IEEE specifications for
> > FP, the problem is wrongly generated code when -ffast-math is used.
> >
> > Actually there is a bug in GCC used in the base system.  There was made
> > a change to builtins.c from gcc in revision 1.12 [1] and as a result gcc
> > started to eliminate finite() function calls with -ffinite-math-only.
> >
> > ...
> >
> > After this change the corresponding Assembler code for my test file is:
> >
> > % gcc -Wall -O2 -ffast-math -S finite.c
> > -
> > check_finite:
> > .LFB3:
> > movl$1, %esi<-- fake result from finite()
> > movl$.LC0, %edi
> > xorl%eax, %eax
> > jmp printf
> > .LFE3:
> > .size   check_finite, .-check_finite
> > -
> >
> > What do you think?  If there is no objections, I'll create PR.
> >
> > [1] 
> > http://www.freebsd.org/cgi/cvsweb.cgi/src/contrib/gcc/builtins.c.diff?r1=1.11;r2=1.12
> > ___
> 
> The SVN commit
> 
> http://svnweb.freebsd.org/base?view=revision&revision=228756
> 
> will point you to this:
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28796
> 
> and we are keeping consistency with both upstream and Apple's gcc.

Well, I've found exact commit to upstream gcc source tree that
corrects the bug described above:

http://gcc.gnu.org/viewcvs/trunk/gcc/builtins.c?r1=117751&r2=117929

I think that nobody even tried to run my test program, so I'll post
here results from my system (I did not post this test before just to
make the post brief):

% uname -omr
FreeBSD 9.0-STABLE amd64

% cc -v
Using built-in specs.
Target: amd64-undermydesk-freebsd
Configured with: FreeBSD/amd64 system compiler
Thread model: posix
gcc version 4.2.1 20070831 patched [FreeBSD]

% cat finite.c
#include 
#include 

void
check_finite(double x)
{
printf(" %d ", finite(x));
}

int
main(void)
{
double x;

for (x = -2; x < 2; x += 0.5) {
printf("%.1f", x);
check_finite(x);
}
printf("\n");
return (0);
}

% cc -Wall -O2 finite.c -lm
% ./a.out
-2.0 1 -1.5 1 -1.0 1 -0.5 1 0.0 1 0.5 1 1.0 1 1.5 1 

% cc -Wall -O2 -ffinite-math-only finite.c -lm
% ./a.out
-2.0 0 -1.5 0 -1.0 0 -0.5 0 0.0 0 0.5 0 1.0 0 1.5 0 

Should not both results be the same?
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


contrib/jemalloc

2012-04-04 Thread Jason Evans
I have the current version of jemalloc integrated into libc as contrib/jemalloc:

http://people.freebsd.org/~jasone/patches/jemalloc_20120404b.patch

This is the first update to FreeBSD's jemalloc in over two years, and the 
differences are huge (faster, better introspection, hopefully fewer bugs).  
This has been stable for me across numerous buildworld/installworld iterations, 
as well as when running several benchmarks.  There's a bugfix to openpam in the 
patch that des says will be obsoleted by the next vendor import, so I'm 
planning to let that settle before committing.  In the meanwhile, I'm hoping 
for some review sanity checks on the following aspects of the patch:

* Are the symbol versioning specifications right, and are the compatibility 
symbols for _malloc_options and _malloc_message workable?

* Is it acceptable to check this in directly to trunk without using a vendor 
branch?  For the import workflow I have planned, a vendor branch would just be 
extra work with no benefit that I can see.

* Is the light editing of the jemalloc manual page sufficient?  Keeping the 
changes minimal will make regular imports less work, but the result is less 
tailored to FreeBSD.

* Will the utrace feature be missed?  I removed it some time ago, mainly 
because traces are impossibly large for most real-world use cases.

Thanks,
Jason___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


[head tinderbox] failure on amd64/amd64

2012-04-04 Thread FreeBSD Tinderbox
TB --- 2012-04-04 22:40:00 - tinderbox 2.9 running on freebsd-current.sentex.ca
TB --- 2012-04-04 22:40:00 - starting HEAD tinderbox run for amd64/amd64
TB --- 2012-04-04 22:40:00 - cleaning the object tree
TB --- 2012-04-04 22:40:00 - cvsupping the source tree
TB --- 2012-04-04 22:40:00 - /usr/bin/csup -z -r 3 -g -L 1 -h cvsup.sentex.ca 
/tinderbox/HEAD/amd64/amd64/supfile
TB --- 2012-04-04 22:42:15 - building world
TB --- 2012-04-04 22:42:15 - CROSS_BUILD_TESTING=YES
TB --- 2012-04-04 22:42:15 - MAKEOBJDIRPREFIX=/obj
TB --- 2012-04-04 22:42:15 - PATH=/usr/bin:/usr/sbin:/bin:/sbin
TB --- 2012-04-04 22:42:15 - SRCCONF=/dev/null
TB --- 2012-04-04 22:42:15 - TARGET=amd64
TB --- 2012-04-04 22:42:15 - TARGET_ARCH=amd64
TB --- 2012-04-04 22:42:15 - TZ=UTC
TB --- 2012-04-04 22:42:15 - __MAKE_CONF=/dev/null
TB --- 2012-04-04 22:42:15 - cd /src
TB --- 2012-04-04 22:42:15 - /usr/bin/make -B buildworld
>>> World build started on Wed Apr  4 22:42:16 UTC 2012
>>> Rebuilding the temporary build tree
>>> stage 1.1: legacy release compatibility shims
>>> stage 1.2: bootstrap tools
>>> stage 2.1: cleaning up the object tree
>>> stage 2.2: rebuilding the object tree
>>> stage 2.3: build tools
>>> stage 3: cross tools
>>> stage 4.1: building includes
>>> stage 4.2: building libraries
>>> stage 4.3: make dependencies
>>> stage 4.4: building everything
>>> stage 5.1: building 32 bit shim libraries
>>> World build completed on Thu Apr  5 01:33:41 UTC 2012
TB --- 2012-04-05 01:33:41 - generating LINT kernel config
TB --- 2012-04-05 01:33:41 - cd /src/sys/amd64/conf
TB --- 2012-04-05 01:33:41 - /usr/bin/make -B LINT
TB --- 2012-04-05 01:33:41 - cd /src/sys/amd64/conf
TB --- 2012-04-05 01:33:41 - /usr/sbin/config -m LINT
TB --- 2012-04-05 01:33:41 - building LINT kernel
TB --- 2012-04-05 01:33:41 - CROSS_BUILD_TESTING=YES
TB --- 2012-04-05 01:33:41 - MAKEOBJDIRPREFIX=/obj
TB --- 2012-04-05 01:33:41 - PATH=/usr/bin:/usr/sbin:/bin:/sbin
TB --- 2012-04-05 01:33:41 - SRCCONF=/dev/null
TB --- 2012-04-05 01:33:41 - TARGET=amd64
TB --- 2012-04-05 01:33:41 - TARGET_ARCH=amd64
TB --- 2012-04-05 01:33:41 - TZ=UTC
TB --- 2012-04-05 01:33:41 - __MAKE_CONF=/dev/null
TB --- 2012-04-05 01:33:41 - cd /src
TB --- 2012-04-05 01:33:41 - /usr/bin/make -B buildkernel KERNCONF=LINT
>>> Kernel build for LINT started on Thu Apr  5 01:33:41 UTC 2012
>>> stage 1: configuring the kernel
>>> stage 2.1: cleaning up the object tree
>>> stage 2.2: rebuilding the object tree
>>> stage 2.3: build tools
>>> stage 3.1: making dependencies
>>> stage 3.2: building everything
>>> Kernel build for LINT completed on Thu Apr  5 02:05:54 UTC 2012
TB --- 2012-04-05 02:05:54 - cd /src/sys/amd64/conf
TB --- 2012-04-05 02:05:54 - /usr/sbin/config -m LINT-NOINET
TB --- 2012-04-05 02:05:54 - building LINT-NOINET kernel
TB --- 2012-04-05 02:05:54 - CROSS_BUILD_TESTING=YES
TB --- 2012-04-05 02:05:54 - MAKEOBJDIRPREFIX=/obj
TB --- 2012-04-05 02:05:54 - PATH=/usr/bin:/usr/sbin:/bin:/sbin
TB --- 2012-04-05 02:05:54 - SRCCONF=/dev/null
TB --- 2012-04-05 02:05:54 - TARGET=amd64
TB --- 2012-04-05 02:05:54 - TARGET_ARCH=amd64
TB --- 2012-04-05 02:05:54 - TZ=UTC
TB --- 2012-04-05 02:05:54 - __MAKE_CONF=/dev/null
TB --- 2012-04-05 02:05:54 - cd /src
TB --- 2012-04-05 02:05:54 - /usr/bin/make -B buildkernel KERNCONF=LINT-NOINET
>>> Kernel build for LINT-NOINET started on Thu Apr  5 02:05:55 UTC 2012
>>> stage 1: configuring the kernel
>>> stage 2.1: cleaning up the object tree
>>> stage 2.2: rebuilding the object tree
>>> stage 2.3: build tools
>>> stage 3.1: making dependencies
>>> stage 3.2: building everything
>>> Kernel build for LINT-NOINET completed on Thu Apr  5 02:35:41 UTC 2012
TB --- 2012-04-05 02:35:41 - cd /src/sys/amd64/conf
TB --- 2012-04-05 02:35:41 - /usr/sbin/config -m LINT-NOINET6
TB --- 2012-04-05 02:35:41 - building LINT-NOINET6 kernel
TB --- 2012-04-05 02:35:41 - CROSS_BUILD_TESTING=YES
TB --- 2012-04-05 02:35:41 - MAKEOBJDIRPREFIX=/obj
TB --- 2012-04-05 02:35:41 - PATH=/usr/bin:/usr/sbin:/bin:/sbin
TB --- 2012-04-05 02:35:41 - SRCCONF=/dev/null
TB --- 2012-04-05 02:35:41 - TARGET=amd64
TB --- 2012-04-05 02:35:41 - TARGET_ARCH=amd64
TB --- 2012-04-05 02:35:41 - TZ=UTC
TB --- 2012-04-05 02:35:41 - __MAKE_CONF=/dev/null
TB --- 2012-04-05 02:35:41 - cd /src
TB --- 2012-04-05 02:35:41 - /usr/bin/make -B buildkernel KERNCONF=LINT-NOINET6
>>> Kernel build for LINT-NOINET6 started on Thu Apr  5 02:35:41 UTC 2012
>>> stage 1: configuring the kernel
>>> stage 2.1: cleaning up the object tree
>>> stage 2.2: rebuilding the object tree
>>> stage 2.3: build tools
>>> stage 3.1: making dependencies
>>> stage 3.2: building everything
>>> Kernel build for LINT-NOINET6 completed on Thu Apr  5 03:05:13 UTC 2012
TB --- 2012-04-05 03:05:13 - cd /src/sys/amd64/conf
TB --- 2012-04-05 03:05:13 - /usr/sbin/config -m LINT-NOIP
TB --- 2012-04-05 03:05:13 - building LINT-NOIP kernel
TB --- 2012-04-05 03:05:13 - CROSS_BUILD_TESTING=YES
TB --- 2012-04-05 03:05:13 - MAKEOBJDIRPREFIX=/obj
TB --- 20

[head tinderbox] failure on i386/i386

2012-04-04 Thread FreeBSD Tinderbox
TB --- 2012-04-04 22:40:00 - tinderbox 2.9 running on freebsd-current.sentex.ca
TB --- 2012-04-04 22:40:00 - starting HEAD tinderbox run for i386/i386
TB --- 2012-04-04 22:40:00 - cleaning the object tree
TB --- 2012-04-04 22:40:00 - cvsupping the source tree
TB --- 2012-04-04 22:40:00 - /usr/bin/csup -z -r 3 -g -L 1 -h cvsup.sentex.ca 
/tinderbox/HEAD/i386/i386/supfile
TB --- 2012-04-04 22:42:03 - building world
TB --- 2012-04-04 22:42:03 - CROSS_BUILD_TESTING=YES
TB --- 2012-04-04 22:42:03 - MAKEOBJDIRPREFIX=/obj
TB --- 2012-04-04 22:42:03 - PATH=/usr/bin:/usr/sbin:/bin:/sbin
TB --- 2012-04-04 22:42:03 - SRCCONF=/dev/null
TB --- 2012-04-04 22:42:03 - TARGET=i386
TB --- 2012-04-04 22:42:03 - TARGET_ARCH=i386
TB --- 2012-04-04 22:42:03 - TZ=UTC
TB --- 2012-04-04 22:42:03 - __MAKE_CONF=/dev/null
TB --- 2012-04-04 22:42:03 - cd /src
TB --- 2012-04-04 22:42:03 - /usr/bin/make -B buildworld
>>> World build started on Wed Apr  4 22:42:04 UTC 2012
>>> Rebuilding the temporary build tree
>>> stage 1.1: legacy release compatibility shims
>>> stage 1.2: bootstrap tools
>>> stage 2.1: cleaning up the object tree
>>> stage 2.2: rebuilding the object tree
>>> stage 2.3: build tools
>>> stage 3: cross tools
>>> stage 4.1: building includes
>>> stage 4.2: building libraries
>>> stage 4.3: make dependencies
>>> stage 4.4: building everything
>>> World build completed on Thu Apr  5 00:57:49 UTC 2012
TB --- 2012-04-05 00:57:49 - generating LINT kernel config
TB --- 2012-04-05 00:57:49 - cd /src/sys/i386/conf
TB --- 2012-04-05 00:57:49 - /usr/bin/make -B LINT
TB --- 2012-04-05 00:57:50 - cd /src/sys/i386/conf
TB --- 2012-04-05 00:57:50 - /usr/sbin/config -m LINT
TB --- 2012-04-05 00:57:50 - building LINT kernel
TB --- 2012-04-05 00:57:50 - CROSS_BUILD_TESTING=YES
TB --- 2012-04-05 00:57:50 - MAKEOBJDIRPREFIX=/obj
TB --- 2012-04-05 00:57:50 - PATH=/usr/bin:/usr/sbin:/bin:/sbin
TB --- 2012-04-05 00:57:50 - SRCCONF=/dev/null
TB --- 2012-04-05 00:57:50 - TARGET=i386
TB --- 2012-04-05 00:57:50 - TARGET_ARCH=i386
TB --- 2012-04-05 00:57:50 - TZ=UTC
TB --- 2012-04-05 00:57:50 - __MAKE_CONF=/dev/null
TB --- 2012-04-05 00:57:50 - cd /src
TB --- 2012-04-05 00:57:50 - /usr/bin/make -B buildkernel KERNCONF=LINT
>>> Kernel build for LINT started on Thu Apr  5 00:57:50 UTC 2012
>>> stage 1: configuring the kernel
>>> stage 2.1: cleaning up the object tree
>>> stage 2.2: rebuilding the object tree
>>> stage 2.3: build tools
>>> stage 3.1: making dependencies
>>> stage 3.2: building everything
>>> Kernel build for LINT completed on Thu Apr  5 01:32:53 UTC 2012
TB --- 2012-04-05 01:32:53 - cd /src/sys/i386/conf
TB --- 2012-04-05 01:32:53 - /usr/sbin/config -m LINT-NOINET
TB --- 2012-04-05 01:32:53 - building LINT-NOINET kernel
TB --- 2012-04-05 01:32:53 - CROSS_BUILD_TESTING=YES
TB --- 2012-04-05 01:32:53 - MAKEOBJDIRPREFIX=/obj
TB --- 2012-04-05 01:32:53 - PATH=/usr/bin:/usr/sbin:/bin:/sbin
TB --- 2012-04-05 01:32:53 - SRCCONF=/dev/null
TB --- 2012-04-05 01:32:53 - TARGET=i386
TB --- 2012-04-05 01:32:53 - TARGET_ARCH=i386
TB --- 2012-04-05 01:32:53 - TZ=UTC
TB --- 2012-04-05 01:32:53 - __MAKE_CONF=/dev/null
TB --- 2012-04-05 01:32:53 - cd /src
TB --- 2012-04-05 01:32:53 - /usr/bin/make -B buildkernel KERNCONF=LINT-NOINET
>>> Kernel build for LINT-NOINET started on Thu Apr  5 01:32:53 UTC 2012
>>> stage 1: configuring the kernel
>>> stage 2.1: cleaning up the object tree
>>> stage 2.2: rebuilding the object tree
>>> stage 2.3: build tools
>>> stage 3.1: making dependencies
>>> stage 3.2: building everything
>>> Kernel build for LINT-NOINET completed on Thu Apr  5 02:04:49 UTC 2012
TB --- 2012-04-05 02:04:49 - cd /src/sys/i386/conf
TB --- 2012-04-05 02:04:49 - /usr/sbin/config -m LINT-NOINET6
TB --- 2012-04-05 02:04:50 - building LINT-NOINET6 kernel
TB --- 2012-04-05 02:04:50 - CROSS_BUILD_TESTING=YES
TB --- 2012-04-05 02:04:50 - MAKEOBJDIRPREFIX=/obj
TB --- 2012-04-05 02:04:50 - PATH=/usr/bin:/usr/sbin:/bin:/sbin
TB --- 2012-04-05 02:04:50 - SRCCONF=/dev/null
TB --- 2012-04-05 02:04:50 - TARGET=i386
TB --- 2012-04-05 02:04:50 - TARGET_ARCH=i386
TB --- 2012-04-05 02:04:50 - TZ=UTC
TB --- 2012-04-05 02:04:50 - __MAKE_CONF=/dev/null
TB --- 2012-04-05 02:04:50 - cd /src
TB --- 2012-04-05 02:04:50 - /usr/bin/make -B buildkernel KERNCONF=LINT-NOINET6
>>> Kernel build for LINT-NOINET6 started on Thu Apr  5 02:04:50 UTC 2012
>>> stage 1: configuring the kernel
>>> stage 2.1: cleaning up the object tree
>>> stage 2.2: rebuilding the object tree
>>> stage 2.3: build tools
>>> stage 3.1: making dependencies
>>> stage 3.2: building everything
>>> Kernel build for LINT-NOINET6 completed on Thu Apr  5 02:36:02 UTC 2012
TB --- 2012-04-05 02:36:02 - cd /src/sys/i386/conf
TB --- 2012-04-05 02:36:02 - /usr/sbin/config -m LINT-NOIP
TB --- 2012-04-05 02:36:02 - building LINT-NOIP kernel
TB --- 2012-04-05 02:36:02 - CROSS_BUILD_TESTING=YES
TB --- 2012-04-05 02:36:02 - MAKEOBJDIRPREFIX=/obj
TB --- 2012-04-05 02:36:02 - PATH=/usr/bin:/usr/sbin:/bin:/sbin
TB --- 2

[head tinderbox] failure on mips/mips

2012-04-04 Thread FreeBSD Tinderbox
TB --- 2012-04-05 01:52:30 - tinderbox 2.9 running on freebsd-current.sentex.ca
TB --- 2012-04-05 01:52:30 - starting HEAD tinderbox run for mips/mips
TB --- 2012-04-05 01:52:30 - cleaning the object tree
TB --- 2012-04-05 01:53:11 - cvsupping the source tree
TB --- 2012-04-05 01:53:11 - /usr/bin/csup -z -r 3 -g -L 1 -h cvsup.sentex.ca 
/tinderbox/HEAD/mips/mips/supfile
TB --- 2012-04-05 01:53:55 - building world
TB --- 2012-04-05 01:53:55 - CROSS_BUILD_TESTING=YES
TB --- 2012-04-05 01:53:55 - MAKEOBJDIRPREFIX=/obj
TB --- 2012-04-05 01:53:55 - PATH=/usr/bin:/usr/sbin:/bin:/sbin
TB --- 2012-04-05 01:53:55 - SRCCONF=/dev/null
TB --- 2012-04-05 01:53:55 - TARGET=mips
TB --- 2012-04-05 01:53:55 - TARGET_ARCH=mips
TB --- 2012-04-05 01:53:55 - TZ=UTC
TB --- 2012-04-05 01:53:55 - __MAKE_CONF=/dev/null
TB --- 2012-04-05 01:53:55 - cd /src
TB --- 2012-04-05 01:53:55 - /usr/bin/make -B buildworld
>>> World build started on Thu Apr  5 01:53:56 UTC 2012
>>> Rebuilding the temporary build tree
>>> stage 1.1: legacy release compatibility shims
>>> stage 1.2: bootstrap tools
>>> stage 2.1: cleaning up the object tree
>>> stage 2.2: rebuilding the object tree
>>> stage 2.3: build tools
>>> stage 3: cross tools
>>> stage 4.1: building includes
>>> stage 4.2: building libraries
>>> stage 4.3: make dependencies
>>> stage 4.4: building everything
[...]
cc -O -pipe -G0  -I/src/kerberos5/libexec/kfd/../../../crypto/heimdal/lib/asn1  
-I/src/kerberos5/libexec/kfd/../../../crypto/heimdal/lib/roken -DHAVE_CONFIG_H 
-I/src/kerberos5/libexec/kfd/../../include -std=gnu99  -c 
/src/kerberos5/libexec/kfd/../../../crypto/heimdal/appl/kf/kfd.c
cc -O -pipe -G0  -I/src/kerberos5/libexec/kfd/../../../crypto/heimdal/lib/asn1  
-I/src/kerberos5/libexec/kfd/../../../crypto/heimdal/lib/roken -DHAVE_CONFIG_H 
-I/src/kerberos5/libexec/kfd/../../include -std=gnu99   -o kfd kfd.o -lkrb5 
-lroken -lasn1 -lcrypto -lcrypt  
/obj/mips.mips/src/kerberos5/libexec/kfd/../../lib/libvers/libvers.a
gzip -cn /src/kerberos5/libexec/kfd/../../../crypto/heimdal/appl/kf/kfd.8 > 
kfd.8.gz
===> kerberos5/libexec/kimpersonate (all)
cc -O -pipe -G0  
-I/src/kerberos5/libexec/kimpersonate/../../../crypto/heimdal/lib/hx509  
-I/src/kerberos5/libexec/kimpersonate/../../../crypto/heimdal/lib/asn1  
-I/src/kerberos5/libexec/kimpersonate/../../../crypto/heimdal/lib/roken  
-I/src/kerberos5/libexec/kimpersonate/../../../crypto/heimdal/lib/sl -I. 
-DHAVE_CONFIG_H -I/src/kerberos5/libexec/kimpersonate/../../include -std=gnu99  
-c 
/src/kerberos5/libexec/kimpersonate/../../../crypto/heimdal/kuser/kimpersonate.c
cc -O -pipe -G0  
-I/src/kerberos5/libexec/kimpersonate/../../../crypto/heimdal/lib/hx509  
-I/src/kerberos5/libexec/kimpersonate/../../../crypto/heimdal/lib/asn1  
-I/src/kerberos5/libexec/kimpersonate/../../../crypto/heimdal/lib/roken  
-I/src/kerberos5/libexec/kimpersonate/../../../crypto/heimdal/lib/sl -I. 
-DHAVE_CONFIG_H -I/src/kerberos5/libexec/kimpersonate/../../include -std=gnu99  
 -o kimpersonate kimpersonate.o -lkafs5 -lkrb5 -lheimntlm -lroken -lasn1 
-lcrypto -lcrypt  
/obj/mips.mips/src/kerberos5/libexec/kimpersonate/../../lib/libvers/libvers.a
/obj/mips.mips/src/tmp/usr/bin/ld: /obj/mips.mips/src/tmp/usr/lib/libkafs5.so 
symbol number 13 references nonexistent SHT_SYMTAB_SHNDX section
/obj/mips.mips/src/tmp/usr/lib/libkafs5.so: could not read symbols: File format 
not recognized
*** Error code 1

Stop in /src/kerberos5/libexec/kimpersonate.
*** Error code 1

Stop in /src/kerberos5/libexec.
*** Error code 1

Stop in /src/kerberos5.
*** Error code 1

Stop in /src.
*** Error code 1

Stop in /src.
*** Error code 1

Stop in /src.
TB --- 2012-04-05 02:43:07 - WARNING: /usr/bin/make returned exit code  1 
TB --- 2012-04-05 02:43:07 - ERROR: failed to build world
TB --- 2012-04-05 02:43:07 - 2082.69 user 441.17 system 3036.86 real


http://tinderbox.freebsd.org/tinderbox-head-HEAD-mips-mips.full
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


[head tinderbox] failure on mips/mips

2012-04-04 Thread FreeBSD Tinderbox
TB --- 2012-04-04 17:47:35 - tinderbox 2.9 running on freebsd-current.sentex.ca
TB --- 2012-04-04 17:47:35 - starting HEAD tinderbox run for mips/mips
TB --- 2012-04-04 17:47:35 - cleaning the object tree
TB --- 2012-04-04 17:48:17 - cvsupping the source tree
TB --- 2012-04-04 17:48:18 - /usr/bin/csup -z -r 3 -g -L 1 -h cvsup.sentex.ca 
/tinderbox/HEAD/mips/mips/supfile
TB --- 2012-04-04 17:49:08 - building world
TB --- 2012-04-04 17:49:08 - CROSS_BUILD_TESTING=YES
TB --- 2012-04-04 17:49:08 - MAKEOBJDIRPREFIX=/obj
TB --- 2012-04-04 17:49:08 - PATH=/usr/bin:/usr/sbin:/bin:/sbin
TB --- 2012-04-04 17:49:08 - SRCCONF=/dev/null
TB --- 2012-04-04 17:49:08 - TARGET=mips
TB --- 2012-04-04 17:49:08 - TARGET_ARCH=mips
TB --- 2012-04-04 17:49:08 - TZ=UTC
TB --- 2012-04-04 17:49:08 - __MAKE_CONF=/dev/null
TB --- 2012-04-04 17:49:08 - cd /src
TB --- 2012-04-04 17:49:08 - /usr/bin/make -B buildworld
>>> World build started on Wed Apr  4 17:49:09 UTC 2012
>>> Rebuilding the temporary build tree
>>> stage 1.1: legacy release compatibility shims
>>> stage 1.2: bootstrap tools
>>> stage 2.1: cleaning up the object tree
>>> stage 2.2: rebuilding the object tree
>>> stage 2.3: build tools
>>> stage 3: cross tools
>>> stage 4.1: building includes
>>> stage 4.2: building libraries
>>> stage 4.3: make dependencies
>>> stage 4.4: building everything
[...]
cc -O -pipe -G0  -I/src/kerberos5/libexec/kfd/../../../crypto/heimdal/lib/asn1  
-I/src/kerberos5/libexec/kfd/../../../crypto/heimdal/lib/roken -DHAVE_CONFIG_H 
-I/src/kerberos5/libexec/kfd/../../include -std=gnu99  -c 
/src/kerberos5/libexec/kfd/../../../crypto/heimdal/appl/kf/kfd.c
cc -O -pipe -G0  -I/src/kerberos5/libexec/kfd/../../../crypto/heimdal/lib/asn1  
-I/src/kerberos5/libexec/kfd/../../../crypto/heimdal/lib/roken -DHAVE_CONFIG_H 
-I/src/kerberos5/libexec/kfd/../../include -std=gnu99   -o kfd kfd.o -lkrb5 
-lroken -lasn1 -lcrypto -lcrypt  
/obj/mips.mips/src/kerberos5/libexec/kfd/../../lib/libvers/libvers.a
gzip -cn /src/kerberos5/libexec/kfd/../../../crypto/heimdal/appl/kf/kfd.8 > 
kfd.8.gz
===> kerberos5/libexec/kimpersonate (all)
cc -O -pipe -G0  
-I/src/kerberos5/libexec/kimpersonate/../../../crypto/heimdal/lib/hx509  
-I/src/kerberos5/libexec/kimpersonate/../../../crypto/heimdal/lib/asn1  
-I/src/kerberos5/libexec/kimpersonate/../../../crypto/heimdal/lib/roken  
-I/src/kerberos5/libexec/kimpersonate/../../../crypto/heimdal/lib/sl -I. 
-DHAVE_CONFIG_H -I/src/kerberos5/libexec/kimpersonate/../../include -std=gnu99  
-c 
/src/kerberos5/libexec/kimpersonate/../../../crypto/heimdal/kuser/kimpersonate.c
cc -O -pipe -G0  
-I/src/kerberos5/libexec/kimpersonate/../../../crypto/heimdal/lib/hx509  
-I/src/kerberos5/libexec/kimpersonate/../../../crypto/heimdal/lib/asn1  
-I/src/kerberos5/libexec/kimpersonate/../../../crypto/heimdal/lib/roken  
-I/src/kerberos5/libexec/kimpersonate/../../../crypto/heimdal/lib/sl -I. 
-DHAVE_CONFIG_H -I/src/kerberos5/libexec/kimpersonate/../../include -std=gnu99  
 -o kimpersonate kimpersonate.o -lkafs5 -lkrb5 -lheimntlm -lroken -lasn1 
-lcrypto -lcrypt  
/obj/mips.mips/src/kerberos5/libexec/kimpersonate/../../lib/libvers/libvers.a
/obj/mips.mips/src/tmp/usr/bin/ld: /obj/mips.mips/src/tmp/usr/lib/libkafs5.so 
symbol number 13 references nonexistent SHT_SYMTAB_SHNDX section
/obj/mips.mips/src/tmp/usr/lib/libkafs5.so: could not read symbols: File format 
not recognized
*** Error code 1

Stop in /src/kerberos5/libexec/kimpersonate.
*** Error code 1

Stop in /src/kerberos5/libexec.
*** Error code 1

Stop in /src/kerberos5.
*** Error code 1

Stop in /src.
*** Error code 1

Stop in /src.
*** Error code 1

Stop in /src.
TB --- 2012-04-04 18:38:14 - WARNING: /usr/bin/make returned exit code  1 
TB --- 2012-04-04 18:38:14 - ERROR: failed to build world
TB --- 2012-04-04 18:38:14 - 2082.47 user 442.30 system 3039.15 real


http://tinderbox.freebsd.org/tinderbox-head-HEAD-mips-mips.full
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Fw: Re: packages that can generate arp storm

2012-04-04 Thread Rodrigo OSORIO
- Forwarded message from Rodrigo OSORIO  -

From: Rodrigo OSORIO 
Date: Wed, 4 Apr 2012 17:14:21 +0200
To: gahn 
Subject: Re: packages that can generate arp storm
User-Agent: Mutt/1.4.2.3i

On 04/04/12 07:33 -0700, gahn wrote:
> hi, gurus:
> 
> are freebsd system coming with any packages that could generate arp storm?
> 
> thanks
> 
> 
> _gahn
> 
> ___
> freebsd-current@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Hi,

There is a few list of ports dealing with arp :

net-mgmt/arpscan : simple scanner which sends out arp requests for the given IP 
addresses.
security/arpCounterattack : a program for detecting and remedying "ARP attacks.
security/ipguard : listens network for ARP packets and if not listed in 
'ethers' file, it will send ARP reply with configured
fake address.

I'm sure combining those tools together you can obtain a funny arp party !

Regards,
- rodrigo


- End forwarded message -
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: -ffast-math in Ports and wrong generated code

2012-04-04 Thread Pedro Giffuni

On 04/04/12 04:29, Andrey Simonenko wrote:

On Tue, Apr 03, 2012 at 06:43:00AM -0700, Steve Kargl wrote:

On Tue, Apr 03, 2012 at 02:21:11PM +0300, Andrey Simonenko wrote:

I use one port from the Ports Collection, that works with FP.  Having
reinstalled it (its version was not changed) I noticed that it started
to work incorrectly.  After debugging and disassembling its code I found
out that the -ffast-math option used for building was the result of
wrongly generated code (I did not specify this option in /etc/make.conf).

At least finite() function call was eliminated from the result Assembler
code when -ffast-math option is used, tested on 9.0-STABLE and 10.0-CURRENT.

Example test source code and generated code under 9.0-STABLE on amd64
by gcc from the base system:

-
#include
#include

void
check_finite(double x)
{
printf("%d\n", finite(x));
}
-

% gcc -Wall -O2 -S finite.c
-
check_finite:
.LFB3:
subq$8, %rsp
.LCFI0:
callfinite  <-- call to finite()
movl$.LC0, %edi
movl%eax, %esi
addq$8, %rsp
xorl%eax, %eax
jmp printf
.LFE3:
.size   check_finite, .-check_finite
-

% gcc -Wall -O2 -ffast-math -S finite.c
-
check_finite:
.LFB3:
xorl%esi, %esi  <-- fake result from finite()
movl$.LC0, %edi
xorl%eax, %eax
jmp printf
.LFE3:
.size   check_finite, .-check_finite
-

Can somebody comment this?

Read the man page for gcc.  With --fast-math,
gcc assumes that the result of any FP operation
is finite.  So, the function call to finite()
is eliminated as it is always true.

Looks like that I was misunderstood.  I did not ask why finite() was
eliminated, I asked why fake result from finite() is wrong.  Obviously
that -ffast-math can optimize FP arithmetics and as a result some functions
can be eliminated.  The problem is not respecting IEEE specifications for
FP, the problem is wrongly generated code when -ffast-math is used.

Actually there is a bug in GCC used in the base system.  There was made
a change to builtins.c from gcc in revision 1.12 [1] and as a result gcc
started to eliminate finite() function calls with -ffinite-math-only.

...

After this change the corresponding Assembler code for my test file is:

% gcc -Wall -O2 -ffast-math -S finite.c
-
check_finite:
.LFB3:
movl$1, %esi<-- fake result from finite()
movl$.LC0, %edi
xorl%eax, %eax
jmp printf
.LFE3:
.size   check_finite, .-check_finite
-

What do you think?  If there is no objections, I'll create PR.

[1] 
http://www.freebsd.org/cgi/cvsweb.cgi/src/contrib/gcc/builtins.c.diff?r1=1.11;r2=1.12
___


The SVN commit

http://svnweb.freebsd.org/base?view=revision&revision=228756

will point you to this:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28796

and we are keeping consistency with both upstream and Apple's gcc.

Which is the affected port again? It should be fixed there or else
the problem will continue with future compilers.

Pedro.
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


packages that can generate arp storm

2012-04-04 Thread gahn
hi, gurus:

are freebsd system coming with any packages that could generate arp storm?

thanks


_gahn

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: compiling glib20 failed

2012-04-04 Thread gahn
hi, sergey:

thanks for the great tip. i think messed up with this xz thing. last year i 
played with xz since a package i was trying to install wouldn't use xz package 
coming with the base system. 


now i disabled those under /usr/local/lib and the system is back to normal.

best regards

_gahn



- Original Message -
From: Sergey Kandaurov 
To: gahn 
Cc: free bsd ; freebsd general questions 

Sent: Wednesday, April 4, 2012 2:31 AM
Subject: Re: compiling glib20 failed

On 4 April 2012 07:02, gahn  wrote:
> hi gurus:
>
> i got problem with compiling glib20:
>
> ===>   glib-2.28.8_4 depends on file: /usr/local/bin/perl5.10.1 - found
> /libexec/ld-elf.so.1: /usr/local/lib/liblzma.so.5: version XZ_5.0 required by 
> /usr/bin/xz not defined
> ===>  Missing license file for LGPL20 in 
> /usr/ports/devel/glib20/work/glib-2.28.8/COPYING
> *** Error code 1
>
> Stop in /usr/ports/devel/glib20.
> *** Error code 1
>
>
> basically i was trying to install tshark on freebsd 8.1 but it told me i need 
> to upgrade glib but i got into this mess.
>

Looks like the source of your problem may lie in that your base /usr/bin/xz
tries to dlopen /usr/local/lib/liblzma.so.5 installed from ports and not
the one from base (i.e. there should be /usr/lib/liblzma.so.5 instead).
The one from ports doesn't have the symbol versioning
(or at least doesn't have specific symbols the base xz wants)
and, for aught I know, shall not be used by the base xz in any way.

I wonder how did you manage to install xz from ports on 8.1
as this port is specifically IGNORE'd to install on 8.1 system
with the reason "is already in the base system".

First I would try to pkgrm xz and see how it helps.

-- 
wbr,
pluknet
___
freebsd-questi...@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Using TMPFS for /tmp and /var/run?

2012-04-04 Thread David Wolfskill
On Wed, Apr 04, 2012 at 12:50:35PM +0300, Gleb Kurtsou wrote:
> ...
> tmpfs-32bit-size_max.patch.txt should fix the problem. I don't have i386
> installations to test it myself.
> 
> Do you run PAE kernel? Could you try filling up /tmp at least to 10g.
> ...

After updating source to r233868, applying the patch, then updating,
here are the results of my testing so far (not using PAE).

Summary: as before, I believe that the patch didn't hurt anything, but
it also doesn't restrict the usable size of /tmp to the specified size
(from /etc/fstab):


Script started on Wed Apr  4 06:23:25 2012

g1-227(10.0-C)[1] _do
uid=0(root) gid=0(wheel) groups=0(wheel),5(operator)
/dev/ada0s2a on / (ufs, local, soft-updates)
devfs on /dev (devfs, local, multilabel)
tmpfs on /tmp (tmpfs, local)
/dev/ada0s2d on /usr (ufs, local, soft-updates)
/dev/ada0s4e on /var (ufs, local, soft-updates)
/dev/ada0s4g on /common (ufs, local, soft-updates)
fdescfs on /dev/fd (fdescfs)
FreeBSD g1-227.catwhisker.org 10.0-CURRENT FreeBSD 10.0-CURRENT #2 233868M: Wed 
Apr  4 06:02:25 PDT 2012 
r...@g1-227.catwhisker.org:/usr/obj/usr/src/sys/CANARY  i386
Wed Apr  4 06:23:27 PDT 2012
>>> Removing old libraries
Please be sure no application still uses those libraries, else you
can not start such an application. Consult UPDATING for more
information regarding how to cope with the removal/revision bump
of a specific library.
>>> Old libraries removed
Wed Apr  4 06:23:28 PDT 2012
g1-227(10.0-C)[2] exit

Script done on Wed Apr  4 06:23:29 2012
Script started on Wed Apr  4 06:23:35 2012

g1-227(10.0-C)[1] df -hi /tmp
FilesystemSizeUsed   Avail Capacity iused ifree %iused  Mounted on
tmpfs  23G 12k 23G 0%  17  2.1G0%   /tmp
g1-227(10.0-C)[2] grep tmpfs /etc/fstab
# tmpfs /tmptmpfs   rw,size=2147483648  0   0
tmpfs   /tmptmpfs   rw,size=8g  0   0

g1-227(10.0-C)[3] ls -lhT /bkp/tmp/test 
-rw-r--r--  1 david  wheel   8.0G Mar 25 10:42:49 2012 /bkp/tmp/test
g1-227(10.0-C)[4] dd bs=1m if=!$ of=/tmp/test
dd bs=1m if=/bkp/tmp/test of=/tmp/test
8192+0 records in
8192+0 records out
8589934592 bytes transferred in 186.178099 secs (46138266 bytes/sec)
g1-227(10.0-C)[5] df -hi /tmp
FilesystemSizeUsed   Avail Capacity iused ifree %iused  Mounted on
tmpfs  23G8.0G 15G35%  18  2.1G0%   /tmp
g1-227(10.0-C)[6] dd bs=1m if=/bkp/tmp/test of=/tmp/test1
8192+0 records in
8192+0 records out
8589934592 bytes transferred in 220.254916 secs (3868 bytes/sec)
g1-227(10.0-C)[7] df -hi /tmp
FilesystemSizeUsed   Avail Capacity iused ifree %iused  Mounted on
tmpfs  23G 16G7.0G70%  19  2.1G0%   /tmp
g1-227(10.0-C)[8] exit

Script done on Wed Apr  4 06:33:12 2012
g1-227(10.0-C)[5]


Peace,
david
-- 
David H. Wolfskill  da...@catwhisker.org
Depriving a girl or boy of an opportunity for education is evil.

See http://www.catwhisker.org/~david/publickey.gpg for my public key.


pgpUsQa4laxTF.pgp
Description: PGP signature


Re: LSI supported mps(4) driver available

2012-04-04 Thread Matt Thyer
On 3 April 2012 23:12, Gary Palmer  wrote:

> On Tue, Apr 03, 2012 at 10:52:25PM +0930, Matt Thyer wrote:
> > I forgot to mention that I'm still having problems after this phase 11
> > firmware upgrade with the 6 Gbps drive being kicked out of the raidz2
> with
> > write errors (even though a SMART full surface test says the drive is
> OK).
> >
> > This leads me to think that both the old and new drivers have a problem
> > with the 6 Gbps WD20EARX-00P AB51 drive.
> >
> > Now that the 6 Gbps drive is on the Intel SATA controller things seem OK
> > but it's a bit early to tell.
> >
> > Stay tuned!
>
> I think you should contact either SuperMicro or LSI and open a support
> case as it looks like there could be a problem with either the controller
> or the firmware when presented with mixed speed devices.  Either way I
> think
> this needs to be escalated to the manufacturer.
>
> Regards,
>
> Gary
>

I'm now having no problems since moving the SATA 3 drive to the on board
Intel controller.
I'll try to report this to Super Micro & LSI.
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Using TMPFS for /tmp and /var/run?

2012-04-04 Thread John Baldwin
On Monday, April 02, 2012 5:03:26 pm Gleb Kurtsou wrote:
> On (02/04/2012 06:26), David Wolfskill wrote:
> > On Mon, Apr 02, 2012 at 01:31:19PM +0300, Gleb Kurtsou wrote:
> > > ...
> > > You could try the patch attached. It adds support for size option 
suffixes
> > > (like 1g) and introduces swap limit (part of the older patch, not sure
> > > if it's any use).
> > > 
> > > Patch is against 10-CURRENT.
> > > Older version: https://github.com/glk/freebsd-head/commit/3bd8f7d
> > > 
> > 
> > OK; here's a summary of what I found so far, now running:
> > 
> > FreeBSD g1-227.catwhisker.org 10.0-CURRENT FreeBSD 10.0-CURRENT #0 
233772M: Mon Apr  2 05:42:48 PDT 2012 
r...@g1-227.catwhisker.org:/usr/obj/usr/src/sys/CANARY  i386
> > 
> > * First, the patch applied cleanly (via "patch -p1").
> > 
> > * Resulting sources build with no issues.
> > 
> > * Prior specification I had in /etc/fstab:
> > 
> >   tmpfs/tmptmpfsrw,size=2147483648  00
> > 
> >   worked same as before the patch; "df -h /tmp" reported a size of 2.0G.
> > 
> > * Changing the above to read:
> > 
> >   tmpfs/tmptmpfsrw,size=2g  00
> > 
> >   also provided the same result, so the unit-specification code looks
> >   as if it's working as expected.
> > 
> > * I have 20G specified for swap, and 4G RAM (and, as above, I'm running
> >   i386).  Changing the above tmpfs line in /etc/fstab to
> > 
> >   tmpfs/tmptmpfsrw,size=8g  00
> > 
> >   (still) yields:
> > 
> > g1-227(10.0-C)[3] df -h /tmp
> > FilesystemSizeUsed   Avail Capacity  Mounted on
> > tmpfs  23G 12k 23G 0%/tmp
> > g1-227(10.0-C)[4] 
> 
> tmpfs-32bit-size_max.patch.txt should fix the problem. I don't have i386
> installations to test it myself.
> 
> Do you run PAE kernel? Could you try filling up /tmp at least to 10g.

Hmm, is UINT64_MAX really the right type?  Should it be something like OFF_MAX 
instead?

-- 
John Baldwin
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Can't install latest CURRENT

2012-04-04 Thread Pavel Timofeev
Hi!
I've downloaded today's CURRENT snapshot and tried to install it.
It fails on setting root password with following message:


FreeBSD Installer
=

Please select a password for the system management account (root):
Changing local password for root
New Password:
passwd: pam_chauthtok(): conversation failure
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


[head tinderbox] failure on mips/mips

2012-04-04 Thread FreeBSD Tinderbox
TB --- 2012-04-04 09:42:28 - tinderbox 2.9 running on freebsd-current.sentex.ca
TB --- 2012-04-04 09:42:28 - starting HEAD tinderbox run for mips/mips
TB --- 2012-04-04 09:42:28 - cleaning the object tree
TB --- 2012-04-04 09:43:10 - cvsupping the source tree
TB --- 2012-04-04 09:43:10 - /usr/bin/csup -z -r 3 -g -L 1 -h cvsup.sentex.ca 
/tinderbox/HEAD/mips/mips/supfile
TB --- 2012-04-04 09:44:00 - building world
TB --- 2012-04-04 09:44:00 - CROSS_BUILD_TESTING=YES
TB --- 2012-04-04 09:44:00 - MAKEOBJDIRPREFIX=/obj
TB --- 2012-04-04 09:44:00 - PATH=/usr/bin:/usr/sbin:/bin:/sbin
TB --- 2012-04-04 09:44:00 - SRCCONF=/dev/null
TB --- 2012-04-04 09:44:00 - TARGET=mips
TB --- 2012-04-04 09:44:00 - TARGET_ARCH=mips
TB --- 2012-04-04 09:44:00 - TZ=UTC
TB --- 2012-04-04 09:44:00 - __MAKE_CONF=/dev/null
TB --- 2012-04-04 09:44:00 - cd /src
TB --- 2012-04-04 09:44:00 - /usr/bin/make -B buildworld
>>> World build started on Wed Apr  4 09:44:01 UTC 2012
>>> Rebuilding the temporary build tree
>>> stage 1.1: legacy release compatibility shims
>>> stage 1.2: bootstrap tools
>>> stage 2.1: cleaning up the object tree
>>> stage 2.2: rebuilding the object tree
>>> stage 2.3: build tools
>>> stage 3: cross tools
>>> stage 4.1: building includes
>>> stage 4.2: building libraries
>>> stage 4.3: make dependencies
>>> stage 4.4: building everything
[...]
cc -O -pipe -G0  -I/src/kerberos5/libexec/kfd/../../../crypto/heimdal/lib/asn1  
-I/src/kerberos5/libexec/kfd/../../../crypto/heimdal/lib/roken -DHAVE_CONFIG_H 
-I/src/kerberos5/libexec/kfd/../../include -std=gnu99  -c 
/src/kerberos5/libexec/kfd/../../../crypto/heimdal/appl/kf/kfd.c
cc -O -pipe -G0  -I/src/kerberos5/libexec/kfd/../../../crypto/heimdal/lib/asn1  
-I/src/kerberos5/libexec/kfd/../../../crypto/heimdal/lib/roken -DHAVE_CONFIG_H 
-I/src/kerberos5/libexec/kfd/../../include -std=gnu99   -o kfd kfd.o -lkrb5 
-lroken -lasn1 -lcrypto -lcrypt  
/obj/mips.mips/src/kerberos5/libexec/kfd/../../lib/libvers/libvers.a
gzip -cn /src/kerberos5/libexec/kfd/../../../crypto/heimdal/appl/kf/kfd.8 > 
kfd.8.gz
===> kerberos5/libexec/kimpersonate (all)
cc -O -pipe -G0  
-I/src/kerberos5/libexec/kimpersonate/../../../crypto/heimdal/lib/hx509  
-I/src/kerberos5/libexec/kimpersonate/../../../crypto/heimdal/lib/asn1  
-I/src/kerberos5/libexec/kimpersonate/../../../crypto/heimdal/lib/roken  
-I/src/kerberos5/libexec/kimpersonate/../../../crypto/heimdal/lib/sl -I. 
-DHAVE_CONFIG_H -I/src/kerberos5/libexec/kimpersonate/../../include -std=gnu99  
-c 
/src/kerberos5/libexec/kimpersonate/../../../crypto/heimdal/kuser/kimpersonate.c
cc -O -pipe -G0  
-I/src/kerberos5/libexec/kimpersonate/../../../crypto/heimdal/lib/hx509  
-I/src/kerberos5/libexec/kimpersonate/../../../crypto/heimdal/lib/asn1  
-I/src/kerberos5/libexec/kimpersonate/../../../crypto/heimdal/lib/roken  
-I/src/kerberos5/libexec/kimpersonate/../../../crypto/heimdal/lib/sl -I. 
-DHAVE_CONFIG_H -I/src/kerberos5/libexec/kimpersonate/../../include -std=gnu99  
 -o kimpersonate kimpersonate.o -lkafs5 -lkrb5 -lheimntlm -lroken -lasn1 
-lcrypto -lcrypt  
/obj/mips.mips/src/kerberos5/libexec/kimpersonate/../../lib/libvers/libvers.a
/obj/mips.mips/src/tmp/usr/bin/ld: /obj/mips.mips/src/tmp/usr/lib/libkafs5.so 
symbol number 13 references nonexistent SHT_SYMTAB_SHNDX section
/obj/mips.mips/src/tmp/usr/lib/libkafs5.so: could not read symbols: File format 
not recognized
*** Error code 1

Stop in /src/kerberos5/libexec/kimpersonate.
*** Error code 1

Stop in /src/kerberos5/libexec.
*** Error code 1

Stop in /src/kerberos5.
*** Error code 1

Stop in /src.
*** Error code 1

Stop in /src.
*** Error code 1

Stop in /src.
TB --- 2012-04-04 10:32:57 - WARNING: /usr/bin/make returned exit code  1 
TB --- 2012-04-04 10:32:57 - ERROR: failed to build world
TB --- 2012-04-04 10:32:57 - 2070.44 user 450.41 system 3029.97 real


http://tinderbox.freebsd.org/tinderbox-head-HEAD-mips-mips.full
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: -ffast-math in Ports and wrong generated code

2012-04-04 Thread Andrey Simonenko
On Tue, Apr 03, 2012 at 06:43:00AM -0700, Steve Kargl wrote:
> On Tue, Apr 03, 2012 at 02:21:11PM +0300, Andrey Simonenko wrote:
> > 
> > I use one port from the Ports Collection, that works with FP.  Having
> > reinstalled it (its version was not changed) I noticed that it started
> > to work incorrectly.  After debugging and disassembling its code I found
> > out that the -ffast-math option used for building was the result of
> > wrongly generated code (I did not specify this option in /etc/make.conf).
> > 
> > At least finite() function call was eliminated from the result Assembler
> > code when -ffast-math option is used, tested on 9.0-STABLE and 10.0-CURRENT.
> > 
> > Example test source code and generated code under 9.0-STABLE on amd64
> > by gcc from the base system:
> > 
> > -
> > #include 
> > #include 
> > 
> > void
> > check_finite(double x)
> > {
> > printf("%d\n", finite(x));
> > }
> > -
> > 
> > % gcc -Wall -O2 -S finite.c
> > -
> > check_finite:
> > .LFB3:
> > subq$8, %rsp
> > .LCFI0:
> > callfinite  <-- call to finite()
> > movl$.LC0, %edi
> > movl%eax, %esi
> > addq$8, %rsp
> > xorl%eax, %eax
> > jmp printf
> > .LFE3:
> > .size   check_finite, .-check_finite
> > -
> > 
> > % gcc -Wall -O2 -ffast-math -S finite.c
> > -
> > check_finite:
> > .LFB3:
> > xorl%esi, %esi  <-- fake result from finite()
> > movl$.LC0, %edi
> > xorl%eax, %eax
> > jmp printf
> > .LFE3:
> > .size   check_finite, .-check_finite
> > -
> > 
> > Can somebody comment this?
> 
> Read the man page for gcc.  With --fast-math,
> gcc assumes that the result of any FP operation 
> is finite.  So, the function call to finite()
> is eliminated as it is always true. 

Looks like that I was misunderstood.  I did not ask why finite() was
eliminated, I asked why fake result from finite() is wrong.  Obviously
that -ffast-math can optimize FP arithmetics and as a result some functions
can be eliminated.  The problem is not respecting IEEE specifications for
FP, the problem is wrongly generated code when -ffast-math is used.

Actually there is a bug in GCC used in the base system.  There was made
a change to builtins.c from gcc in revision 1.12 [1] and as a result gcc
started to eliminate finite() function calls with -ffinite-math-only.

The true result from finite() is non-zero value, but GCC generated always
false value, so any program that uses finite() and has -ffinite-math-only
works incorrectly if it was built by this version of gcc.

Here is the correction for builtins.c:

--- builtins.c.orig 2012-01-06 14:50:41.0 +0200
+++ builtins.c  2012-04-04 10:27:23.0 +0300
@@ -8738,7 +8738,7 @@ fold_builtin_classify (tree fndecl, tree
 case BUILT_IN_FINITE:
   if (!HONOR_NANS (TYPE_MODE (TREE_TYPE (arg)))
  && !HONOR_INFINITIES (TYPE_MODE (TREE_TYPE (arg
-   return omit_one_operand (type, integer_zero_node, arg);
+   return omit_one_operand (type, integer_one_node, arg);
 
   if (TREE_CODE (arg) == REAL_CST)
{

After this change the corresponding Assembler code for my test file is:

% gcc -Wall -O2 -ffast-math -S finite.c
-
check_finite:
.LFB3:
movl$1, %esi<-- fake result from finite()
movl$.LC0, %edi
xorl%eax, %eax
jmp printf
.LFE3:
.size   check_finite, .-check_finite
-

What do you think?  If there is no objections, I'll create PR.

[1] 
http://www.freebsd.org/cgi/cvsweb.cgi/src/contrib/gcc/builtins.c.diff?r1=1.11;r2=1.12
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"