Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eiKcv-0008LM-QY for pgsql-bugs@arkaria.postgresql.org; Sun, 04 Feb 2018 13:46:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eiKcu-0002EI-9i for pgsql-bugs@arkaria.postgresql.org; Sun, 04 Feb 2018 13:46:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eiKEq-0005Ut-Od for pgsql-bugs@lists.postgresql.org; Sun, 04 Feb 2018 13:21:44 +0000 Received: from mail-out.m-online.net ([212.18.0.9]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eiKEn-0003xH-Gg for pgsql-bugs@postgresql.org; Sun, 04 Feb 2018 13:21:43 +0000 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 3zZBFb36ycz1qtdf for ; Sun, 4 Feb 2018 14:21:39 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 3zZBFb1Tvgz1sQxJ for ; Sun, 4 Feb 2018 14:21:39 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id ehvC47m7QukV for ; Sun, 4 Feb 2018 14:21:38 +0100 (CET) Received: from io.ax.lt (ppp-93-104-126-193.dynamic.mnet-online.de [93.104.126.193]) by mail.mnet-online.de (Postfix) with ESMTP for ; Sun, 4 Feb 2018 14:21:38 +0100 (CET) Received: from ganymed (unknown [192.168.1.195]) by io.ax.lt (Postfix) with ESMTP id 3056643C7F for ; Sun, 4 Feb 2018 14:21:38 +0100 (CET) Message-ID: <1517750498.1357.24.camel@linuxfromscratch.org> Subject: Compile issue with glibc-2.27 (copy_file_range) From: Thomas Trepl To: pgsql-bugs@postgresql.org Date: Sun, 04 Feb 2018 14:21:38 +0100 Content-Type: multipart/mixed; boundary="=-7L39Ys3qM3ehKIyUvtca" X-Mailer: Evolution 3.26.4 Mime-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --=-7L39Ys3qM3ehKIyUvtca Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Hi, according to changlelog of glibc-2.27 they introduced a new function named "copy_file_range". There is a static function in src/bin/pg_rewind/copy_fetch.c with the same name and therefore compilation fails with >>>>>>>> gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after- statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -I../../../src/interfaces/libpq -DFRONTEND -I../../../src/include - D_GNU_SOURCE -c -o copy_fetch.o copy_fetch.c copy_fetch.c:159:1: Fehler: In Konflikt stehende Typen für »copy_file_range« copy_file_range(const char *path, off_t begin, off_t end, bool trunc) ^~~~~~~~~~~~~~~ In file included from copy_fetch.c:15:0: /usr/include/unistd.h:1110:9: Anmerkung: Vorherige Deklaration von »copy_file_range« war hier ssize_t copy_file_range (int __infd, __off64_t *__pinoff, ^~~~~~~~~~~~~~~ make[3]: *** [: copy_fetch.o] Fehler 1 make[3]: Verzeichnis „/tmp/postgresql/build/postgresql- 10.1/src/bin/pg_rewind“ wird verlassen make[2]: *** [Makefile:40: all-pg_rewind-recurse] Fehler 2 make[2]: Verzeichnis „/tmp/postgresql/build/postgresql-10.1/src/bin“ wird verlassen make[1]: *** [Makefile:37: all-bin-recurse] Fehler 2 make[1]: Verzeichnis „/tmp/postgresql/build/postgresql-10.1/src“ wird verlassen make: *** [GNUmakefile:11: all-src-recurse] Fehler 2 <<<<<<<< Since postgresql's copy_file_range is static/local to only one file, its easy to fix: sed -e "s/copy_file_range/pg_&/" \ -i src/bin/pg_rewind/copy_fetch.c which renames "copy_file_range" to "pg_copy_file_range". Find attached a patch doing the same. System: Linux (LFS 20180202) glibc: 2.27 gcc: 7.3 Kernel: 4.15.1 PgSql: 10.1 -- Thomas --=-7L39Ys3qM3ehKIyUvtca Content-Disposition: attachment; filename="postgresql-10.1-fix_glibc_clash-1.patch" Content-Type: text/x-patch; name="postgresql-10.1-fix_glibc_clash-1.patch"; charset="UTF-8" Content-Transfer-Encoding: base64 ZGlmZiAtTmF1ciBwb3N0Z3Jlc3FsLTEwLjEub3JpZy9zcmMvYmluL3BnX3Jld2luZC9jb3B5X2Zl dGNoLmMgcG9zdGdyZXNxbC0xMC4xL3NyYy9iaW4vcGdfcmV3aW5kL2NvcHlfZmV0Y2guYwotLS0g cG9zdGdyZXNxbC0xMC4xLm9yaWcvc3JjL2Jpbi9wZ19yZXdpbmQvY29weV9mZXRjaC5jCTIwMTct MTEtMDcgMDE6NDY6NTIuMDAwMDAwMDAwICswMTAwCisrKyBwb3N0Z3Jlc3FsLTEwLjEvc3JjL2Jp bi9wZ19yZXdpbmQvY29weV9mZXRjaC5jCTIwMTgtMDItMDQgMTM6NTU6MjIuNDE3MTYyOTYxICsw MTAwCkBAIC0xNTYsNyArMTU2LDcgQEAKICAqIElmICd0cnVuYycgaXMgdHJ1ZSwgYW55IGV4aXN0 aW5nIGZpbGUgd2l0aCB0aGUgc2FtZSBuYW1lIGlzIHRydW5jYXRlZC4KICAqLwogc3RhdGljIHZv aWQKLWNvcHlfZmlsZV9yYW5nZShjb25zdCBjaGFyICpwYXRoLCBvZmZfdCBiZWdpbiwgb2ZmX3Qg ZW5kLCBib29sIHRydW5jKQorcGdfY29weV9maWxlX3JhbmdlKGNvbnN0IGNoYXIgKnBhdGgsIG9m Zl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