-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing large file support on 32bits #10
Comments
The latest debian version of libsmbclient-dev no longer sets the large file support cflags in libsmbclient.h [1]. This leads to build failures on 32bit systems. It seems to me that ideally `pkg-config --cflags smbclient` would DTRT and return `-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64` along with `-I/usr/include/samba-4.0`. However this is not the case. The cgo system also does not allow running arbitrary scripts so just calling `getconf LFS_CFLAGS` is not an option. This commit adds a new `libsmbclient_lfs.go` file that is only build on 386/arm and defined the needed LFS cflags. [1] #10
The latest debian version of libsmbclient-dev no longer sets the large file support cflags in libsmbclient.h [1]. This leads to build failures on 32bit systems. It seems to me that ideally `pkg-config --cflags smbclient` would DTRT and return `-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64` along with `-I/usr/include/samba-4.0`. However this is not the case. The cgo system also does not allow running arbitrary scripts so just calling `getconf LFS_CFLAGS` is not an option. This commit adds a new `libsmbclient_lfs.go` file that is only build on 386/arm and defined the needed LFS cflags. [1] #10
The latest debian version of libsmbclient-dev no longer sets the large file support cflags in libsmbclient.h [1]. This leads to build failures on 32bit systems. It seems to me that ideally `pkg-config --cflags smbclient` would DTRT and return `-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64` along with `-I/usr/include/samba-4.0`. However this is not the case. The cgo system also does not allow running arbitrary scripts so just calling `getconf LFS_CFLAGS` is not an option. This commit adds a new `libsmbclient_lfs.go` file that is only build on 386/arm and defined the needed LFS cflags. [1] #10
Thanks for your bugreport. I opened #11 to fix this, please have a look it works fine in my i386 debian sid lxc container and should also work on arm. |
The latest debian version of libsmbclient-dev no longer sets the large file support cflags in libsmbclient.h [1]. This leads to build failures on 32bit systems. It seems to me that ideally `pkg-config --cflags smbclient` would DTRT and return `-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64` along with `-I/usr/include/samba-4.0`. However this is not the case. The cgo system also does not allow running arbitrary scripts so just calling `getconf LFS_CFLAGS` is not an option. This commit adds a new `libsmbclient_lfs.go` file that is only build on 386/arm and defined the needed LFS cflags. [1] #10
Also works fine on my i386 sid lxd. I don't have access anymore to the arm64 host where I can spawn armhf, but it should be fine. |
And on my pi3 for some reason I couldn't reproduce the build failure, unsure why... |
…#11) The latest debian version of libsmbclient-dev no longer sets the large file support cflags in libsmbclient.h [1]. This leads to build failures on 32bit systems. It seems to me that ideally `pkg-config --cflags smbclient` would DTRT and return `-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64` along with `-I/usr/include/samba-4.0`. However this is not the case. The cgo system also does not allow running arbitrary scripts so just calling `getconf LFS_CFLAGS` is not an option. This commit adds a new `libsmbclient_lfs.go` file that is only build on 386/arm and defined the needed LFS cflags. [1] #10
Hi,
for a long time, due to debian bug #221618[1] libsmbclient.h in debian and ubuntu shipped a patch[2] that forcibly defined LFS.
In the latest uploads to Debian, that patch was changed to [3], which now fails a build if the app linking with libsmbclient doesn't set the LFS flags. Note that libsmbclient itself is always built with LFS support, and the build will fail[4] if that's not available, so all libsmbclient binaries out there have a 64bits
off_t
.All of this to say that without setting the LFS flags in the libsmbclient-go build, we now get this error on 32 bits (armhf below):
I don't know where this would be set in the go build system. Maybe in libsmbclient.go itself, in the
#cgo
header lines?To fix the build of adsys, which uses this project, I did this in the packaging as an experiment:
The text was updated successfully, but these errors were encountered: