Skip to content

Commit

Permalink
lib: unconditionally set -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mvo5 committed Jun 3, 2022
1 parent f9fa2a5 commit 47df0ef
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions libsmbclient_lfs.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//go:build 386 || arm
// +build 386 arm

package libsmbclient

/*
#cgo CFLAGS: -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
*/
import "C"

0 comments on commit 47df0ef

Please sign in to comment.