[Pkg-samba-maint] Bug#1009211: Bug#1009211: Kodi FTBFS against libsmbclient.h due to syntax error in _Static_assert

Michael Tokarev mjt at tls.msk.ru
Sat Apr 9 00:46:12 BST 2022


09.04.2022 01:13, Vasyl Gello wrote:
> I experimented with armhf qemu pbuilder and it turns out we can change "_Static_assert" to just "static_assert"
> and both GCC and G++ will happily chew it:

Yes, Thank you for the testing! I didn't think you will be doing
that or else I'd reply to you right away.  I thought for a split
moment about trying c++ when implemented the patch in the first
place, and my first thought when I saw you report was this C++
thing. I immediately found kodi experimental logs (you forgot
to include the references to them but it was trivial to find)
and the first thing I looked was which compiler used - seeing
it was c++ confirmed my earlier thought.  The fix was on the
way about 5 minutes after I've seen your bugreport :)

And no, samba team does not "request" all architectures to
declare -DFILE_OFFSET_BITS.  It is the setting with which
samba is built (in order to support files >2Gb in size), -
including libsmbclient too. So all functions in there which
deal with file sizes and offsets - the one using off_t
datatype - even on 32bit platforms like i386, use 64-bit
value there. This is called LFS (Large File Support). When
you compile your program without this #define on a 32bit
system, you'll be getting off_t size = 4 bytes (32bits),
but actual functions in actual libsmbclient are using
prototypes with 64-bit off_t. So you'll be having
weird runtime errors with everything seemingly correct.

Samba probably should have used its own datatype here so
that user programs will not depend on this define, but it
is way too later now to change anything in there, since
programs already using it expect it to use "variable-sized"
off_t.

You only need this #define on 32bits. For example, autoconf
has a test for this. Please don't enable it on 64bits, since
this way you may introduce other interesting bugs. For example,
the layout of struct stat *might* change with -DF_O_B=64 even
on a 64-bit platform...

It isn't a simple topic.

This particular bug has nothing to do with the #define though
(it is a result of my incompetence and whole situation with
this thing). I mean, it does not depend on this #define in
any way, the problem is that C++ does not have the original
keyword which I used, only C language does.  Wile with C++
it is exactly the other way around. Thankfully, after
including <assert.h>, everything becomes in order.

Thank you for your report!

/mjt



More information about the Pkg-samba-maint mailing list