From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12654 invoked by alias); 2 Sep 2011 22:35:03 -0000 Received: (qmail 12399 invoked by uid 22791); 2 Sep 2011 22:35:02 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_EH X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 02 Sep 2011 22:34:48 +0000 From: "riddle00 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/50149] loader error with source containing common blocks Date: Fri, 02 Sep 2011 22:35:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: X-Bugzilla-Severity: major X-Bugzilla-Who: riddle00 at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-09/txt/msg00176.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D50149 --- Comment #3 from Behzad Salimi 2011-09-02 22= :34:27 UTC --- Hello, Thank you very much for your reply and help. Your example pointed me to the clue to find the error in my source: evidently, a /name/ block is required even when the "name" is empty, i.e., "common // ...", my source had "common i, j, k, ..." this is not allowed! What is surprising is that no compiler error or warning was generated while the loader complained! I had expected to get a compiler error if the "common /name/ ..." format is strictly required. Perhaps you could make a note to cause a compiler error in your future distributions. Problem is solved and I thank you very much for your assistance. You can delete my original bug report as resolved and perhaps mark it as a remark for a future compiler improvement. Take care, Behzad. On Mon, Aug 22, 2011 at 6:38 AM, burnus at gcc dot gnu.org wrote: > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D50149 > > Tobias Burnus changed: > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 What =C2=A0 =C2=A0|Removed =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |Added > -------------------------------------------------------------------------= --- > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 CC| =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0|burnus at gcc dot gnu.org > > --- Comment #1 from Tobias Burnus 2011-08-22 = 13:38:45 UTC --- > (In reply to comment #0) >> =C2=A0System Version: Mac OS X 10.6.8 (10K549), Kernel Version: Darwin 1= 0.8.0 >> gcc/gfortran version 4.6.1 >> >> ld: duplicate symbol ___BLNK__ in obj/trajectory.o and obj/integral.o >> collect2: ld returned 1 exit status > > As written, I cannot reproduce the problem on Linux. Can you create a min= imal > example which reproduces this error and attach it, stating exactly the > command-line options you used? > > > For instance, the following example works for me on Linux with no special > options and with the options you used. > > As expected, I get in the object files the blank common ("common // ..."), > namely "nm" shows the __BLNK__ symbol in both files: > =C2=A00000000000000008 C __BLNK__ > However, as the "C" indicates, the data is in common and thus should not > produce any error message if it exists in multiple object files. > > What do you get if you run "nm obj/trajectory.o |grep __BLNK__" and "nm > obj/integral.o |grep __BLNK__"? > > > ! --------- file1.f90 --------- > subroutine foo > =C2=A0integer :: i > =C2=A0common // i > end subroutine foo > > ! --------- file2.f90 --------- > subroutine bar > =C2=A0integer :: j > =C2=A0common // j > end subroutine bar > > call foo() > call bar() > end > > -- > Configure bugmail: http://gcc.gnu.org/bugzilla/userprefs.cgi?tab=3Demail > ------- You are receiving this mail because: ------- > You reported the bug. >