From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25131 invoked by alias); 28 Mar 2008 17:45:34 -0000 Received: (qmail 25118 invoked by uid 22791); 28 Mar 2008 17:45:34 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 28 Mar 2008 17:45:14 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m2SHjDsZ015069; Fri, 28 Mar 2008 13:45:13 -0400 Received: from zebedee.pink (vpn-14-25.rdu.redhat.com [10.11.14.25]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m2SHjBpb018038; Fri, 28 Mar 2008 13:45:12 -0400 Message-ID: <47ED2EA7.7050406@redhat.com> Date: Fri, 28 Mar 2008 17:45:00 -0000 From: Andrew Haley User-Agent: Thunderbird 2.0.0.12 (X11/20080213) MIME-Version: 1.0 To: Lorenzo Pesce CC: gcc-help@gcc.gnu.org Subject: Re: Issue on X86_64? References: <4082B87F-8FC7-42FC-A5CE-EDC6A055621B@uchicago.edu> <47EA1F49.7000107@redhat.com> <00E58A22-C959-4750-9320-78F023BD5879@uchicago.edu> In-Reply-To: <00E58A22-C959-4750-9320-78F023BD5879@uchicago.edu> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2008-03/txt/msg00279.txt.bz2 Lorenzo Pesce wrote: > Thanks a lot for your kinds replied Andrew, > >>> However, when I get to X86 (whether Intel or AMD) it does not work >>> anymore. I can compile the files, and build the static library libroc.a. >>> It works fine and I can move it from AMD to intel (not the other way >>> around, but I assume it is a problem with my installation). However, >>> when I try to build a dynamically linked library, gcc complains that >>> "Relocation R_X86_64_32 against 'a local symbol' can not be used >>> when making a share object; recompile with -fPIC" >>> then it tells me it can't read symbols .o because it is a bad value. >> >> You need to compile everything that goes into a dynamically linked >> library with -fPIC. > > I have to admit my ignorance on compilers building, but once i > download unpack and so on the gcc compiler package, I can't > figure out in which of the hundreds of lines of the various makefiles > or configuration files I should put the -fPIC flag. Don't mess with gcc's makefiles. gcc already builds all of its files correctly. When you use gcc to build *your* libraries, *you* must compile everything with -fPIC. Andrew.