[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: heap corruption in du

From: Mikulas Patocka
Subject: Re: heap corruption in du
Date: Mon, 24 Oct 2005 17:03:11 +0200 (CEST)

On Mon, 24 Oct 2005, Stepan Kasal wrote:

Ahoj Mikulasi,

On Mon, Oct 24, 2005 at 04:01:09PM +0200, Mikulas Patocka wrote:
You can modify libtool so that when it is creating static library and
compiler is "icc" or "icpc" (or "some/path/icc" or "some/path/icpc"),
it passes it -no-ipo switch. (dynamic libraries work fine with -ipo).
If you want to solve it in some way (detect intel compiler and pass it
-no-ipo when creating object files that will be packed into "*.a"), you
can, if you don't want, you don't have to.

do I understand correctly that you propose that ./configure will modify
CC if it matches certain pattern?

Not CC but CFLAGS. ./configure already does it for gcc --- it adds -g and -O2.

Also you need to change CFLAGS only when creating *.a files, not for main program or dynamic libraries.

I'm afraid that that might induce some grievance; I, personally, don't like
if the program thinks it knows better that I.  I suppose you the feeling.

What if next version of the compiler will fix the issue, in a totally
transparent way?  People would complain that we slow down their programs
by switching off ipo.  And the nature of Autoconf mean that this bug will
live in many tarballs long after it is fixed in Autoconf.

The best way to automatically fix this problem would be:
test compiling one .o file, pack it into .a, link it
if it fails => test compiling one .o file with -ipo-obj (ICC 8), pack it
        into .a, link it
if it still fails => test compiling one .o file with -no-ipo (ICC 9), pack
        it into .a, link it
it should not fail, if it still fail, compiler probably doesn't work at all.

I'm not sure if some compileres reject calls with no *.o and only one .a file --- maybe you can compile test1.o and test2.o, pack test2.o into test2.a and link test1.o and test2.a

This would work even with future (possibly) fixed version of Intel C. However it doesn't seem likely that they fix it, they just don't seem to care about free software packages :-(

But I can imagine that Autoconf would issue a warning, saying that if the
project doesn't build, you might try to add -ipo-obj or -no-ipo to cc.
But I'm afraid that there is no easy way to determine whether the project
builds a *.a library.

Or it could be made as a patch for Automake, so that the warning is issued
only if Automake sees a static library...

Mikulas, do you volunteer to write a patch?

I don't know programming autoconf very well (i.e. how to detect that we are about to create *.a, not main program; how to pass this modification to libtool to use it when creating static libraries, etc.) --- someone more faimilar with it should write the patch.

I can only test it if someone makes the patch.


Thank you very much for reporting this problems, but I currently see no
easy way to store the knowledge into Autotools.  (And I'm afraid no one
is willing to follow the more laborous path...)  So we end up hoping that
other users of Intel compiler will find this thread in the archives...

Have a nice day,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]