Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Sep 1997 23:43:54 -0700 (PDT)
From:      Tom Bartol <bartol@salk.edu>
To:        Mike Smith <mike@smith.net.au>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: problem compiling for linux under compat_linux 
Message-ID:  <Pine.BSF.3.95.970925231153.725B-100000@dale.salk.edu>
In-Reply-To: <199709260412.NAA00737@word.smith.net.au>

next in thread | previous in thread | raw e-mail | index | archive | help



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





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95.970925231153.725B-100000>