public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* libgfortran.a and libgfortran.so
@ 2012-08-07  6:41 benzhi cao
  2012-08-08  0:55 ` Ian Lance Taylor
  0 siblings, 1 reply; 3+ messages in thread
From: benzhi cao @ 2012-08-07  6:41 UTC (permalink / raw)
  To: gcc-help

Hi,
    recently I use the gcc 4.4 to  compile  fortran programs.and then
I use ld to link these programs .But the ELF I get is a dynamic link
file.However I want to link these files statically for the reason that
I want the VirtAdd of LOAD to be determined in an ELF,so I use the
-Bstatic -lgfortran. But some problems occurs,and it means that some
libraries cannot be found.So I see the files in the gcc directory. I
find there is a libgfortran.a and libgfortran.so as well.And I know
the former is a static library and the latter is a shared library.But
what is the difference between them and how can I just use the
libgfortran.a to link the fortran programs.
    The  follows is the errors when i use the -Bstatic -lgfortran:
/usr/lib/gcc/x86_64-linux-gnu/4.4//libgfortran.a(compile_options.o):
In function `_gfortran_set_options':
(.text+0x165): undefined reference to `signal'
/usr/lib/gcc/x86_64-linux-gnu/4.4//libgfortran.a(compile_options.o):
In function `_gfortran_set_options':
(.text+0x174): undefined reference to `signal'
/usr/lib/gcc/x86_64-linux-gnu/4.4//libgfortran.a(compile_options.o):
In function `_gfortran_set_options':
(.text+0x183): undefined reference to `signal'
/usr/lib/gcc/x86_64-linux-gnu/4.4//libgfortran.a(compile_options.o):
In function `_gfortran_set_options':
    Hope anyone can help me ,thanks in advance~
Best~

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: libgfortran.a and libgfortran.so
  2012-08-07  6:41 libgfortran.a and libgfortran.so benzhi cao
@ 2012-08-08  0:55 ` Ian Lance Taylor
  0 siblings, 0 replies; 3+ messages in thread
From: Ian Lance Taylor @ 2012-08-08  0:55 UTC (permalink / raw)
  To: benzhi cao; +Cc: gcc-help

On Mon, Aug 6, 2012 at 11:41 PM, benzhi cao <caobenzhi0915@gmail.com> wrote:

>     The  follows is the errors when i use the -Bstatic -lgfortran:

-Bstatic will make everything following static, including the C
library.  Try -Bstatic -lgfortran -Bdynamic.

Ian

^ permalink raw reply	[flat|nested] 3+ messages in thread

* libgfortran.a and libgfortran.so
@ 2012-08-07  6:46 benzhi cao
  0 siblings, 0 replies; 3+ messages in thread
From: benzhi cao @ 2012-08-07  6:46 UTC (permalink / raw)
  To: gcc-help

Hi,
    recently I use the gcc 4.4 to  compile  fortran programs.and then
I use ld to link these programs .But the ELF I get is a dynamic link
file.However I want to link these files statically for the reason that
I want the VirtAdd of LOAD to be determined in an ELF,so I use the
-Bstatic -lgfortran. But some problems occurs,and it means that some
libraries cannot be found.So I see the files in the gcc directory. I
find there is a libgfortran.a and libgfortran.so as well.And I know
the former is a static library and the latter is a shared library.But
what is the difference between them and how can I just use the
libgfortran.a to link the fortran programs.
    The  follows is the errors when i use the -Bstatic -lgfortran:
/usr/lib/gcc/x86_64-linux-gnu/4.4//libgfortran.a(compile_options.o):
In function `_gfortran_set_options':
(.text+0x165): undefined reference to `signal'
/usr/lib/gcc/x86_64-linux-gnu/4.4//libgfortran.a(compile_options.o):
In function `_gfortran_set_options':
(.text+0x174): undefined reference to `signal'
/usr/lib/gcc/x86_64-linux-gnu/4.4//libgfortran.a(compile_options.o):
In function `_gfortran_set_options':
(.text+0x183): undefined reference to `signal'
/usr/lib/gcc/x86_64-linux-gnu/4.4//libgfortran.a(compile_options.o):
In function `_gfortran_set_options':
    Hope anyone can help me ,thanks in advance~
Best~

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-08-08  0:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-07  6:41 libgfortran.a and libgfortran.so benzhi cao
2012-08-08  0:55 ` Ian Lance Taylor
2012-08-07  6:46 benzhi cao

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).