Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Mar 2013 21:00:02 -0400
From:      Ilya Kaliman <ilya.kaliman@gmail.com>
To:        freebsd-hackers@freebsd.org
Subject:   Linking produces unusable executable
Message-ID:  <CA%2BSmX2BCY=ySp-1aXHRHWa2LbCb31vBGvu4ivwyzAi2M4S_ujQ@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hello, hackers!

I have a strange problem with a big executable. I have a piece of scientific
software and some C++ module in it with a LOT of template code. When compiled
this module produces 450 MB archive file (w/o debugging symbols). Now, when I
compile the program without this module everything works perfect. With this
module turned on the linker produces an executable (around 180 MB in size)
without any errors or warnings. But when I try to start the final program zsh
just says: abort. ldd on this exe says: ./a.out: signal 6.

I watched the memory consumption during linking and it doesn't seem to exhaust
all available memory (the linker seem to stop allocating on around 2 GB). I've
also tried to enable --no-keep-memory for ld with no luck - linking still
produces no errors but the resulting executable is unusable.

I've tried it on 9.1 and 10-CURRENT with both gcc/g++/ld from the base system
and from ports (gcc 4.7.3, binutils 2.23.1) and with clang.

I've tried to build some of the bigger ports like chromium (just in case):
all works fine.

Everything works on linux though (with the same gcc/ld). With debugging symbols
the exe is around 1GB, without them its around 200MB. Works fine in every case
with different optimization levels.

Any ideas how to solve this?

Thanks,
Ilya.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2BSmX2BCY=ySp-1aXHRHWa2LbCb31vBGvu4ivwyzAi2M4S_ujQ>