public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew Haley <aph@redhat.com>
To: Lorenzo Pesce <lpesce@uchicago.edu>
Cc: gcc-help@gcc.gnu.org
Subject: Re: Issue on X86_64?
Date: Fri, 28 Mar 2008 18:07:00 -0000	[thread overview]
Message-ID: <47ED33BC.2000806@redhat.com> (raw)
In-Reply-To: <E92CB149-D1B2-45C5-85C1-16354F5165E2@uchicago.edu>

Lorenzo Pesce wrote:
> 
> On Mar 28, 2008, at 12:45 PM, Andrew Haley wrote:
> 
>> 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.
> 
> I already do that. The problem is with libgfortran.* not with my libraries!

Now you tell me.  Have a look at the gcc build log to see if it really
did compile some of the libgfortran sources without -fPIC.

> Java seems to need the object files from libgfortran for the JNI
> libraries to work properly

No it doesn't.

> so I need
> libgfortran to be compiled with -fPIC to link them into the jni library.
> My libraries have always been built with -fPIC,
> it is libgfortran that is breaking on the x86_64, not my libraries.
> 
> Does it make sense?

No.  Java does not depend on libgfortran, or at least it certainly doesn't
on any system I have ever seem.

If you find somewhere it does, please make a test case that we can try.

Andrew.

  reply	other threads:[~2008-03-28 18:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-25 21:06 Lorenzo Pesce
2008-03-26 10:03 ` Andrew Haley
2008-03-28 17:20   ` Lorenzo Pesce
2008-03-28 17:45     ` Andrew Haley
2008-03-28 17:57       ` Lorenzo Pesce
2008-03-28 18:07         ` Andrew Haley [this message]
2008-03-28 18:41           ` Lorenzo Pesce
2008-03-28 19:55             ` Andrew Haley
2008-03-28 22:31               ` Lorenzo Pesce
2008-03-28 22:51                 ` David Daney
     [not found] <20080328191557.BDJ30009@m4500-01.uchicago.edu>
2008-03-29  1:02 ` David Daney
2008-03-29  3:21 Lorenzo Pesce
2008-03-29  4:17 ` Ian Lance Taylor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47ED33BC.2000806@redhat.com \
    --to=aph@redhat.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=lpesce@uchicago.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).