From owner-freebsd-hackers Thu Sep 25 23:44:14 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id XAA13629 for hackers-outgoing; Thu, 25 Sep 1997 23:44:14 -0700 (PDT) Received: from helmholtz.salk.edu (helmholtz.salk.edu [198.202.70.34]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id XAA13622 for ; Thu, 25 Sep 1997 23:44:10 -0700 (PDT) Received: from dale.salk.edu (dale [198.202.70.112]) by helmholtz.salk.edu (8.7.5/8.7.3) with SMTP id XAA27976; Thu, 25 Sep 1997 23:43:56 -0700 (PDT) Date: Thu, 25 Sep 1997 23:43:54 -0700 (PDT) From: Tom Bartol To: Mike Smith cc: freebsd-hackers@FreeBSD.ORG Subject: Re: problem compiling for linux under compat_linux In-Reply-To: <199709260412.NAA00737@word.smith.net.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Fri, 26 Sep 1997, Mike Smith wrote: > > If I use /compat/linux/usr/bin/gcc to compile anything other that very > > trivial c program sources located on an NFS mounted filesystem I get > > broken executables which seg fault. This same source code compiles > > correctly when located on a local filesystem. This problem does not occur > > when compiling trivial sources such as "Hello World". > > Can you build non-trivial FreeBSD programs on an NFS-mounted filesystem? > Yes, I have no trouble building non-trivial native FreeBSD executables from NFS-mounted filesystems. > It's not clear to me how this could be an emulation-related problem > just yet. (Possibly an mmap() incompatability?) > > Could you compile the smallest non-trivial program that generates the > undesired symptoms both on a local and non-local filesystem and compare > the two? It would be very useful to know what was different between > the two. > > mike > I'll try to come up with the smallest possible program which presents the problem. I have been able to determine that the problem occurs in the "ld" step of the build process. The intermediate object files generated are just fine because I can build them on an NFS filesystem, copy them to local and link them there perfectly but when I link them on the NFS filesystem I get a broken executable which "file" interestingly identifies as a statically linked ELF instead of a dynmically linked ELF. A real linux system can also link the object files generated by compat_linux or by itself regardless of whether they are local or on an NFS filesystem. I've generated ktrace.out files of the "ld" step under compat_linux for the case which succeeds on local but fails on NFS. The ktrace.out files differ and are 1MB each. Unfortunately, I am not very versed in how to interpret them with kdump. If someone would like to help me out and have a look at them I would be happy to make them available at our ftp site. I agree with you in having touble seeing how this can be an emulation problem. I'm not trying to claim that it is, just that I've found evidence of something rotten in the state of Denmark. I do feel that I have been careful and diligent up to this point in narrowing down the problem to clear-cut cases of success and failure, the critical factor seeming to be the presence or absence of an NFS filesystem in the scenario. I'll be away from e-mail till Sept. 30 so I hope I can resurrect our useful discussion of this matter when I return. Thanks again, Tom