bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/4] Avoid multiple definitions of copy_file_range


From: Manolo de Medici
Subject: Re: [PATCH 2/4] Avoid multiple definitions of copy_file_range
Date: Wed, 17 Jan 2024 15:47:09 +0100

Hello Samuel,
the presence of the qemu stub causes the following compilation error:

FAILED: libblock.fa.p/block_file-posix.c.o
cc -m32 -Ilibblock.fa.p -I. -I../../.. -Iqapi -Itrace -Iui -Iui/shader
-Iblock -I/usr/include/glib-2.0 -I/usr/lib/i386-gnu/glib-2.0/include
-fdiagnostics-color=auto -Wall -Winvalid-pch -std=gnu11 -O0 -g
-fstack-protector-strong -Wundef -Wwrite-strings -Wmissing-prototypes
-Wstrict-prototypes -Wredundant-decls -Wold-style-declaration
-Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k
-Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs
-Wendif-labels -Wexpansion-to-defined -Wimplicit-fallthrough=2
-Wmissing-format-attribute -Wno-missing-include-dirs
-Wno-shift-negative-value -Wno-psabi -Wshadow=local -iquote . -iquote
/root/qemu -iquote /root/qemu/include -iquote
/root/qemu/host/include/i386 -iquote /root/qemu/host/include/generic
-iquote /root/qemu/tcg/i386 -pthread -D_GNU_SOURCE
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing
-fno-common -fwrapv -fPIE -MD -MQ libblock.fa.p/block_file-posix.c.o
-MF libblock.fa.p/block_file-posix.c.o.d -o
libblock.fa.p/block_file-posix.c.o -c ../../../block/file-posix.c
../../../block/file-posix.c: In function 'probe_logical_blocksize':
../../../block/file-posix.c:310:13: warning: implicit declaration of
function 'ioctl' [-Wimplicit-function-declaration]
  310 |         if (ioctl(fd, ioctl_list[i], &sector_size) >= 0) {
      |             ^~~~~
../../../block/file-posix.c:310:13: warning: nested extern declaration
of 'ioctl' [-Wnested-externs]
../../../block/file-posix.c: At top level:
../../../block/file-posix.c:2003:14: error: conflicting types for
'copy_file_range'; have 'off_t(int,  off_t *, int,  off_t *, size_t,
unsigned int)' {aka 'long long int(int,  long long int *, int,  long
long int *, unsigned int,  unsigned int)'}
 2003 | static off_t copy_file_range(int in_fd, off_t *in_off, int out_fd,
      |              ^~~~~~~~~~~~~~~
In file included from /root/qemu/include/qemu/osdep.h:122,
                 from ../../../block/file-posix.c:25:
/usr/include/unistd.h:1142:9: note: previous declaration of
'copy_file_range' with type 'ssize_t(int,  __off64_t *, int,
__off64_t *, size_t,  unsigned int)' {aka 'int(int,  long long int *,
int,  long long int *, unsigned int,  unsigned int)'}
 1142 | ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
      |         ^~~~~~~~~~~~~~~

the current patch fixes this compilation error.

The resulting binary is the same as it would have been with only the qemu patch,
so I'm assuming that it is fully functional. Although I cannot be 100%
sure about that.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]