From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost.localdomain (int-mx1.corp.redhat.com [172.16.52.254]) by listman.redhat.com (Postfix) with ESMTP id CF83F3F04C for ; Tue, 16 Apr 2002 16:03:50 -0400 (EDT) Received: from lacrosse.corp.redhat.com (IDENT:root@lacrosse.corp.redhat.com [172.16.52.154]) by localhost.localdomain (8.11.6/8.11.6) with ESMTP id g3GK3q925530 for ; Tue, 16 Apr 2002 16:03:52 -0400 Received: (from mail@localhost) by lacrosse.corp.redhat.com (8.11.6/8.9.3) id g3GK3qY02041 for axp-list@listman.redhat.com; Tue, 16 Apr 2002 16:03:52 -0400 Received: from localhost.localdomain (int-mx1.corp.redhat.com [172.16.52.254]) by lacrosse.corp.redhat.com (8.11.6/8.9.3) with ESMTP id g3GK3qk02037 for ; Tue, 16 Apr 2002 16:03:52 -0400 Received: from mx1.redhat.com (mx1.redhat.com [172.16.48.31]) by localhost.localdomain (8.11.6/8.11.6) with SMTP id g3GK3q925526 for ; Tue, 16 Apr 2002 16:03:52 -0400 Received: from p4-117-1.mit.edu (P4-117-1.MIT.EDU [18.53.1.61]) by mx1.redhat.com (8.11.6/8.11.6) with SMTP id g3GK04M32356 for ; Tue, 16 Apr 2002 16:00:04 -0400 Received: from localhost ([127.0.0.1] helo=mit.edu) by p4-117-1.mit.edu with esmtp (Exim 3.35 #1 (Debian)) id 16xZB3-0000tq-00; Tue, 16 Apr 2002 16:03:45 -0400 Message-ID: <3CBC83A0.4010206@mit.edu> Date: Tue, 16 Apr 2002 16:03:44 -0400 From: Adam C Powell IV Organization: Massachvsetts Institvte of Technology User-Agent: Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:0.9.9) Gecko/20020414 Debian/0.9.9-6 X-Accept-Language: en MIME-Version: 1.0 To: Debian Alpha , axp-list@redhat.com Subject: Linking C main() to shlibs with Fortran sources using ccc/fort Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Loop: axp-list@redhat.com Sender: axp-list-admin@redhat.com Errors-To: axp-list-admin@redhat.com X-BeenThere: axp-list@redhat.com X-Mailman-Version: 2.0.1 Precedence: bulk Reply-To: axp-list@redhat.com List-Help: List-Post: List-Subscribe: , List-Id: Linux and Red Hat on Alpha processors List-Unsubscribe: , List-Archive: Greetings, I'd like to link some shlibs with some Fortran source to some C programs using the Compaq compilers to compile everything. Trouble is, some of the Fortran objects need symbols like for_write..., which are provided by libfor.so, and that in turn needs this "MAIN__()" symbol, which is *only* provided by an fort-compiled object file with a Fortran PROGRAM statement, it's not in any of the libs which come with fort, nor in for_main.o. I've noticed that if the libs are static, linking works just fine, but if I rebuild objects to shared libs using: ${LD} -shared -soname,$$LIBNAME.${SLSUFFIX} -o $$LIBNAME.${SLSUFFIX} *.o then linking against the resulting shlibs fails with an undefined reference to MAIN__() in libfor.so. Also, if I provide a C function like: void MAIN__() { printf ("hello world\n"); } then it links fine, but hello world is never printed, so the function is never entered. I'd really like to not have to provide this bit of code for this one arch/compiler combo... Is there a way to do this? Thanks, -- -Adam P. GPG fingerprint: D54D 1AEE B11C CE9B A02B C5DD 526F 01E8 564E E4B6 Welcome to the best software in the world today cafe!