From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5025 invoked by alias); 25 Apr 2006 06:04:46 -0000 Received: (qmail 4969 invoked by uid 48); 25 Apr 2006 06:04:42 -0000 Date: Tue, 25 Apr 2006 06:04:00 -0000 Message-ID: <20060425060442.4968.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug libfortran/27046] gfortran print flush in dll In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "fxcoudert at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-04/txt/msg02146.txt.bz2 List-Id: ------- Comment #3 from fxcoudert at gcc dot gnu dot org 2006-04-25 06:04 ------- (In reply to comment #2) > This was fixed for the non windows case for sure. Yes: $ cat ftesti.f90 subroutine print_from_gfortran(txt) implicit none character :: txt print *,txt end subroutine print_from_gfortran $ ./bin/gfortran -shared -o ftesti.so ftesti.f90 $ cat ctesti.c #include #include void print_from_gcc(char* txt) { printf("%s\n",txt); } int main(int argc, char** argv) { void * hdl = dlopen("./ftesti.so", RTLD_LAZY); void (*print_from_gfortran)(char *) = dlsym(hdl, "print_from_gfortran_"); print_from_gcc ("c"); (*print_from_gfortran)("f"); print_from_gcc ("c"); (*print_from_gfortran)("f"); dlclose (hdl); return 0; } $ gcc -o ctesti.exe ctesti.c -ldl $ ./ctesti.exe c f c f And this even works when libgfortran is only available as a static library (as is the case on mingw32). I'll try to look deeper into this, but it looks very strange... -- fxcoudert at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fxcoudert at gcc dot gnu dot | |org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27046