[Users] configure: error: C compiler cannot create executables

Andrej Kacian ticho at claws-mail.org
Wed Oct 3 20:53:54 CEST 2018


On Wed, 3 Oct 2018 20:37:32 +0300
Removed GDPR wrote:

> > What exact configure flags are you using?  
> 
> export CFLAGS="-O2 -pipe -march=pentium-m -mtune=pentium-m -m32"
> export CXXFLAGS="${CFLAGS}"
> 
> ./configure \
>     --quiet \
>     --build='i686-suse-linux-gnu' \
>     --prefix='/opt/claws-mail' \
>     --disable-jpilot \
>     --disable-maintainer-mode \
>     --disable-manual \
>     --disable-static \
>     --enable-bogofilter-plugin \
>     --enable-crash-dialog \
>     --enable-enchant \
>     --enable-gnutls \
>     --enable-ldap \
>     --enable-pgpmime-plugin \
>     --enable-silent-rules \
>     --enable-spamassassin-plugin \
>     --disable-dillo-plugin \
>     --disable-fancy-plugin
> 
> > You shouldn't need to set -mtune or -march in CFLAGS
> > at all,  
> 
> I use CFLAGS based on this article:
> 
> https://wiki.gentoo.org/wiki/GCC_optimization
> 
> Is that info irrelevant to Claws Mail?

Only partly. First off, you don't need to set CXXFLAGS, because Claws
Mail does not contain any C++ code. Second, -march and -mtune are only
to optimize the resulting compiled program for given architecture,
which is something that can be useful on programs and libraries which
perform very CPU-intensive tasks. With a humble GUI program like Claws
Mail, you won't notice any speedup from these flags.

> > configure's --host and --build parameters
> > should be enough, and set everything up for
> > cross-compilation. Something like:
> > 
> >   ./configure --host=i686-pc-linux-gnu
> > --build=x86_64_pc-linux-gnu  
> 
> Hm. I have never used --host on any machine so far. I
> don't even know what it does. Is it mandatory?

See https://wiki.osdev.org/Target_Triplet for more info about the
host/build/target platforms, as well as meaning of the values passed
to them.

But essentially, --host sets what architecture the resulting program
will run on, while --build helps configure determine architecture of the
system where the compilation takes place.

> Also why in your example --host is 32-bit and --build
> is 64-bit? Shouldn't they be the same bit 

No, see above. You are building program for a 32-bit system on a 64-bit
system.

> > Of course you will need a complete 32-bit compiler
> > toolchain (probably available from your Linux
> > distribution). [...]  
> 
> I can check that but I can't find a list of
> dependencies in the docs (although I obviously have
> all satisfied on the current 64-bit machine). Where
> should I read please?

Your distro's claws-mail package can be of help, since it should list
runtime, as well as build dependencies. You need 32-bit versions of
them.

If I wanted to do what you are trying to do, I would set up a 32-bit
prefix chroot on the 64-bit system, install all the required 32-bit
libraries (including corresponding -devel packages), and do the build
in it. That is essentially what we do for the Windows build of Claws
Mail, except that we have to also compile all the libraries there, as
there are no pre-compiled packages for them that we can use. :)

Regards,
-- 
Andrej



More information about the Users mailing list