bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: followup to segfault/builtin_expect


From: David Ford
Subject: Re: followup to segfault/builtin_expect
Date: Sun, 14 Jan 2001 05:41:58 -0800

Andreas Jaeger wrote:

> >>>>> David Ford writes:
>
>  > I checked an older compile, of 2.2, and the config.log.
>  > HAVE_BUILTIN_EXPECT is undefined in the previous compile and the
>  > config.log shows a failure for it, however the config.h had it defined.
>
>  > I undefined it and commented it out.  I'd recommed someone taking a peek
>  > at the configure script to figure out why the failure resulted in a
>  > success.
>
> Please check it for yourself - it seem to work for everybody else.
> The program is very simple:
>
> int foo (int a)
> {
>   a = __builtin_expect (a, 10);
>   return a == 10 ? 0 : 1;
> }
>
> Compile it with your comiler and check what happens.
>
> Andreas
> --
>  Andreas Jaeger
>   SuSE Labs address@hidden
>    private address@hidden
>     http://www.suse.de/~aj

# gcc -o t t.c
/lib/crt1.o: In function `_start':
/lib/crt1.o(.text+0x18): undefined reference to `main'
/var/tmp/ccEfOlLm.o: In function `foo':
/var/tmp/ccEfOlLm.o(.text+0x10): undefined reference to `__builtin_expect'


As expected.  It is undefined.  The problem is configure built a config.h with
HAVE_BUILTIN_EXPECT defined even though the configure script did not succeed
at this:

configure:3160: checking for __builtin_expect
configure:3173: gcc  -nostdlib -nostartfiles -o conftest conftest.c -lgcc >&5
/usr/local/bin/ld.orig: warning: cannot find entry symbol _start; defaulting
to
08048080
/var/tmp/ccbv0Ssj.o: In function `foo':
/var/tmp/ccbv0Ssj.o(.text+0x10): undefined reference to `__builtin_expect'

-d

--
..NOTICE fwd: fwd: fwd: type emails will be deleted automatically.
      "There is a natural aristocracy among men. The grounds of this are
      virtue and talents", Thomas Jefferson [1742-1826], 3rd US President






reply via email to

[Prev in Thread] Current Thread [Next in Thread]