gcc iussue or ... ?

Terry Lambert tlambert2 at mindspring.com
Fri Apr 11 08:47:53 PDT 2003


Gianmarco Giovannelli wrote:
> The problem is very simple.
> I mantain a unix/linux port of a UO emulator which works really fine
> natively under FreeBSD.
> 
> The problem is that if I compile it under FreeBSD it is a binary of 19M,
> while on linux (debian 3.0), same Makefile, is only 2MB. FreeBSD 5.0 and
> OpenBSD 3.1 produce the (about) 19M file.
> Mingw compiler under windows act like Linux.

There are three possibilities.

The first, and least likely, since the same compiler and linker
is used on both FreeBSD and Linux, is that the uninitialized BSS
handling for some large static/global declarations is being handled
differently between the platforms.

The second, which is more likely, is that there are some large
static/global declaractions that get initialized on FreeBSD, but
not on Linux.  The way to find this is to search for platform
"#ifdef"'s in the code.

The third, and most likely, is that you are linking with dynamic
libraries on Linux, but static libraries on FreeBSD; in other
words, you have a FreeBSD Makefile error.  To determine if this
is the case, you should run "ldd" against the binaries on both
platforms.  The paths to the libraries are unimportant; the number,
and which libraries you *don't* see on FreeBSD, are the important
parts.

-- Terry


More information about the freebsd-hackers mailing list