This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] libgo - fix build errors and add ARM bits
On Mon, Dec 3, 2012 at 10:47 PM, Matthias Klose <doko@ubuntu.com> wrote:
> Am 04.12.2012 07:26, schrieb Ian Lance Taylor:
>> On Mon, Nov 19, 2012 at 8:27 AM, Matthias Klose <doko@ubuntu.com> wrote:
>>> libgo-fix-arm.diff: Work around parse error of struct timex_ on ARM (both trunk
>>> and 4.7 branch).
>>>
>>> libgo-hardening.diff: Avoid compiler warnings in libgo with -D_FORTIFY_SOURCE=2,
>>> which let the build fail with -Werror. first chunk for the trunk and 4.7, second
>>> chunk for trunk only.
>>>
>>> libgo-mksysinfo.diff: Fix TIOCNOTTY and TIOCSCTTY definitions, afaicr needed for
>>> ARM as well. for trunk and 4.7.
>>
>> Thanks. I committed the libgo-hardening and libgo-mksysinfo patches
>> to mainline and 4.7 branch.
>>
>>
>> Can you tell me more about the libgo-fix-arm patch? The patch adds
>> these lines to mksysinfo.sh:
>>
>> +# ARM
>> +sed -i '/type _timex/s/INVALID-bit-field/int32/g;/type _timex/s,^//
>> ,,' gen-sysinfo.go
>>
>> I don't understand why there would an INVALID-bit-field on ARM. This
>> struct comes from the <sys/timex.h>, which as far as I can see should
>> be the same on every glibc system.
>>
>> What does struct timex look like in your <sys/timex.h> file? What
>> does the line look like in gen-sysinfo.go before the sed script above
>> is run?
>
> defined in bits/timex.h
>
> struct timex
> {
> unsigned int modes; /* mode selector */
> __syscall_slong_t offset; /* time offset (usec) */
> __syscall_slong_t freq; /* frequency offset (scaled ppm) */
> __syscall_slong_t maxerror; /* maximum error (usec) */
> __syscall_slong_t esterror; /* estimated error (usec) */
> int status; /* clock command/status */
> __syscall_slong_t constant; /* pll time constant */
> __syscall_slong_t precision; /* clock precision (usec) (ro) */
> __syscall_slong_t tolerance; /* clock frequency tolerance (ppm) (ro) */
> struct timeval time; /* (read only) */
> __syscall_slong_t tick; /* (modified) usecs between clock ticks */
> __syscall_slong_t ppsfreq; /* pps frequency (scaled ppm) (ro) */
> __syscall_slong_t jitter; /* pps jitter (us) (ro) */
> int shift; /* interval duration (s) (shift) (ro) */
> __syscall_slong_t stabil; /* pps stability (scaled ppm) (ro) */
> __syscall_slong_t jitcnt; /* jitter limit exceeded (ro) */
> __syscall_slong_t calcnt; /* calibration intervals (ro) */
> __syscall_slong_t errcnt; /* calibration errors (ro) */
> __syscall_slong_t stbcnt; /* stability limit exceeded (ro) */
>
> int tai; /* TAI offset (ro) */
>
> /* ??? */
> int :32; int :32; int :32; int :32;
> int :32; int :32; int :32; int :32;
> int :32; int :32; int :32;
> };
>
>
> I'll have to re-run the build with out the patch, but this replaces just the
> 32bit bit fields with an int32.
Thanks. That's more or less what timex.h looks like on my system, but
I don't see the bitfields. GCC treats the :32 fields as int32, in
both 32-bit and 64-bit mode.
Ian