[PATCH] gprofng: 30889 can't compile without large file support

Vladimir Mezentsev vladimir.mezentsev@oracle.com
Fri Jan 12 19:49:42 GMT 2024


On 1/10/24 21:53, Mike Frysinger wrote:
> can't you put this in a single header file (gprof.h?) instead of 
> duplicating
> the boilerplate in a bunch of files ?
> -mike


On 1/12/24 01:20, Andreas Schwab wrote:
> If you are using open64 you don't need O_LARGEFILE at all.  An autoconf
> check is overkill anyway, you can just use #ifdef.

Agree with both comments.

Please review the new fix below.


gprofng/src/util.h is included in all files where we use O_LARGEFILE,
and is always included after <fcntl.h> where O_LARGEFILE may be defined.


gprofng/ChangeLog
2024-01-12  Vladimir Mezentsev <vladimir.mezentsev@oracle.com>

     PR 30889
     * src/util.h (O_LARGEFILE): Define to 0, if not defined.
---
  gprofng/src/util.h | 4 ++++
  1 file changed, 4 insertions(+)

diff --git a/gprofng/src/util.h b/gprofng/src/util.h
index c6382aab5bb..cbbc2f7e118 100644
--- a/gprofng/src/util.h
+++ b/gprofng/src/util.h
@@ -32,6 +32,10 @@
  #include "i18n.h"
  #include "debug.h"

+#ifndef O_LARGEFILE
+#define O_LARGEFILE 0
+#endif
+
  #define SWAP_ENDIAN(x)  swapByteOrder((void *) (&(x)), sizeof(x))
  #define AppendString(len, arr, ...) len += snprintf(arr + len, 
sizeof(arr) - len, __VA_ARGS__)
  #define ARR_SIZE(x)     (sizeof (x) / sizeof (*(x)))
-- 
2.31.1



More information about the Binutils mailing list