public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "kargl at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/42568] BLOCKDATA referenced in EXTERNAL not loading from library
Date: Fri, 01 Jan 2010 02:50:00 -0000	[thread overview]
Message-ID: <20100101024956.31793.qmail@sourceware.org> (raw)
In-Reply-To: <bug-42568-18131@http.gcc.gnu.org/bugzilla/>



------- Comment #3 from kargl at gcc dot gnu dot org  2010-01-01 02:49 -------
(In reply to comment #2)
> Subject: Re:  BLOCKDATA referenced in EXTERNAL not loading from library
> 
> I just got it from the gfortran Wiki because of problems with the previous 
> version I had:
> http://gcc.gnu.org/wiki/GFortranBinaries
>  then the "CygWin" version, which appears to point to
> http://quatramaran.ens.fr/~coudert/gfortran/gfortran-4.5-Cygwin-i686.tar.bz2
> today, anyway.
> 
>  I guess tastes vary.
> We preferred shell scripts when I worked at Cray, HP, SGI, Compaq, and 
> Digital;
> as you otherwise don't know which compiler switches, system level, and so on 
> were used..

Then please attach the script to the bug report.  The web interface
to bugzilla and cut-n-paste plays havoc with whitespace, long lines,
etc.

> It works for me on several Linux boxes as well, just not CygWin. What 
> platform are you on?

FreeBSD on i686 and x86_64.

> I'm curious
> if you do a nm on your libex.a file if juinit2 is type T or B;

% nm libex.a

a2.o:
00000000 B juinit2_
00000000 D qindex2_

> I haven't  used a non-Unix/GNU
> machine for so many years (except for CygWin) I guess it didn't occur to me 
> a shell script
> would be harder, not easier, to use. Some examples in the Wiki of "ideal" 
> bug reports would
> be useful.

The ideal bug report is the shortest source code example that 
exhibits the problem, which you gave us.

The simplest command line used to compile the code that 
exhibits the problem.

If a data file or input is needed, the shortest such data
is desirable.

If the problem is an internal compiler error or segfault of
the compiler, include the last several lines that appear
on the terminal.

If it's a runtime problem, either give the abort message
or error message, or tell us what the expected output
should have been.

> Note I just upgraded my CygWin a few days ago, to version 1.7;

This is my suspicion.  There's a problem with the new cygwin.

> (and G77 and G95) on CygWin; but a recent Vista upgrade broke CygWin (the 
> X11 windows
> were a bit fragile on Vista anyway). It still builds with G95, and an older 
> version still builds with G77.
> 
> PS: I found it surprising that if I just compiled the main program I didn't 
> get a warning about >unsatisified external JUINIT2; I did with every other
> compiler I tried.

I don't know much about how BLOCK DATA and COMMON are implemented.
But, it looks like the compiler is simply eliminating the symbol
as dead code.

% gfc4x -o z a1.f
% nm z | grep -i juin
% nm a1.o
00000000 t MAIN__
         U _gfortran_compare_string
         U _gfortran_set_args
         U _gfortran_set_options
         U _gfortran_st_write
         U _gfortran_st_write_done
         U _gfortran_transfer_array
         U _gfortran_transfer_character
00000197 T main
00000060 r options.4.1509
00000019 C qindex2_

AFAIK, there is no constraint in the Standard that something
marked by EXTERNAL must be referenced.

> It was also odd that
> if I put a no-op subroutine in the same file as the BLOCKDATA file and then 
> called it from the main
> program that the BLOCKDATA was then initialized properly.

That is strange.  It seems to be a linker problem.  I suspect that
you may need to ping the cygwin guys.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42568


  parent reply	other threads:[~2010-01-01  2:50 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-31 23:06 [Bug fortran/42568] New: " urbanjost at comcast dot net
2010-01-01  0:46 ` [Bug fortran/42568] " kargl at gcc dot gnu dot org
2010-01-01  1:57 ` urbanjost at comcast dot net
2010-01-01  2:50 ` kargl at gcc dot gnu dot org [this message]
2010-01-01  6:23 ` jvdelisle at gcc dot gnu dot org
2010-01-01  6:36 ` jvdelisle at gcc dot gnu dot org
2010-01-02  7:50 ` urbanjost at comcast dot net
2010-01-04  3:25 ` jvdelisle at gcc dot gnu dot org
2010-01-04  3:40 ` jvdelisle at gcc dot gnu dot org
2010-01-04  3:52 ` jvdelisle at gcc dot gnu dot org
2010-01-04  9:44 ` [Bug fortran/42568] [Cygwin] " burnus at gcc dot gnu dot org
2010-01-04 15:43 ` davek at gcc dot gnu dot org
2010-01-04 16:06 ` dominiq at lps dot ens dot fr
2010-01-04 16:13 ` kargl at gcc dot gnu dot org
2010-01-04 16:36 ` davek at gcc dot gnu dot org
2010-01-04 17:14 ` kargl at gcc dot gnu dot org
2010-01-04 18:05 ` davek at gcc dot gnu dot org
2010-01-04 18:06 ` davek at gcc dot gnu dot org
2010-01-04 18:57 ` kargl at gcc dot gnu dot org
2010-01-05  3:01 ` jvdelisle at gcc dot gnu dot org
2010-01-05 14:46 ` burnus at gcc dot gnu dot org
2010-01-05 16:10 ` ian at airs dot com
2010-01-05 18:13 ` dominiq at lps dot ens dot fr
2010-01-16 23:18 ` kargl at gcc dot gnu dot org
2010-01-16 23:47 ` kargl at gcc dot gnu dot org

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=20100101024956.31793.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).