[Pkg-phototools-devel] Bug#788102: The code doesn't compile on kfreebsd

Mathieu Malaterre malat at debian.org
Tue Sep 15 07:19:15 UTC 2015


Steven,

On Wed, Jul 22, 2015 at 6:55 PM, Steven Chamberlain <steven at 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:

https://svnweb.freebsd.org/ports/head/graphics/ilmbase/

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

https://github.com/openexr/openexr/blob/master/IlmBase/IexMath/IexMathFpu.cpp#L260

[...]
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).



More information about the Pkg-phototools-devel mailing list