Problem Report amd64/78848 "sis driver on FreeBSD 5.x does not work on amd64"

John Baldwin jhb at FreeBSD.org
Mon Mar 28 14:44:08 PST 2005


On Monday 28 March 2005 05:11 pm, Stasys Smailys wrote:
> John Baldwin wrote:
> > On Monday 28 March 2005 04:13 am, Stasys Smailys wrote:
>
> [skipped]
>
> >>/usr/src/lib/libc/i386/sys/_amd64_get_fsbase.c:
> >>[...]
> >>ret = sysarch(_AMD64_GET_FSBASE, (void *)(&addr64));
> >>[...]
> >>
> >>/usr/src/lib/libc/i386/sys/_amd64_get_gsbase.c:
> >>[...]
> >>ret = sysarch(_AMD64_GET_GSBASE, (void *)(&addr64));
> >>[...]
> >
> > addr64 is supposed to be a pointer though, so it really is a pointer to a
> > pointer that's being passed (void **).
>
> Strange. If this is an expected behavior why then I couldn't "make
> buildworld" till I changed (void **) to (void *)?
>
> cc -m32 -march=athlon-xp -msse2 -mfancy-math-387 -DCOMPAT_32BIT
> -I/usr/obj/usr/src/lib32/usr/include  -L/usr/obj/usr/src/lib32/usr/lib32
>   -B/usr/obj/usr/src/lib32/usr/lib32 -O2 -frename-registers -pipe
> -I/usr/src/lib/libc/include -I/usr/src/lib/libc/../../include
> -I/usr/src/lib/libc/i386 -D__DBINTERFACE_PRIVATE
> -I/usr/src/lib/libc/../../contrib/gdtoa -DINET6
> -I/usr/obj/lib32/usr/src/lib/libc -DPOSIX_MISTAKE
> -I/usr/src/lib/libc/locale -DBROKEN_DES -DPORTMAP -DDES_BUILTIN
> -I/usr/src/lib/libc/rpc -DYP -DHESIOD -Wsystem-headers -Werror -Wall
> -Wno-format-y2k -Wno-uninitialized -c
> /usr/src/lib/libc/i386/sys/_amd64_get_fsbase.c
> /usr/src/lib/libc/i386/sys/_amd64_get_fsbase.c: In function
> `_amd64_get_fsbase':
> /usr/src/lib/libc/i386/sys/_amd64_get_fsbase.c:40: warning:
> dereferencing type-punned pointer will break strict-aliasing rules
> *** Error code 1
>
> Stop in /usr/src/lib/libc.
> *** Error code 1
>
> Stop in /usr/src/lib.
> *** Error code 1
>
> Stop in /usr/src.
> *** Error code 1
>
> Stop in /usr/src.
> *** Error code 1
>
> Stop in /usr/src.
> *** Error code 1
>
> Stop in /usr/src.
>
> Ah, I see now. Because of -Werror, right?

Yes.  It needs some set of gymnastics to get around that I suppose.  It 
probably has to do with the fact that this is -m32 code in which void * is a 
uint32_t, not a uint64_t.

-- 
John Baldwin <jhb at FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org


More information about the freebsd-amd64 mailing list