[C++-sig] gcc-link-action actions to long (max 10240)

David Abrahams dave at boost-consulting.com
Mon Nov 4 18:54:58 CET 2002


gideon may <gideon at computer.org> writes:

> --On Monday, November 04, 2002 5:18 PM +0100 Achim Domma
> <achim.domma at syynx.de> wrote:
> 
> > Hi,
> >
> > my extension module compiles fine on Windows with VC7. On Linux (RedHat 8
> > with gcc 3.2) I get the following error:
> >
> > gcc-link-action actions to long (max 10240)
> >
> > What should I do? I'm quite new to Linux and have setup the system just
> > for testing compilation of my project.
> >
> 
> It's a hardcoded limit in jam.h at line 462 (boost 1.29.0) . I came
> across the same problem and by increasing it the error disappeared.

Gideon's idea of modifying jam.h and rebuilding bjam could work for you.

Another approach is to break your extension module into libraries:

   lib part1 : a.cpp b.cpp c.cpp ;
   lib part2 : d.cpp e.cpp f.cpp ;
   extension ext : <lib>part1 <lib>part2 <dll>../build/boost_python ;

However I think this points out a fundamental (but correctible) flaw
in bjam, though: Linux shells do in fact have a command-line length
limit (though it is larger), and if you increase MAXLINE, static
libraries will be built all-at-once instead of using smaller piecemeal
actions... which I assume is undesirable. It seems to me that we ought
to warn for actions longer than MAXLINE, or that MAXLINE should be set
per-target so that we can break up piecemeal actions but avoid
stopping the action for targets which must be built all-at-once.

-- 
                    David Abrahams
dave at boost-consulting.com * http://www.boost-consulting.com





More information about the Cplusplus-sig mailing list