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

Re: Bug#788102: The code doesn't compile on kfreebsd


On Wed, Jul 22, 2015 at 6:55 PM, Steven Chamberlain <steven@pyro.eu.org> wrote:
> Hello,
> Gianfranco Costamagna wrote:
>> file.c:5:38: error: ‘mcontext_t’ has no member named ‘fpregs’
>> uint32_t mxcsr = ucon.uc_mcontext.fpregs->mxcsr;
> FreeBSD doesn't seem to have fpregs in mcontext_t or sigcontext.
> But I think mc_fpstate might be the same thing;  but that isn't
> implemented as a struct...
>> typedef struct
>>   {
> ...
>>     int mc_fpstate[128] __attribute__((aligned(16)));
>>     int mc_spare2[8];
>>   } mcontext_t;
> I see that FreeBSD Ports has ilmbase-2.20 and succeeded building
> libIexMath, yet they don't seem to have patched this source file.
> I should try building it on a real FreeBSD system, to compare the
> build log with that of a GNU/kFreeBSD system.

We've just tested here. None of the code path in ilmbase compile with
a kFreeBSD distribution. Since FreeBSD uses a cmake based build:


we know for sure that the following function *does* compile on a real
FreeBSD system:


inline void
restoreControlRegs (const ucontext_t & ucon, bool clearExceptions)
setCw ((ucon.uc_mcontext.fpregs->cwd & cwRestoreMask) | cwRestoreVal);
setMxcsr (ucon.uc_mcontext.fpregs->mxcsr, clearExceptions);

So kFreeBSD and FreeBSD do not use the same libc (where ucontext.h is provided).

Reply to: