Skip to contentSkip to conversation

cobalt: allow to compile without __USE_LARGEFILE64

PATCH Applied Norbert Lange 2 participants 4 messages Apr 17, 2020 – Apr 20, 2020

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 cobalt: allow to compile without __USE_LARGEFILE64

A header uses the off64_t which is only conditionally available, causing compile failures.
The macro might be necessary to compile cobalt libraries, but should not be needed for software depending on them.

---
 include/cobalt/sys/mman.h | 2 ++
 1 file changed, 2 insertions(+)
include/cobalt/sys/mman.h +2 -0
index 1c47777a2..75a00da0c 100644
@@ -31,8 +31,10 @@ extern "C" {
 COBALT_DECL(void *, mmap(void *addr, size_t length, int prot, int flags,
 			 int fd, off_t offset));
 
+#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
 COBALT_DECL(void *, mmap64(void *addr, size_t length, int prot, int flags,
 			   int fd, off64_t offset));
+#endif
 
 #ifdef __cplusplus
 }
Signature · 1 line
2.26.1
Applied
#1 lore raw
Quoted 16 lines · Norbert Lange via Xenomai

A header uses the off64_t which is only conditionally available, causing compile failures.
The macro might be necessary to compile cobalt libraries, but should not be needed for software depending on them.

---
  include/cobalt/sys/mman.h | 2 ++
  1 file changed, 2 insertions(+)
include/cobalt/sys/mman.h +0 -0
index 1c47777a2..75a00da0c 100644

include/cobalt/sys/mman.h extern "C" { · line 40

Quoted 10 lines
include/cobalt/sys/mman.h +2 -0
@@ -31,8 +31,10 @@ extern "C" {
  COBALT_DECL(void *, mmap(void *addr, size_t length, int prot, int flags,
  			 int fd, off_t offset));
 
+#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
  COBALT_DECL(void *, mmap64(void *addr, size_t length, int prot, int flags,
  			   int fd, off64_t offset));
+#endif
 
  #ifdef __cplusplus
  }

Thanks, applied.

A "From:" line in the message would be nice to avoid that the authorship goes to [email protected].

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
#2 lore raw

Well, I dont think 1-2 lines of a preprocessor checks count as some kind of intellectual work.
I wouldn't think that way if I take some pretty much known math formula from wikipedia.

Norbert

Am So., 19. Apr. 2020 um 11:22 Uhr schrieb Jan Kiszka <[email protected]>:

Quoted 39 lines · Norbert Lange via Xenomai
Quoted 16 lines

A header uses the off64_t which is only conditionally available, causing compile failures.
The macro might be necessary to compile cobalt libraries, but should not be needed for software depending on them.

---
  include/cobalt/sys/mman.h | 2 ++
  1 file changed, 2 insertions(+)
include/cobalt/sys/mman.h +0 -0
index 1c47777a2..75a00da0c 100644

include/cobalt/sys/mman.h extern "C" { · line 40

Quoted 10 lines
include/cobalt/sys/mman.h +2 -0
@@ -31,8 +31,10 @@ extern "C" {
  COBALT_DECL(void *, mmap(void *addr, size_t length, int prot, int flags,
                       int fd, off_t offset));
 
+#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
  COBALT_DECL(void *, mmap64(void *addr, size_t length, int prot, int flags,
                         int fd, off64_t offset));
+#endif
 
  #ifdef __cplusplus
  }

Thanks, applied.

A "From:" line in the message would be nice to avoid that the authorship goes to [email protected].

Jan

--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux

#3 lore raw
Quoted 4 lines · Norbert Lange

Well, I dont think 1-2 lines of a preprocessor checks count as some kind of intellectual work.
I wouldn't think that way if I take some pretty much known math formula from wikipedia.

This is just a convenience topic for the maintainer. In fact, he already has tooling to remind him of fixing up this primarily cosmetic issue prior to applying a patch.

Jan

Quoted 43 lines

Norbert

Am So., 19. Apr. 2020 um 11:22 Uhr schrieb Jan Kiszka <[email protected]>:

Quoted 39 lines · Norbert Lange via Xenomai
Quoted 16 lines

A header uses the off64_t which is only conditionally available, causing compile failures.
The macro might be necessary to compile cobalt libraries, but should not be needed for software depending on them.

---
   include/cobalt/sys/mman.h | 2 ++
   1 file changed, 2 insertions(+)
include/cobalt/sys/mman.h +0 -0
index 1c47777a2..75a00da0c 100644

include/cobalt/sys/mman.h extern "C" { · line 40

Quoted 10 lines
include/cobalt/sys/mman.h +2 -0
@@ -31,8 +31,10 @@ extern "C" {
   COBALT_DECL(void *, mmap(void *addr, size_t length, int prot, int flags,
                        int fd, off_t offset));
 
+#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
   COBALT_DECL(void *, mmap64(void *addr, size_t length, int prot, int flags,
                          int fd, off64_t offset));
+#endif
 
   #ifdef __cplusplus
   }

Thanks, applied.

A "From:" line in the message would be nice to avoid that the authorship goes to [email protected].

Jan

--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux

Signature · 2 lines
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux