From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Burton Samograd Newsgroups: gmane.emacs.devel Subject: Re: Build problem: Error: symbol `pread64' is already defined Date: Sat, 10 Nov 2012 13:17:36 -0700 Message-ID: <87lie9rz4v.fsf@samograd.ca> References: <5096A983.5080807@gmail.com> <5096AA31.9020005@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1352579707 560 80.91.229.3 (10 Nov 2012 20:35:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 10 Nov 2012 20:35:07 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Nov 10 21:35:15 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TXHlq-0002QP-12 for ged-emacs-devel@m.gmane.org; Sat, 10 Nov 2012 21:35:14 +0100 Original-Received: from localhost ([::1]:58039 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXHlg-0004fa-IX for ged-emacs-devel@m.gmane.org; Sat, 10 Nov 2012 15:35:04 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:43191) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXHlb-0004dQ-Fp for emacs-devel@gnu.org; Sat, 10 Nov 2012 15:35:02 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TXHlY-0008F2-C8 for emacs-devel@gnu.org; Sat, 10 Nov 2012 15:34:59 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:59310) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXHlY-0008En-1w for emacs-devel@gnu.org; Sat, 10 Nov 2012 15:34:56 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TXHlf-0002JK-Q6 for emacs-devel@gnu.org; Sat, 10 Nov 2012 21:35:03 +0100 Original-Received: from samograd.ca ([69.90.114.176]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 10 Nov 2012 21:35:03 +0100 Original-Received: from burton by samograd.ca with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 10 Nov 2012 21:35:03 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 110 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: samograd.ca User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) Cancel-Lock: sha1:ee422LyjEq49ZCZljzKOsiS1xmw= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:154808 Archived-At: Burton Samograd writes: > On 12-11-04 10:44 AM, Burton Samograd wrote: >> Hello, >> >> I'm trying to build the current emacs git HEAD on one of my machines >> (Centos 5.8 on a VM host so I can't update it to a newer version) >> and I keep getting the following error: >> >> gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I/root/src/emacs-git/lib >> -I../src -I/root/src/emacs-git/src -g3 -O2 -MT careadlinkat.o -MD >> -MP -MF .deps/careadlinkat.Tpo -c -o careadlinkat.o careadlinkat.c >> /tmp/cc2jQqUg.s: Assembler messages: >> /tmp/cc2jQqUg.s:122: Error: symbol `pread64' is already defined >> >> From what I can see this looks to be an issue with my libc headers >> (unistd.h most directly I think) . The glibc on this system is >> 2.5.81.el5_8.7 and I've recently done a 'yum update' to the current >> release for this Centos version. >> >> I've done a side by side comparison of the section of unistd.h on >> two machines, one a current Ubuntu and the Centos one that is having >> problems; they are almost close to identical with only a 'if >> defined' guard that should have nothing to do with with the systems >> I am running on (I hope). >> >> I've also updated my gcc to 4.7.2, the current release. >> >> Any ideas on what might be causing this build problem on this >> specific machine and not others? This isn't just with the current >> HEAD, but it's been going on for a few weeks now; I'm just finally >> getting around to reporting it. >> >> -- >> Burton Samograd >> > I'd like to add that I have been able to build emacs git HEAD on this > machine in the past, maybe about a month ago. This looks to be a problem with newer versions of gcc combined with the libc of Centos 5.8, and something to do with definitions in my generated emacs config.h. If I compile using the system compiler (/usr/bin/gcc) I have no problems building, but when I use my upgraded gcc I get the message about the duplicate decleration of 'pread64'. If I comment out config.h and use the upgraded compiler tom compile careadlink.c I get no errors. The following is the contents of unistd.h that contains any references to pread64: ------------------------- unistd.h --------------------------------- #ifdef __USE_UNIX98 # ifndef __USE_FILE_OFFSET64 /* Read NBYTES into BUF from FD at the given position OFFSET without changing the file pointer. Return the number read, -1 for errors or 0 for EOF. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off_t __offset) __wur; /* Write N bytes of BUF to FD at the given position OFFSET without changing the file pointer. Return the number written, or -1. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t pwrite (int __fd, __const void *__buf, size_t __n, __off_t __offset) __wur; # else # ifdef __REDIRECT extern ssize_t __REDIRECT (pread, (int __fd, void *__buf, size_t __nbytes, __off64_t __offset), pread64) __wur; extern ssize_t __REDIRECT (pwrite, (int __fd, __const void *__buf, size_t __nbytes, __off64_t __offset), pwrite64) __wur; # else # define pread pread64 # define pwrite pwrite64 # endif # endif # ifdef __USE_LARGEFILE64 /* Read NBYTES into BUF from FD at the given position OFFSET without changing the file pointer. Return the number read, -1 for errors or 0 for EOF. */ extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) __wur; /* Write N bytes of BUF to FD at the given position OFFSET without changing the file pointer. Return the number written, or -1. */ extern ssize_t pwrite64 (int __fd, __const void *__buf, size_t __n, __off64_t __offset) __wur; # endif #endif ------------------------- unistd.h --------------------------------- None of __USE_UNIX98, __USE_FILE_OFFSET64 nor __USE_LARGEFILE64 are defined by config.h, although _FILE_OFFSET_BITS is defined to 64 so this will probably cause __USE_LARGEFILE64 to be defined later. For now I'll just use the system compiler. This is a tricky bug to track down what exactly is going wrong and who's bug it actually is given the age of the CentOS distro and the newness of the compiler. But for now things are working and I'll just stick with using the system compiler. -- Burton Samograd