* [RFC PATCH] kbuild: Enable Large File Support for hostprogs
@ 2015-05-11 1:16 Ben Hutchings
2017-06-29 9:26 ` [RFC] " Uwe Kleine-König
0 siblings, 1 reply; 2+ messages in thread
From: Ben Hutchings @ 2015-05-11 1:16 UTC (permalink / raw)
To: linux-kbuild; +Cc: 778942
[-- Attachment #1: Type: text/plain, Size: 1044 bytes --]
Some programs built on a 32-bit host need Large File Support (LFS).
Regardless of whether any of them need to deal with large files,
non-LFS *stat() functions don't work at all on an XFS volume with
64-bit inodes.
References: https://bugs.debian.org/778942
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index fbd43bf..a6fb432 100644
--- a/Makefile
+++ b/Makefile
@@ -297,7 +297,7 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
HOSTCC = gcc
HOSTCXX = g++
-HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89
+HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
HOSTCXXFLAGS = -O2
ifeq ($(shell $(HOSTCC) -v 2>&1 | grep -c "clang version"), 1)
--
Ben Hutchings
For every action, there is an equal and opposite criticism. - Harrison
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [RFC] kbuild: Enable Large File Support for hostprogs
2015-05-11 1:16 [RFC PATCH] kbuild: Enable Large File Support for hostprogs Ben Hutchings
@ 2017-06-29 9:26 ` Uwe Kleine-König
0 siblings, 0 replies; 2+ messages in thread
From: Uwe Kleine-König @ 2017-06-29 9:26 UTC (permalink / raw)
To: Ben Hutchings; +Cc: linux-kbuild, 778942
[-- Attachment #1: Type: text/plain, Size: 2134 bytes --]
Hello Ben,
On Mon, May 11, 2015 at 02:16:52AM +0100, Ben Hutchings wrote:
> Some programs built on a 32-bit host need Large File Support (LFS).
> Regardless of whether any of them need to deal with large files,
> non-LFS *stat() functions don't work at all on an XFS volume with
> 64-bit inodes.
>
> References: https://bugs.debian.org/778942
> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> ---
> Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Makefile b/Makefile
> index fbd43bf..a6fb432 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -297,7 +297,7 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
>
> HOSTCC = gcc
> HOSTCXX = g++
> -HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89
> +HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
> HOSTCXXFLAGS = -O2
I think we need the same for HOSTCXXFLAGS?
Also I wonder if this would be a better approach:
diff --git a/Makefile b/Makefile
index e40c471abe29..d9dd5db0abce 100644
--- a/Makefile
+++ b/Makefile
@@ -301,9 +301,15 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
else if [ -x /bin/bash ]; then echo /bin/bash; \
else echo sh; fi ; fi)
+HOST_LFS_CFLAGS := $(getconf LFS_CFLAGS)
+HOST_LFS_LDFLAGS := $(getconf LFS_LDFLAGS)
+HOST_LFS_LIBS := $(getconf LFS_LIBS)
+
HOSTCC = gcc
HOSTCXX = g++
-HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89
+HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89 $(HOST_LFS_CFLAGS)
+HOSTLDFLAGS = $(HOST_LFS_LDFLAGS)
+HOSTLOADLIBES = $(HOST_LFS_LIBS)
-HOSTCXXFLAGS = -O2
+HOSTCXXFLAGS = -O2 $(HOST_LFS_CFLAGS)
ifeq ($(shell $(HOSTCC) -v 2>&1 | grep -c "clang version"), 1)
HOSTCFLAGS += -Wno-unused-value -Wno-unused-parameter \
but note, that HOSTLDFLAGS and HOSTLOADLIBES doesn't seem to be picked
up.
Best regards
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-06-29 9:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-11 1:16 [RFC PATCH] kbuild: Enable Large File Support for hostprogs Ben Hutchings
2017-06-29 9:26 ` [RFC] " Uwe Kleine-König
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.