Configure error cannot compute suffix of object files cannot compile

This page collects Frequently Asked Questions in gcc-help mailing list. There is also a more official (but seldom updated) FAQ for GCC and there is a FAQ for Wconversion and conversion warnings

This page collects Frequently Asked Questions in gcc-help mailing list. There is also a more official (but seldom updated) FAQ for GCC and there is a FAQ for Wconversion and conversion warnings

Contents

  1. Configure, Install, Build

    1. Why does my ./configure and make fail?
    2. Configuration fails with »configure: error: cannot compute suffix of object files: cannot compile». What is the problem?
    3. Build fails with »fatal error: gnu/stubs-32.h: No such file or directory». What is the problem?
    4. I see many warnings when building GCC, should I report them?
    5. configure.ac:4: error: Please use exactly Autoconf 2.64 instead of 2.69
  2. C/C++

    1. Why do I get a warning when passing a pointer to an array to a function that expects a pointer to a constant array?
    2. What is the status of adding the UTF-8 support for identifier names in GCC?
    3. GCC’s default include search paths
    4. The continuation character is ignored by C/C++ preprocessor
    5. My program invokes undefined behaviour but…
    6. My copy constructor doesn’t run!
    7. Why GCC does not warn for mismatch between struct and class (-Wmismatched-tags) ?
    8. Why does GCC not give an error for some narrowing conversions within list-initializations as required by C++11 (-Wnarrowing) ?
  3. Optimization

    1. Is -O1 (-O2,-O3, -Os or -Og) equivalent to individual -foptimization options?
    2. What specific flags are enabled by -O1 (-O2, -O3, -Os or -Og)?
    3. The compiler optimized away my overflow checks! What is going on?
    4. Why floating-point results change with optimization levels or different compiler versions or different target architectures?
    5. __attribute__((__optimize__(X))) does not work as expected
    6. GCC miscompiles my code when optimizing, how to find whether it is a bug in my code or in GCC ?
  4. Misc: Diagnostics, GCOV, …

    1. Is there a list of GCC diagnostics/messages?
    2. GCOV/GCC data files are not created
    3. I found a bug in GCC 4.2 for Darwin (Apple System), should I report it?
    4. The warning «unrecognized command-line option» is not given for -Wno-foo

Configure, Install, Build

Why does my ./configure and make fail?

[ Permalink ]

GCC tends to have problems when configured in the same directory as the GCC source code, or in any subdirectory therein, as stated in the Configuration page in the install documentation.

What should be done is to untar the GCC source code, then in the source directory run ./contrib/download_prerequisites (which will download and untar MPFR, MPC and GMP in the same GCC source code directory as per the prerequisites documentation.)

Then make a peer gcc-build directory next to the GCC source code directory.

Then run the configure either by fully qualified path or by relative path while in the the gcc-build current working directory.

A makefile will be created in the gcc-build directory. Run make in the gcc-build current working directory to begin the build of GCC.

(If building a cross-compiler, there are several more prerequisite steps involved.)

The above steps are atypical of most GNU packages. GCC builds in multiple passes; which, if done within the GCC source code directory, befouls the source code directory itself. Hence the need to build in a separate build directory.

MPFR, MPC and GMP are used by GCC itself, internally. GCC does not use those facilities in the code compiled by GCC.

Configuration fails with »configure: error: cannot compute suffix of object files: cannot compile». What is the problem?

[ Permalink ]

Like any of the GNU projects, GCC is using the GNU autotools to commonly configure the compilation for the specifics of the build system. The configure script thereby uses small test programs — usually called conftest.c — to test if certain functions and/or features are available. If the compilation of such a test program fails, you’ll see an error message like:

checking for suffix of object files... configure: error: in `/home/manu/gcc/gcc/i686-pc-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[2]: *** [configure-stage1-target-libgcc] Error 1
make[2]: Leaving directory `/home/manu/gcc/gcc'

This error message is quite misleading and frequently the problem has nothing to do with the message. You have to check the file ‘config.log’ in the directory where the error occurred. In the example above, you would have to check the ‘config.log’ file in the directory ‘/home/manu/gcc/gcc/i686-pc-linux-gnu/libgcc’. There might be several test programs that failed during the configuration, but some of these failures are non-critical. Check for the last error entry in the file.

Common causes for this error message are:

  • Required libraries for the GCC build are missing, specifically MPFR, GMP and MPC. If installed as shared libraries they must be in the runtime linker’s search path so they can be found. Please, follow the instructions in the answer to Why does my ./configure and make fail?

  • The compiler crashed. For example, if there is an error such as ‘conftest.c: internal compiler error:’, this indicates a bug in the compiler. If you are using an unmodified version of GCC, please follow the procedure to report the bug.

Build fails with »fatal error: gnu/stubs-32.h: No such file or directory». What is the problem?

[ Permalink ]

On x86_64 GNU/Linux the default behaviour is to build GCC so it supports compiling both 64-bit and 32-bit objects. To compile 32-bit versions of the runtime libraries you need to have the 32-bit glibc headers installed, which are not installed by default on many GNU/Linux distributions.

To fix the problem either:

  • install the 32-bit glibc package (which your system’s package manager probably calls something like libc6-dev, libc6-dev-i386, glibc-devel.i686, or glibc-devel-32bit), or

  • disable 32-bit support by configuring GCC with —disable-multilib.

I see many warnings when building GCC, should I report them?

[ Permalink ]

Short answer: No.

Long answer: You are probably seeing warnings like:

warning: unknown conversion type character 'E' in format

GCC is built in stages. The first stage uses the system compiler, which may have bugs or not handle special conversion type characters handled by the GCC version being built (this particular warning). Therefore, warnings produced by the system compiler are often wrong. Please, do not report them.

When building a cross compiler (so not bootstrapped), having the warnings, even if noisy, is a lot better than hiding them all. And if a file fails to build in stage 1 of a bootstrap, having the warnings, again even if noisy, helps identify the problem more than if only actual error messages are present. More generally, warnings from a changed file in stage 1 of a bootstrap give you an early indication of possible problems with a patch without needing to wait for a later stage for a more precise set.

configure.ac:4: error: Please use exactly Autoconf 2.64 instead of 2.69

[ Permalink ]

If you modify the GCC sources and need to regenerate the autoconf and automake files, you must use specific versions of the tools, not the latest versions. See Tools/packages necessary for modifying GCC for the required versions. This can be done by installing the right versions of autoconf and automake to a custom location (e.g. under your home directory) and putting them first in your PATH.

The reason for not simply using the latest versions is that they are not always backwards compatible. Ensuring that GCC still works with a newer version takes considerable time and effort. As explained by Jakub Jelinek in https://gcc.gnu.org/ml/gcc/2014-03/msg00410.html:

  • The autotools required versions change over time, but always require effort of some build system maintainer or other volunteer to test that things will work well with the new autotools, porting what needs to be ported to the new version etc. The requirement that everybody uses the same versions to regenerate files has also another advantage, that there are no significant and sometimes disruptive changes in the generated files, say if one committer would regenerate with autoconf 2.69, then another with 2.64, another with 2.68, another with 2.65, then often there are huge changes in the generated files caused by the differences in the autotools.

C/C++

Why do I get a warning when passing a pointer to an array to a function that expects a pointer to a constant array?

[ Permalink ]

Short answer: This is how C works.

Long answer: This happens for code like:

typedef int array[3];
void foo (const array* p);
void bar(array *c) {
        foo(c);
}

You get:

test.c:8: warning: passing argument 1 of ‘foo’ from incompatible pointer type [-Wincompatible-pointer-types]

You are passing int (*)[3] to const int (*)[3], which is not correct according to the C standard. You can disable the warning with -Wno-incompatible-pointer-types. Starting with version 5, gcc only warns about this when using -Wpedantic.

What is the status of adding the UTF-8 support for identifier names in GCC?

[ Permalink ]

Since GCC 5, the option -fextended-identifiers is enabled by default for C++, and for C99 and later C versions. This only supports UCNs in identifiers, not extended characters represented other than with UCNs. Support for actual UTF-8 in identifiers is still pending (please contribute!)

So how do you express UCN in the code? By using the uNNNN or UNNNNNNNN syntax. For example, pipe your code through

perl -pe 'BEGIN { binmode STDIN, ":utf8"; } s/(.)/ord($1) < 128 ? $1 : sprintf("\U%08x", ord($1))/ge;'

or something similar to convert extended characters to UCNs.

A longer example:

//file UCN_almost_UTF8_identifiers.cpp

#include<iostream>
int main()
{
       double Δ_电场velocity(0);
       std::cout << "Δ_v电场elocity= " << Δ_电场velocity << "n";
}

// with following makefile:

UCN_almost_UTF8_identifiers: UCN_almost_UTF8_identifiers.cpp
       to_UCN.sh UCN_almost_UTF8_identifiers.cpp
       g++ -fextended-identifiers -o UCN_almost_UTF8_identifiers /tmp/UCN_almost_UTF8_identifiers.cpp

//and the helper script: to_UCN.sh:

#!/bin/bash
cat $1 | perl -pe 'BEGIN { binmode STDIN, ":utf8"; } s/(.)/ord($1) < 128 ? $1 : sprintf("\U%08x", ord($1))/ge;' > /tmp/$1

GCC’s default include search paths

[ Permalink ]

When searching for include headers, the GCC C compiler (cc1) and C++ compiler (cc1cplus) look into some default directories after searching the directories specified on the command-line, e.g. via the -I flag. To display the default search directories of GCC, try:

echo "" | gcc -o /tmp/tmp.o -v -x c -

echo "" | g++ -o /tmp/tmp.o -v -x c++ -

or

touch /tmp/empty.c
gcc -c -o /tmp/tmp.o -v /tmp/empty.c

touch /tmp/empty.cpp
g++ -c -o /tmp/tmp.o -v /tmp/empty.cpp

The continuation character is ignored by C/C++ preprocessor

[ Permalink ]

You have code like:

label: 
    foo(bar);

and after running gcc -E you expect

label:  fn (args);

but you get:

label:
 fn (args);

First, gcc -E is a C/C++ preprocessor, not a general-purpose text processor. The semantics of both outputs are the same; however, the former better maintains the location information for the rest of the compiler.

Second, you can use gcc -E -P, then it doesn’t print  # <lineno> <file>  lines and puts the label and fn on the same line (as without the line notes, locations aren’t preserved anyway).

However, if there is no whitespace to separate the two lines, as in:

int foo(){
return 0;}

GCC will put the return on the same line as the {, and you get:

int foo(){return
       0;}

return is put on the first line because it appeared immediately after { in the input (line splicings do not count), and GCC does not insert whitespace where there was none. Extra whitespace does get inserted before 0 so that it appears in the same column as in the input.

My program invokes undefined behaviour but…

[ Permalink ]

Sorry, if your program invokes undefined behaviour, then:

  • Anything at all can happen; the Standard imposes no requirements. The program may fail to compile, or it may execute incorrectly (either crashing or silently generating incorrect results), or it may fortuitously do exactly what the programmer intended.

Please:

  • do not ask or propose a defined (or an unspecified, but consistent) behaviour for undefined behaviour;
  • do not report that something bad happened as a result of undefined behaviour;
  • do not argue whether or why some behaviour should be undefined or not.

The reasons why the above are not reasonable requests are difficult to understand unless you are willing to learn »’in detail»’ about how optimizing compilers work internally and the history of the programming languages. Steve Summit briefly discusses only part of the rationale behind undefined behaviors.

Finally, neither GCC bugzilla, nor GCC mailing lists are a forum appropriate to debate the above issues. Undefined behavior is not decided nor defined by GCC, but by the committees that write the language standards. Quoting Steve Summit (maintainer of the C FAQ): «Perhaps we could, but not under the current Standard. […] But the C Standard is under revision: perhaps, if this is important enough to you, you can convince the committee»

My copy constructor doesn’t run!

[ Permalink ]

The C++ standard allows compilers to avoid making copies of objects in certain situations, even if copying has observable side effects. This is known as copy elision and is important for performance of C++ programs.

This means C++ programs that rely on side effects of copy constructors will behave differently with different compilers, so it is important not to rely on those side effects for correctness. The G++ option -fno-elide-constructors disables copy elision, but should generally only be used for experimentation to understand the effects of copy elision.

Why GCC does not warn for mismatch between struct and class (-Wmismatched-tags) ?

[ Permalink ]

Because it is not a bug, hence the warning is just noise. This is a dumb warning that only exists because the MS compiler has a bug that treats struct and class differently in mangled names. GCC (and Clang) correctly implement the C++ standard which says it doesn’t matter.

Why does GCC not give an error for some narrowing conversions within list-initializations as required by C++11 (-Wnarrowing) ?

[ Permalink ]

By default, G++ warns about some narrowing conversions, whereas other compilers always give an error. Specifically, G++ gives an error for narrowing conversions from constants, but by default only gives a warning for non-constants.

The standard only requires that «a conforming implementation shall issue at least one diagnostic message» so compiling the program with a warning is allowed, and does not mean G++ fails to conform to the standard. You can use either -Werror=narrowing or -pedantic-errors to make it an error if you want (or -Wno-narrowing to completely disable the warning). Diagnostic Pragmas can be used to set those options for individual functions.

Background:

G++ 4.6 gave an error but it was changed to a warning intentionally for 4.7 because many people found that narrowing conversions were one of the most commonly encountered problems when trying to compile large C++03 codebases as C++11. Previously valid and bug-free code produced errors and failed to compile, despite being perfectly safe. For example, for (int i=0; i < 10; ++i) { char c[] = { i, 0 }; … } (where i is always within the range of char) caused errors and had to be changed to char c[] = { (char)i, 0 } . People were forced to change code that was provably correct because of the new rule.

As of G++ 5, the behavior is the following: When a later standard is in effect, e.g. when using -std=c++11, narrowing conversions are diagnosed by default, as required by the standard. A narrowing conversion from a constant produces an error, and a narrowing conversion from a non-constant produces a warning, but -Wno-narrowing suppresses the diagnostic. Note that this does not affect the meaning of well-formed code; narrowing conversions are still considered ill-formed in SFINAE contexts. [ -Wnarrowing in the G++ manual ].

Note that what is and isn’t a narrowing conversion is specified by the standard, for example int i = { 0.0 };  is a narrowing conversion from double to int.

Optimization

Is -O1 (-O2,-O3, -Os or -Og) equivalent to individual -foptimization options?

[ Permalink ]

No. First, individual optimization options (-f*) do not enable optimization, one of the options -Os, -Og or -Ox with x > 0 is required for any optimization to happen. Second, the -Ox flags enable many optimizations that are not controlled by any individual -f* option. There are no plans to add individual options for controlling all these optimizations. You may find the output of gcc -help=optimizers helpful here, though it too needs to be interpreted with the above caveat in mind.

What specific flags are enabled by -O1 (-O2, -O3, -Os or -Og)?

[ Permalink ]

This varies by platform and GCC version. The status of individual optimization flags corresponding to a given GCC invocation can be queried by appending the -Q —help=optimizers pair of options to it. For example, to see whether the Value Range Propagation optimization controlled by the -ftree-vrp option is enabled either at -O1 or at -O2 invoke GCC like shown below and look for the status in the square brackets.

$ gcc -O1 -Q --help=optimizers -xc - < /dev/null | grep vrp
  -ftree-vrp                            [disabled]
$ gcc -O2 -Q --help=optimizers -xc - < /dev/null | grep vrp
  -ftree-vrp                            [enabled]

To find the flags implicitly enabled and their values for a given compilation command, you could do:

touch empty.c
gcc -O1 -S -fverbose-asm empty.c
cat empty.s

As discussed above, however, whether an optimization is actually performed may depend not only on the flag that controls it but also on other optimizations. Unless those are also enabled and actually performed, the optimization pass controlled by the former option may not run. Unfortunately, these implicit dependencies are not documented anywhere and can only be determined by debugging GCC.

The compiler optimized away my overflow checks! What is going on?

[ Permalink ]

Signed overflow is undefined behaviour according to the C standard. It should never happen. If it happens, it is an error in the program. So you should check for overflow before it can happen, not afterwards. GCC provides built-in functions to perform arithmetic with overflow checking, which are correct and faster than any custom implementation. As a workaround, the option -fwrapv (In versions earlier than GCC 8, sometimes -fno-strict-overflow is enough but not always, see PR58454) makes gcc behave as if signed integer overflow were defined but these options will probably make your code run slower.

GCC attempts to diagnose some undefined behaviours, but this is not possible in all cases. Try options -Wall -Wextra -Wstrict-aliasing -fsanitize=undefined. If GCC missed a warning and you know how to implement it, please send even a rough working patch. Otherwise, just assume there is no easy/efficient way to diagnose that particular case.

Why floating-point results change with optimization levels or different compiler versions or different target architectures?

[ Permalink ]

See: https://gcc.gnu.org/bugs/#nonbugs_general See also: https://gcc.gnu.org/ml/gcc-patches/2008-11/msg00105.html

In short, the most robust solution (as of GCC 5.0, this is only available in C) is to use -fexcess-precision=standard (whether this option has effect or not depends on other options, please read the manual entry for -fexcess-precision= carefully). For other languages, you may try -ffloat-store or less aggressive optimization levels (like -Og), however, none of those are guaranteed to work and they will probably pessimize your code unnecessarily.

Floating-point results may still depend on the optimization level and target architecture in some cases that are allowed by the ISO C standard. For instance, different sets of instructions may be used for code such as x*y+z depending on the target architecture and the optimization level, and this difference may change the results.

__attribute__((__optimize__(X))) does not work as expected

[ Permalink ]

Currently (2015), this attribute is known to have several critical bugs (PR37565, PR63401, PR60580, PR50782). Using it may produce not effect at all or lead to wrong-code.

Quoting one GCC maintainer: «I consider the optimize attribute code seriously broken and unmaintained (but sometimes useful for debugging — and only that).» source

Unfortunately, the people who added it are either not working on GCC anymore or not interested in fixing it. Do not try to guess how it is supposed to work by trial-and-error. There is not a list of options that are safe to use or known to be broken. Bug reports about the optimize attribute being broken will probably be closed as WONTFIX (PR59262), thus it is not worth to open new ones. If it works for you for a given version of GCC, it doesn’t mean it will work on a different machine or a different version.

The only realistic choices are to not use it, to use it and accept its brokenness (current or future one, since it is unmaintained), or join GCC and fix it (perhaps motivating other people along the way to join your effort).

GCC miscompiles my code when optimizing, how to find whether it is a bug in my code or in GCC ?

[ Permalink ]

  1. Useful warnings «-Wall -Wextra -Wstrict-aliasing=3 -Waggressive-loop-optimizations»

  2. Try adding -fno-strict-aliasing. If it works, your code most probably breaks the strict aliasing rules that the compiler is using for optimization.

  3. Try adding -fwrapv. If it works, your code most probably has undefined behaviour because of integer overflow.

  4. Try adding -fno-aggressive-loop-optimizations. If it works, your code most probably has undefined behaviour because of some loop.

  5. Try adding -fno-delete-null-pointer-checks. GCC removes NULL pointer checks when it can prove that the pointer cannot be NULL (e.g., ‘this’ in C++ can never be NULL). If the execution path leading to the pointer being NULL triggers undefined behaviour, then the path cannot (should not) happen and the pointer can never be NULL.

  6. Try adding -fno-lifetime-dse. If it works, your code has undefined behaviour according to the C++ standard, probably when using placement new. See also PR71885.

  7. Compile without optimizations and with the -fsanitize= option.

  8. For a locking or race condition issue, you might consider using hellgrind to gain an understanding of what’s going wrong without having to further reduce the source. Once you have that understanding, it may be possible to show the problem with simpler source or just explain what’s going wrong (if indeed it is a compiler issue).

GCC attempts to diagnose some undefined behaviours, but this is not possible in all cases. If GCC missed a warning and you know how to implement it, please send even a rough working patch. Otherwise, just assume there is no easy/efficient way to diagnose that particular case.

Misc: Diagnostics, GCOV, …

Is there a list of GCC diagnostics/messages?

[ Permalink ]

There is no list of gcc messages in the documentation. Such a list would rapidly get out of date. The only way to maintain such a list would be to have a dedicated volunteer willing and able to create the list in the first place and keep it up to date as the compiler changes. If you want such a list, make it happen: Be the change that you want to see in the world. There is an unofficial, incomplete and probably out-of-date list of GCC diagnostics. You could start by contributing to it.

Of course, ideally the message should be clear without reference to the documentation. When you find an error message to be particularly perplexing, you should file a bug report or send a patch, especially if you can think of a way to phrase it better.

Nevertheless, the messages are in the source code itself. Using grep to find them is not trivial, since many different functions may end up generating a diagnostic message. Alternatively, you can view the gcc.pot file generated from the GCC sources by the Translation Project. The file and its translations into various languages are stored in the GCC repository here:

  • https://gcc.gnu.org/viewcvs/gcc/trunk/gcc/po

Many of the messages are likely to only make sense in the context of the program they are issued for and the compiler options used to compile it, and not so much on their own.

GCOV/GCC data files are not created

[ Permalink ]

When compiling your projects to determine coverage information (either by using the options [-fprofile-arcs and -ftest-coverage] or [—coverage]) of your programs, you might experience that GCOV data files (newer versions: .gcda, older versions: .da) are not created in your current working directory. This is due to the fact that GCC embeds the absolute file name of the final data file into the executable. The consequence is that the data files are created in the directory where your application was built, but NOT in the directory where you possibly run the application. Here’s a short example using a newer version of GCC (4.5.0):

[root@catania test]# pwd
/devel/gcc/build-3.3.6/gcc/test
[root@catania test]# gcc test.c --coverage -o test.exe
[root@catania test]# strings test.exe | grep gcda
/devel/gcc/build-3.3.6/gcc/test/test.gcda

In order to change the target directory where libgcov will store the data files, please look at the environment variables described in the section »Data File Relocation to Support Cross-Profiling» of the manual.

I found a bug in GCC 4.2 for Darwin (Apple System), should I report it?

[ Permalink ]

Short answer: Please no.

Long answer: GCC 4.2 was first released in 2007, and it is not supported any more by the GCC team. Many new versions have been released since them, with significant improvements and thousands of bugfixes. Please, update to a more recent version. Moreover, Apple’s version of GCC 4.2 has major modifications that were never shared with the rest of the GCC community, so it is very possible that your bug cannot be reproduced (and, hence, fixed) by GCC developers. You should try to report the bug directly to Apple and/or install a newer version of GCC by yourself.

The warning «unrecognized command-line option» is not given for -Wno-foo

[ Permalink ]

Since GCC 4.4, and as explained in the GCC manual: when an unrecognized warning option is requested (-Wunknown-warning), GCC emits a diagnostic stating that the option is not recognized. However, if the -Wno- form is used, the behavior is slightly different: no diagnostic is produced for -Wno-unknown-warning unless other diagnostics are being produced. This allows the use of new -Wno- options with old compilers, but if something goes wrong, the compiler warns that an unrecognized option is present. (See PR28322 for the history of this change)

This might break configure tests that check for -Wno-foo options. The solution is to either test for the positive form (-Wfoo) or test using a testcase that triggers some other warning:

$ gcc -c  -Wno-tautological-compare <<EOF
> const char x = 600;
> EOF
<stdin>:1:16: warning: overflow in implicit constant conversion [-Woverflow]
cc1: warning: unrecognized command line option "-Wno-tautological-compare"
  • Ran brew update and retried your prior step?
  • Ran brew doctor, fixed as many issues as possible and retried your prior step?
  • Confirmed this is a problem with Linuxbrew/brew and not specific formulae? If it’s a formulae-specific problem please file this issue at https://github.com/Linuxbrew/homebrew-core/issues/new

Bug reports:

Glibc fails to build with this error on my cluster:

configure: error: cannot compute suffix of object files: cannot compile

Looking at the config.log, this is the actual error:

configure:2716: checking for C compiler version
configure:2725: gcc-5 --version >&5
/RDS/Q0196/linuxbrew/Library/Homebrew/shims/linux/super/gcc-5:352:in `exec': No such file or directory - gcc-5 (Errno::ENOENT)
        from /RDS/Q0196/linuxbrew/Library/Homebrew/shims/linux/super/gcc-5:352:in `<main>'

But the symlink gcc-5 definitely exists:

$ ll `which gcc-5`
/RDS/Q0196/linuxbrew/bin/gcc-5 -> /sw/GCC/5.3.0/bin/gcc
$ /sw/GCC/5.3.0/bin/gcc
gcc: fatal error: no input files
compilation terminated.

It’s rather weird, it looks like it cannot ‘see’ gcc-5, and I have no clue why. I put the 01.configure output and the config.log here

Edit start:

Workaround

Just found out that passing --env=std circumvents the issue since then it skips the whole super-stuff. This fixes my problem but the issue remains, I guess?

Edit end

Things I tried:

  • Ran brew doctor, no real problem (cannot update git as glibc installation fails)

  • linked the system’s gcc 5.3 into brew via

ln -s $(which gcc) `brew --prefix`/bin/gcc-$(gcc -dumpversion |cut -d. -f1,2)
ln -s $(which g++) `brew --prefix`/bin/g++-$(g++ -dumpversion |cut -d. -f1,2)
ln -s $(which gfortran) `brew --prefix`/bin/gfortran-$(gfortran -dumpversion |cut -d. -f1,2)

and setting HOMEBREW_CC to gcc-5.3.

That broke as gcc-5.3 was an ‘invalid value for HOMEBREW_CC’, so as described here I changed the symlinks to point from gcc-5 not gcc-5.3. Same error as above, cannot find gcc-5.

  • unset HOMEBREW_CC, got
Error: glibc cannot be built with any available compilers.
Install Clang or brew install gcc
  • tried various older gccs also installed on this cluster (4.9.2, 4.8.4)

Here are some minor details:

brew install output

==> ../configure --disable-debug --disable-dependency-tracking --disable-silent-rules --prefix=/RDS/Q0196/linuxbrew/Cellar/glibc/2.19 --enable-obsolete-rpc --without-selinux --with-binutils=/RDS/Q0196/linuxbrew/
Last 15 lines from /home/pbayer/.cache/Homebrew/Logs/glibc/01.configure:
--disable-debug
--disable-dependency-tracking
--disable-silent-rules
--prefix=/RDS/Q0196/linuxbrew/Cellar/glibc/2.19
--enable-obsolete-rpc
--without-selinux
--with-binutils=/RDS/Q0196/linuxbrew/opt/binutils/bin
--with-headers=/RDS/Q0196/linuxbrew/opt/linux-headers/include

checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for gcc... gcc-5
checking for suffix of object files... configure: error: in `/tmp/glibc-20170410-16706-bd9e8d/glibc-2.19/build':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details

READ THIS: https://github.com/Linuxbrew/brew/blob/master/docs/Troubleshooting.md#troubleshooting

brew config output

HOMEBREW_VERSION: >1.1.0 (no git repository)
ORIGIN: https://github.com/Linuxbrew/brew.git
HEAD: 59c9ddbc1d9b9dfdeb0514768e0efd0112c63b25
Last commit: 34 hours ago
Core tap ORIGIN: https://github.com/Linuxbrew/homebrew-core
Core tap HEAD: 1916543d40f317042ba5a0c027e05f98153d69f4
Core tap last commit: 47 minutes ago
HOMEBREW_PREFIX: /RDS/Q0196/linuxbrew
HOMEBREW_REPOSITORY: /RDS/Q0196/linuxbrew
HOMEBREW_CELLAR: /RDS/Q0196/linuxbrew/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://linuxbrew.bintray.com
CPU: octa-core 64-bit 0x1501
Homebrew Ruby: 2.0.0-p648 => /RDS/Q0196/linuxbrew/Library/Homebrew/vendor/portable-ruby/2.0.0-p648/bin/ruby
Clang: N/A
Git: 1.7.1 => /usr/bin/git
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /usr/bin/ruby
Java: openjdk version "1.8.0_111"
Kernel: Linux 2.6.32-642.6.2.el6.x86_64 x86_64 GNU/Linux
OS: CentOS release 6.8 (Final)
Codename: Final
OS glibc: 2.12
OS gcc: 4.4.7
Linuxbrew glibc: N/A
Linuxbrew gcc: N/A
Linuxbrew xorg: N/A

I’m trying to build it with multilib on i686 linux .
mingw-w64-crt/configure fails with:

configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.

Here’s an extract from config.log

configure:3449: checking for suffix of object files
configure:3471: x86_64-w64-mingw32-gcc -c -march=i686 -mtune=generic -O2 -pipe  conftest.c >&5
conftest.c:1: error: CPU you selected does not support x86-64 instruction set
configure:3475: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "mingw-w64-runtime"
| #define PACKAGE_TARNAME "mingw-w64-runtime"
| #define PACKAGE_VERSION "1.0b"
| #define PACKAGE_STRING "mingw-w64-runtime 1.0b"
| #define PACKAGE_BUGREPORT "mingw-w64-public@lists.sourceforge.net"
| #define PACKAGE_URL ""
| #define PACKAGE "mingw-w64-runtime"
| #define VERSION "1.0b"
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:3489: error: in `/home/il/builds/mingw-w64-w32api-svn/src/build-mingw-w64-runtime':
configure:3492: error: cannot compute suffix of object files: cannot compile

The problem seems to be with cross gcc failing to compile with option ‘-march=i686’ :

$ x86_64-w64-mingw32-gcc -c test.c && echo OK
OK
$ x86_64-w64-mingw32-gcc -c -march=i686 test.c && echo OK
test.c:1: error: CPU you selected does not support x86-64 instruction set

binutils 2.20.1/cvs
gcc 4.3.0/trunk
mingw-w64 1.0/trunk

View previous topic :: View next topic  
Author Message
gcasillo
l33t
l33t

Joined: 23 Sep 2003
Posts: 739
Location: Cincinnati, Ohio, USA

PostPosted: Sat Jun 12, 2010 5:13 pm    Post subject: crossdev error: «cannot compute suffix of object files& Reply with quote

I have had a problem getting crossdev to build a cross-compiling toolchain for a while now. On an amd64 machine, I’m attempting to build a i686-pc-linux-gnu toolchain with the following:

Code:
crossdev -t i686-pc-linux-gnu



It gets this far:

Code:
coffee ~ # crossdev -t i686-pc-linux-gnu

———————————————————————————————————————————————————————————————————

 * Host Portage ARCH:     amd64

 * Target Portage ARCH:   x86

 * Target System:         i686-pc-linux-gnu

 * Stage:                 4 (C/C++ compiler)

 * binutils:              binutils-[latest]

 * gcc:                   gcc-[latest]

 * headers:               linux-headers-[latest]

 * libc:                  glibc-[latest]

 * PORTDIR_OVERLAY:       /usr/local/portage

 * PORT_LOGDIR:           /var/log/portage

 * PKGDIR:                /usr/portage/packages/cross/i686-pc-linux-gnu

 * PORTAGE_TMPDIR:        /var/tmp/cross/i686-pc-linux-gnu

  _  —  ~  —  _  —  ~  —  _  —  ~  —  _  —  ~  —  _  —  ~  —  _  —  ~  —  _  —  ~  —  _  —  ~  —  _  —  ~  —  _  —  ~  —  _  —  ~  —  _  —  ~  —  _  —  ~  —  _  —  ~  —  _  —  ~  —  _  —  ~  —  _  — 

 * Forcing the latest versions of {binutils,gcc}-config/gnuconfig …                                                                                                                             [ ok ]

 * Log: /var/log/portage/cross-i686-pc-linux-gnu-binutils.log

 * Emerging cross-binutils …                                                                                                                                                                    [ ok ]

 * Log: /var/log/portage/cross-i686-pc-linux-gnu-linux-headers-quick.log

 * Emerging cross-linux-headers-quick …                                                                                                                                                         [ ok ]

 * Log: /var/log/portage/cross-i686-pc-linux-gnu-glibc-headers.log

 * Emerging cross-glibc-headers …                                                                                                                                                               [ ok ]

 * Log: /var/log/portage/cross-i686-pc-linux-gnu-gcc-stage1.log

 * Emerging cross-gcc-stage1 …                                                                                                                                                                  [ ok ]

 * Log: /var/log/portage/cross-i686-pc-linux-gnu-linux-headers.log

 * Emerging cross-linux-headers …                                                                                                                                                               [ ok ]

 * Log: /var/log/portage/cross-i686-pc-linux-gnu-glibc.log

 * Emerging cross-glibc …

 * glibc failed :(

 * If you file a bug, please attach the following logfiles:

 * /var/log/portage/cross-i686-pc-linux-gnu-info.log

 * /var/log/portage/cross-i686-pc-linux-gnu-glibc.log

As you can see it’s getting stuck on cross-glibc. It’s always the same error. Here’s the output of each log file:

Code:
coffee ~ # cat /var/log/portage/cross-i686-pc-linux-gnu-info.log

———————————————————————————————————————————————————————————————————

 * Host Portage ARCH:     amd64

 * Target Portage ARCH:   x86

 * Target System:         i686-pc-linux-gnu

 * Stage:                 4 (C/C++ compiler)

 * binutils:              binutils-[latest]

 * gcc:                   gcc-[latest]

 * headers:               linux-headers-[latest]

 * libc:                  glibc-[latest]

 * PORTDIR_OVERLAY:       /usr/local/portage

 * PORT_LOGDIR:           /var/log/portage

 * PKGDIR:                /usr/portage/packages/cross/i686-pc-linux-gnu

 * PORTAGE_TMPDIR:        /var/tmp/cross/i686-pc-linux-gnu

  _  —  ~  —  _  —  ~  —  _  —  ~  —  _  —  ~  —  _  —  ~  —  _  —  ~  —  _  —  ~  —  _  —  ~  —  _  —  ~  —  _  —  ~  —  _  —  ~  —  _  —  ~  —  _  —  ~  —  _  —  ~  —  _  —  ~  —  _  —  ~  —  _  — 

Portage 2.1.8.3 (default/linux/amd64/10.0, gcc-4.4.4, glibc-2.11.2-r0, 2.6.34-gentoo x86_64)

=================================================================

System uname: Linux-2.6.34-gentoo-x86_64-Intel-R-_Atom-TM-_CPU_330_@_1.60GHz-with-gentoo-2.0.1

Timestamp of tree: Fri, 11 Jun 2010 16:15:02 +0000

ccache version 2.4 [enabled]

app-shells/bash:     4.1_p7

dev-lang/python:     2.6.5-r2, 3.1.2-r3

dev-util/ccache:     2.4-r8

dev-util/cmake:      2.8.1-r2

sys-apps/baselayout: 2.0.1

sys-apps/openrc:     0.6.1-r1

sys-apps/sandbox:    2.2

sys-devel/autoconf:  2.65

sys-devel/automake:  1.11.1

sys-devel/binutils:  2.20.1-r1

sys-devel/gcc:       4.4.4

sys-devel/gcc-config: 1.4.1

sys-devel/libtool:   2.2.10

virtual/os-headers:  2.6.34

ABI=»amd64″

ACCEPT_KEYWORDS=»amd64 ~amd64″

ACCEPT_LICENSE=»* -@EULA»

ACCEPT_PROPERTIES=»*»

ALSA_CARDS=»hda-intel»

ALSA_PCM_PLUGINS=»adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol»

APACHE2_MODULES=»actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias»

ARCH=»amd64″

ASFLAGS_x86=»—32″

AUTOCLEAN=»yes»

CBUILD=»x86_64-pc-linux-gnu»

CCACHE_DIR=»/var/tmp/ccache»

CCACHE_SIZE=»1G»

CDEFINE_amd64=»__x86_64__»

CDEFINE_x86=»__i386__»

CFLAGS=»-march=core2 -O2 -pipe -fomit-frame-pointer»

CFLAGS_x86=»-m32″

CHOST=»x86_64-pc-linux-gnu»

CHOST_amd64=»x86_64-pc-linux-gnu»

CHOST_x86=»i686-pc-linux-gnu»

CLEAN_DELAY=»5″

COLLISION_IGNORE=»/lib/modules»

CONFIG_PROTECT=»/etc /usr/share/X11/xkb /usr/share/config»

CONFIG_PROTECT_MASK=»/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo»

CVS_RSH=»ssh»

CXXFLAGS=»-march=core2 -O2 -pipe -fomit-frame-pointer»

DEFAULT_ABI=»amd64″

DISTDIR=»/usr/portage/distfiles»

EDITOR=»/bin/nano»

ELIBC=»glibc»

EMERGE_WARNING_DELAY=»10″

EPREFIX=»»

EROOT=»/»

FEATURES=»assume-digests ccache distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch»

FETCHCOMMAND=»/usr/bin/wget -t 5 -T 60 —passive-ftp -O «${DISTDIR}/${FILE}» «${URI}»»

GCC_SPECS=»»

GENTOO_MIRRORS=»ftp://ftp.ussg.iu.edu/pub/linux/gentoo ftp://ftp.gtlib.gatech.edu/pub/gentoo http://www.gtlib.gatech.edu/pub/gentoo http://gentoo.mirrors.pair.com/ ftp://gentoo.mirrors.pair.com/ http://gentoo.mirrors.tds.net/gentoo ftp://gentoo.mirrors.tds.net/gentoo http://mirror.datapipe.net/gentoo ftp://mirror.datapipe.net/gentoo»

HOME=»/root»

INFOPATH=»/usr/share/info:/usr/share/binutils-data/x86_64-pc-linux-gnu/2.20.1/info:/usr/share/gcc-data/x86_64-pc-linux-gnu/4.4.3/info»

INPUT_DEVICES=»evdev keyboard mouse»

KERNEL=»linux»

LCD_DEVICES=»bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text»

LDFLAGS=»-Wl,-O1″

LDFLAGS_x86=»-m elf_i386″

LESS=»-R -M —shift 5″

LESSOPEN=»|lesspipe.sh %s»

LIBDIR_amd64=»lib64″

LIBDIR_amd64_fbsd=»lib64″

LIBDIR_ppc=»lib32″

LIBDIR_ppc64=»lib64″

LIBDIR_sparc32=»lib32″

LIBDIR_sparc64=»lib64″

LIBDIR_x86=»lib32″

LIBDIR_x86_fbsd=»lib32″

LIRC_DEVICES=»mceusb»

LOGNAME=»root»

LS_COLORS=»rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.pdf=00;32:*.ps=00;32:*.txt=00;32:*.patch=00;32:*.diff=00;32:*.log=00;32:*.tex=00;32:*.doc=00;32:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:»

MAIL=»/var/mail/root»

MAKEOPTS=»-j25″

MANPATH=»/usr/local/share/man:/usr/share/man:/usr/share/binutils-data/x86_64-pc-linux-gnu/2.20.1/man:/usr/share/gcc-data/x86_64-pc-linux-gnu/4.4.3/man»

MULTILIB_ABIS=»amd64 x86″

MULTILIB_STRICT_DENY=»64-bit.*shared object»

MULTILIB_STRICT_DIRS=»/lib32 /lib /usr/lib32 /usr/lib /usr/kde/*/lib32 /usr/kde/*/lib /usr/qt/*/lib32 /usr/qt/*/lib /usr/X11R6/lib32 /usr/X11R6/lib»

MULTILIB_STRICT_EXEMPT=»(perl5|gcc|gcc-lib|binutils|eclipse-3|debug|portage)»

NETBEANS=»apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml»

NOCOLOR=»true»

OLDPWD=»/root»

OPENGL_PROFILE=»xorg-x11″

PAGER=»/usr/bin/less»

PATH=»/lib64/rc/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/lib/ccache/bin:/usr/lib/icecc/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.4.3″

PKGDIR=»/usr/portage/packages/cross/i686-pc-linux-gnu»

PORTAGE_ARCHLIST=»ppc x86-openbsd ppc-openbsd ppc64 x86-winnt x86-fbsd ppc-aix alpha arm x86-freebsd s390 amd64 arm-linux x86-macos x64-openbsd ia64-hpux hppa x86-netbsd amd64-linux ia64-linux x86 sparc-solaris x64-freebsd sparc64-solaris x86-linux x64-macos sparc m68k-mint ia64 mips ppc-macos x86-interix hppa-hpux amd64-fbsd x64-solaris mips-irix m68k sh x86-solaris sparc-fbsd»

PORTAGE_BINHOST_CHUNKSIZE=»3000″

PORTAGE_BIN_PATH=»/usr/lib64/portage/bin»

PORTAGE_COMPRESS=»gzip»

PORTAGE_COMPRESS_EXCLUDE_SUFFIXES=»css gif htm[l]? jp[e]?g js pdf png»

PORTAGE_COMPRESS_FLAGS=»-9″

PORTAGE_CONFIGROOT=»/»

PORTAGE_DEBUG=»0″

PORTAGE_DEPCACHEDIR=»/var/cache/edb/dep»

PORTAGE_ELOG_CLASSES=»log warn error»

PORTAGE_ELOG_MAILFROM=»portage@localhost»

PORTAGE_ELOG_MAILSUBJECT=»[portage] ebuild log for ${PACKAGE} on ${HOST}»

PORTAGE_ELOG_MAILURI=»root»

PORTAGE_ELOG_SYSTEM=»save_summary echo»

PORTAGE_FETCH_CHECKSUM_TRY_MIRRORS=»5″

PORTAGE_FETCH_RESUME_MIN_SIZE=»350K»

PORTAGE_GID=»250″

PORTAGE_INST_GID=»0″

PORTAGE_INST_UID=»0″

PORTAGE_PYM_PATH=»/usr/lib64/portage/pym»

PORTAGE_RSYNC_OPTS=»—recursive —links —safe-links —perms —times —compress —force —whole-file —delete —stats —timeout=180 —exclude=/distfiles —exclude=/local —exclude=/packages»

PORTAGE_RSYNC_RETRIES=»3″

PORTAGE_SYNC_STALE=»30″

PORTAGE_TMPDIR=»/var/tmp/cross/i686-pc-linux-gnu»

PORTAGE_VERBOSE=»1″

PORTAGE_WORKDIR_MODE=»0700″

PORTDIR=»/usr/portage»

PORTDIR_OVERLAY=»/usr/local/portage»

PREROOTPATH=»/usr/lib/ccache/bin:/usr/lib/icecc/bin»

PROFILE_ONLY_VARIABLES=»ARCH ELIBC KERNEL USERLAND»

PWD=»/»

PYTHONDONTWRITEBYTECODE=»1″

RESUMECOMMAND=»/usr/bin/wget -c -t 5 -T 60 —passive-ftp -O «${DISTDIR}/${FILE}» «${URI}»»

ROOT=»/»

ROOTPATH=»/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.4.4″

RPMDIR=»/usr/portage/rpm»

RUBY_TARGETS=»ruby18″

SHELL=»/bin/bash»

SHLVL=»2″

SSH_CLIENT=»192.168.0.101 57738 22″

SSH_CONNECTION=»192.168.0.101 57738 192.168.0.108 22″

SSH_TTY=»/dev/pts/0″

STAGE1_USE=»multilib nptl nptlonly unicode»

SYMLINK_LIB=»yes»

SYNC=»rsync://rsync.namerica.gentoo.org/gentoo-portage»

TERM=»xterm»

USE=»X a52 aac acl alsa amd64 asf audiofile avi bash-completion berkdb bzip2 cli consolekit cracklib crypt ctype cxx dbus dirac dlloader dri dts encode faac faad ffmpeg flac gdbm gif hal imlib jpeg kde kde4 libg++ libwww lirc live lm_sensors logrotate mad matroska midi mmx mmxext modules mp3 mp4 mpeg mudflap multilib mysql ncurses nls nptl nptlonly ogg oggvorbis openal opengl openmp pcre perl plasma png python qt3support qt4 quicktime readline session smp speex sse sse2 ssl ssse3 svg sysfs syslog tcpd theora tiff transcode truetype unicode usb vdpau vorbis webkit x264 xcomposite xine xorg xv xvid zlib» ALSA_CARDS=»hda-intel» ALSA_PCM_PLUGINS=»adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol» APACHE2_MODULES=»actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias» ELIBC=»glibc» INPUT_DEVICES=»evdev keyboard mouse» KERNEL=»linux» LCD_DEVICES=»bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text» LIRC_DEVICES=»mceusb» RUBY_TARGETS=»ruby18″ USERLAND=»GNU» VIDEO_CARDS=»nvidia» XTABLES_ADDONS=»quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account»

USER=»root»

USERLAND=»GNU»

USE_EXPAND=»ALSA_CARDS ALSA_PCM_PLUGINS APACHE2_MODULES APACHE2_MPMS CAMERAS CROSSCOMPILE_OPTS DVB_CARDS ELIBC FCDSL_CARDS FOO2ZJS_DEVICES FRITZCAPI_CARDS INPUT_DEVICES KERNEL LCD_DEVICES LINGUAS LIRC_DEVICES MISDN_CARDS NETBEANS_MODULES NGINX_MODULES_HTTP NGINX_MODULES_MAIL QEMU_SOFTMMU_TARGETS QEMU_USER_TARGETS RUBY_TARGETS SANE_BACKENDS USERLAND VIDEO_CARDS XTABLES_ADDONS»

USE_EXPAND_HIDDEN=»CROSSCOMPILE_OPTS ELIBC KERNEL USERLAND»

USE_ORDER=»env:pkg:conf:defaults:pkginternal:env.d»

VIDEO_CARDS=»nvidia»

XDG_CONFIG_DIRS=»/etc/xdg»

XDG_DATA_DIRS=»/usr/local/share:/usr/share»

XTABLES_ADDONS=»quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account»

XZ_OPT=»—memory=max»

_=»/usr/bin/emerge»



Code:
coffee ~ # cat /var/log/portage/cross-i686-pc-linux-gnu-glibc.log

Calculating dependencies  …. done!

>>> Verifying ebuild manifests

>>> Emerging (1 of 1) cross-i686-pc-linux-gnu/glibc-2.11.2 from unknown repo

 * glibc-2.11.2.tar.bz2 RMD160 SHA1 SHA256 size ;-) …                  [ ok ]

 * glibc-ports-2.11.tar.bz2 RMD160 SHA1 SHA256 size ;-) …              [ ok ]

 * glibc-2.11.2-patches-1.tar.bz2 RMD160 SHA1 SHA256 size ;-) …        [ ok ]

 * checking ebuild checksums ;-) …                                     [ ok ]

 * checking auxfile checksums ;-) …                                    [ ok ]

 * checking miscfile checksums ;-) …                                   [ ok ]

 * CPV:  cross-i686-pc-linux-gnu/glibc-2.11.2

 * REPO:

 * USE:  amd64 elibc_glibc kernel_linux multilib nls userland_GNU

>>> Unpacking source…

 * Checking gcc for __thread support …

  [ ok ]

 * Checking linux-headers version (2.6.34 >= 2.6.9) …

  [ ok ]

>>> Unpacking glibc-2.11.2.tar.bz2 to /var/tmp/cross/i686-pc-linux-gnu/portage/cross-i686-pc-linux-gnu/glibc-2.11.2/work

>>> Unpacking glibc-ports-2.11.tar.bz2 to /var/tmp/cross/i686-pc-linux-gnu/portage/cross-i686-pc-linux-gnu/glibc-2.11.2/work/glibc-2.11.2

>>> Unpacking glibc-2.11.2-patches-1.tar.bz2 to /var/tmp/cross/i686-pc-linux-gnu/portage/cross-i686-pc-linux-gnu/glibc-2.11.2/work

 * Applying Gentoo Glibc Patchset 2.11.2-1 …

 *   0020_all_glibc-tweak-rfc1918-lookup.patch …

  [ ok ]

 *   0030_all_glibc-respect-env-CPPFLAGS.patch …

  [ ok ]

 *   0044_all_glibc-2.10-resolv-nameserver-fallback.patch …

  [ ok ]

 *   0085_all_glibc-disable-ldconfig.patch …

  [ ok ]

 *   1010_all_glibc-queue-header-updates.patch …

  [ ok ]

 *   1020_all_glibc-longjmp-chk-hidden-fortify.patch …

  [ ok ]

 *   1030_all_glibc-manual-no-perl.patch …

  [ ok ]

 *   1040_all_2.3.3-localedef-fix-trampoline.patch …

  [ ok ]

 *   1055_all_glibc-resolv-dynamic.patch …

  [ ok ]

 *   1060_all_glibc-localedef-mmap.patch …

  [ ok ]

 *   1070_all_glibc-fadvise64_64.patch …

  [ ok ]

 *   1073_all_glibc-ldbl-nexttowardf.patch …

  [ ok ]

 *   1075_all_glibc-section-comments.patch …

  [ ok ]

 *   1080_all_glibc-no-inline-gmon.patch …

  [ ok ]

 *   1085_all_glibc-2.9-check_native-headers.patch …

  [ ok ]

 *   1090_all_glibc-2.3.6-fix-pr631.patch …

  [ ok ]

 *   1095_all_glibc-2.9-assume-pipe2.patch …

  [ ok ]

 *   1100_all_glibc-2.3.3-china.patch …

  [ ok ]

 *   1103_all_glibc-new-valencian-locale.patch …

  [ ok ]

 *   1120_all_glibc-2.11-longjmp-chk-fallback.patch …

  [ ok ]

 *   1130_all_glibc-2.4-undefine-__i686.patch …

  [ ok ]

 *   1160_all_glibc-2.8-nscd-one-fork.patch …

  [ ok ]

 *   1508_all_glibc-2.11-hppa-SOCK_CLOEXEC.patch …

  [ ok ]

 *   1530_all_glibc-m68k-sys-user.patch …

  [ ok ]

 *   3000_all_2.3.6-dl_execstack-PaX-support.patch …

  [ ok ]

 *   3010_all_2.3.3_pre20040117-pt_pax.patch …

  [ ok ]

 *   3020_all_glibc-tests-sandbox-libdl-paths.patch …

  [ ok ]

 *   5021_all_2.9-fnmatch.patch …

  [ ok ]

 *   5063_all_glibc-dont-build-timezone.patch …

  [ ok ]

 *   6001_all_alpha-glibc-2.4-xstat.patch …

  [ ok ]

 *   6015_all_alpha-glibc-2.5-no-page-header.patch …

  [ ok ]

 *   6017_all_alpha-glibc-2.8-creat.patch …

  [ ok ]

 *   6018_all_alpha-glibc-2.8-cache-shape.patch …

  [ ok ]

 *   6019_all_alpha-glibc-ptr-mangling.patch …

  [ ok ]

 *   6020_all_alpha-fix-gcc-4.1-warnings.patch …

  [ ok ]

 *   6020_all_alpha-floor_ceil_fix.patch …

  [ ok ]

 *   6021_all_alpha-add-dl-procinfo-support.patch …

  [ ok ]

 *   6023_all_alpha-fcntl-updates.patch …

  [ ok ]

 *   6024_all_alpha-settime-typo.patch …

  [ ok ]

 *   6026_all_alpha-fix-rtld-fPIC.patch …

  [ ok ]

 *   6027_all_alpha-fix-memchr.patch …

  [ ok ]

 *   6028_all_alpha-fix-SOCK_NONBLOCK.patch …

  [ ok ]

 *   6120_all_ppc-glibc-2.9-atomic.patch …

  [ ok ]

 *   6130_all_ppc-glibc-2.11-cell-vector.patch …

  [ ok ]

 *   6220_all_glibc-2.4-arm-cirrus-ep93xx-maverick-crunch-fpu.patch …

  [ ok ]

 *   6240_all_glibc-2.8-nptl-lowlevellock.patch …

  [ ok ]

 *   6418_all_sh-glibc-2.9-set-fpscr-proto.patch …

  [ ok ]

 *   6605_all_glibc-2.4-fpu-cw-mips.patch …

  [ ok ]

 *   6610_all_glibc-r10k-workarounds.patch …

  [ ok ]

 * Done with patching

 * Using GNU config files from /usr/share/gnuconfig

 *   Updating scripts/config.sub

  [ ok ]

 *   Updating scripts/config.guess

  [ ok ]

>>> Source unpacked in /var/tmp/cross/i686-pc-linux-gnu/portage/cross-i686-pc-linux-gnu/glibc-2.11.2/work

>>> Compiling source in /var/tmp/cross/i686-pc-linux-gnu/portage/cross-i686-pc-linux-gnu/glibc-2.11.2/work/glibc-2.11.2 …

 *             ABI:   default

 *          CBUILD:   x86_64-pc-linux-gnu

 *           CHOST:   x86_64-pc-linux-gnu

 *         CTARGET:   i686-pc-linux-gnu

 *      CBUILD_OPT:   

 *     CTARGET_OPT:   

 *              CC:   

 *          CFLAGS:    -march=i686 -pipe -O2 -fno-strict-aliasing

 * Configuring GLIBC for nptl with:

 *              —disable-stackguard-randomization

 *              —enable-old-ssp-compat

 *              —enable-add-ons=nptl,c_stubs,libidn,ports

 *              —enable-kernel=2.6.9

 *              —without-selinux

 *              —without-cvs

 *              —enable-bind-now

 *              —build=x86_64-pc-linux-gnu

 *              —host=i686-pc-linux-gnu

 *              —disable-profile

 *              —without-gd

 *              —with-headers=/usr/i686-pc-linux-gnu/usr/include

 *              —prefix=/usr

 *              —libdir=/usr/lib

 *              —mandir=/usr/share/man

 *              —infodir=/usr/share/info

 *              —libexecdir=/usr/lib/misc/glibc

 *

configure: loading site script /usr/share/config.site

configure: loading site script /usr/share/crossdev/include/site/linux

checking build system type… x86_64-pc-linux-gnu

checking host system type… i686-pc-linux-gnu

checking for i686-pc-linux-gnu-gcc… i686-pc-linux-gnu-gcc

checking for suffix of object files… configure: error: in `/var/tmp/cross/i686-pc-linux-gnu/portage/cross-i686-pc-linux-gnu/glibc-2.11.2/work/build-default-i686-pc-linux-gnu-nptl’:

configure: error: cannot compute suffix of object files: cannot compile

See `config.log’ for more details.

 * ERROR: cross-i686-pc-linux-gnu/glibc-2.11.2 failed:

 *   failed to configure glibc

 *

 * Call stack:

 *           ebuild.sh, line   54:  Called src_compile

 *         environment, line 3855:  Called eblit-run ‘src_compile’

 *         environment, line 1244:  Called eblit-glibc-src_compile

 *   src_compile.eblit, line  199:  Called src_compile

 *         environment, line 3855:  Called eblit-run ‘src_compile’

 *         environment, line 1244:  Called eblit-glibc-src_compile

 *   src_compile.eblit, line  207:  Called toolchain-glibc_src_compile

 *   src_compile.eblit, line  121:  Called glibc_do_configure ‘nptl’

 *   src_compile.eblit, line   98:  Called die

 * The specific snippet of code:

 *      «${S}»/configure ${myconf} || die «failed to configure glibc»

 *

 * If you need support, post the output of ’emerge —info =cross-i686-pc-linux-gnu/glibc-2.11.2′,

 * the complete build log and the output of ’emerge -pqv =cross-i686-pc-linux-gnu/glibc-2.11.2′.

 * This ebuild is from an overlay: ‘/usr/local/portage/’

 * The complete build log is located at ‘/var/tmp/cross/i686-pc-linux-gnu/portage/cross-i686-pc-linux-gnu/glibc-2.11.2/temp/build.log’.

 * The ebuild environment file is located at ‘/var/tmp/cross/i686-pc-linux-gnu/portage/cross-i686-pc-linux-gnu/glibc-2.11.2/temp/environment’.

 * S: ‘/var/tmp/cross/i686-pc-linux-gnu/portage/cross-i686-pc-linux-gnu/glibc-2.11.2/work/glibc-2.11.2’

>>> Failed to emerge cross-i686-pc-linux-gnu/glibc-2.11.2, Log file:

>>>  ‘/var/tmp/cross/i686-pc-linux-gnu/portage/cross-i686-pc-linux-gnu/glibc-2.11.2/temp/build.log’

 * Messages for package cross-i686-pc-linux-gnu/glibc-2.11.2:

 * ERROR: cross-i686-pc-linux-gnu/glibc-2.11.2 failed:

 *   failed to configure glibc

 *

 * Call stack:

 *           ebuild.sh, line   54:  Called src_compile

 *         environment, line 3855:  Called eblit-run ‘src_compile’

 *         environment, line 1244:  Called eblit-glibc-src_compile

 *   src_compile.eblit, line  199:  Called src_compile

 *         environment, line 3855:  Called eblit-run ‘src_compile’

 *         environment, line 1244:  Called eblit-glibc-src_compile

 *   src_compile.eblit, line  207:  Called toolchain-glibc_src_compile

 *   src_compile.eblit, line  121:  Called glibc_do_configure ‘nptl’

 *   src_compile.eblit, line   98:  Called die

 * The specific snippet of code:

 *      «${S}»/configure ${myconf} || die «failed to configure glibc»

 *

 * If you need support, post the output of ’emerge —info =cross-i686-pc-linux-gnu/glibc-2.11.2′,

 * the complete build log and the output of ’emerge -pqv =cross-i686-pc-linux-gnu/glibc-2.11.2′.

 * This ebuild is from an overlay: ‘/usr/local/portage/’

 * The complete build log is located at ‘/var/tmp/cross/i686-pc-linux-gnu/portage/cross-i686-pc-linux-gnu/glibc-2.11.2/temp/build.log’.

 * The ebuild environment file is located at ‘/var/tmp/cross/i686-pc-linux-gnu/portage/cross-i686-pc-linux-gnu/glibc-2.11.2/temp/environment’.

 * S: ‘/var/tmp/cross/i686-pc-linux-gnu/portage/cross-i686-pc-linux-gnu/glibc-2.11.2/work/glibc-2.11.2’

The operative part of that last log file is the error: «checking for suffix of object files… configure: error: in `/var/tmp/cross/i686-pc-linux-gnu/portage/cross-i686-pc-linux-gnu/glibc-2.11.2/work/build-default-i686-pc-linux-gnu-nptl’:

configure: error: cannot compute suffix of object files: cannot compile». Anybody who knows more about crossdev know something about this error and what I can do to bypass it and build a toolchain?

Back to top

View user's profile Send private message

Hu
Moderator
Moderator

Joined: 06 Mar 2007
Posts: 19770

PostPosted: Sat Jun 12, 2010 5:47 pm    Post subject: Re: crossdev error: «cannot compute suffix of object fi Reply with quote

gcasillo wrote:
Code:
coffee ~ # cat /var/log/portage/cross-i686-pc-linux-gnu-glibc.log

configure: error: cannot compute suffix of object files: cannot compile

See `config.log’ for more details.

That log file may contain useful information.

May I ask why you want an i686 cross compiler on an amd64 machine? You can run IA32 natively on an amd64 CPU. If you want to build only custom code, with few or no dependencies, you can do so using the -m32 switch to your existing gcc. If you want to compile a full IA32 Gentoo environment, that could be done in a chroot. Cross compiling i686 like this is really only useful for the middle ground where you want less than a full environment, but more than is manageable without a package manager.

Back to top

View user's profile Send private message

gcasillo
l33t
l33t

Joined: 23 Sep 2003
Posts: 739
Location: Cincinnati, Ohio, USA

PostPosted: Tue Jun 15, 2010 2:13 pm    Post subject: Reply with quote

The i686 computer I have is a low-powered netbook (Atom N280). I have three beefier amd64 computers (Core 2 Quad, Core 2 Duo, Atom N330), that I use icecream with to aid in long emerges across those computers. I’d like to utilize their power to help build and emerge the same stuff on the wimpy netbook.
Back to top

View user's profile Send private message

mdhsc
n00b
n00b

Joined: 04 Jul 2010
Posts: 2

PostPosted: Sun Jul 04, 2010 10:30 pm    Post subject: Same problem Reply with quote

gcasillo,

I have been trying to get crossdev to compile glibc to use when updating my netbook and have been getting the same errors. I have tried multiple versions. Have you had any luck? Thanks.

Back to top

View user's profile Send private message

gcasillo
l33t
l33t

Joined: 23 Sep 2003
Posts: 739
Location: Cincinnati, Ohio, USA

PostPosted: Mon Jul 05, 2010 12:49 am    Post subject: Reply with quote

I eventually got crossdev to build an i686 toolchain. I made sure all versions of the toolchain where the same on all machines. Then I did the following to make sure everything was built with the current version of the toolchain:

Code:
emerge -e system ; emerge -e world



Now, I don’t know if this ultimately was what fixed my issue, but after doing this on all of machines, I was able to build an i686 toolchain on my amd64 computers successfully.

On a related note, for some reason, icecream stopped working for me. Jobs weren’t being distributed at all. I had to go back to distcc which works though seemingly not as efficiently as icecream.

Back to top

View user's profile Send private message

regomodo
Guru
Guru

Joined: 25 Mar 2008
Posts: 445

PostPosted: Tue Jul 06, 2010 6:14 pm    Post subject: Reply with quote

I’ve got the same issue atm. It’s one of many with crossdev. crossdev used to be reliable, now I have issues getting almost anything built with it and frankly has become completely useless now. Can’t compile avr, arm, nor i686-pc-linux-gnu anymore, not even with the «-S» arg.
Back to top

View user's profile Send private message

regomodo
Guru
Guru

Joined: 25 Mar 2008
Posts: 445

PostPosted: Sun Jul 18, 2010 1:48 am    Post subject: Reply with quote

gcasillo wrote:
I eventually got crossdev to build an i686 toolchain. I made sure all versions of the toolchain where the same on all machines. Then I did the following to make sure everything was built with the current version of the toolchain:

Code:
emerge -e system ; emerge -e world



Now, I don’t know if this ultimately was what fixed my issue, but after doing this on all of machines, I was able to build an i686 toolchain on my amd64 computers successfully.

«emerge -e system» didn’t work for me. I don’t really want to rebuild world though; i’ve got 1111 packages installed.

Back to top

View user's profile Send private message

mdhsc
n00b
n00b

Joined: 04 Jul 2010
Posts: 2

PostPosted: Tue Jul 20, 2010 1:02 am    Post subject: Still not working Reply with quote

I have tried to rebuild both system and world and still have the same error. When I check /var/log/portage/cross-i686-pc-linux-gnu-glibc.log, I get the following:

checking for i686-pc-linux-gnu-gcc… x86_64-pc-linux-gnu-gcc

checking for suffix of object files… configure: error: in `/var/tmp/cross/i686-pc-linux-gnu/portage/cross-i686-pc-linux-gnu/glibc-2.11-r1/work/build-default-i686-pc-linux-gnu-nptl’:

configure: error: cannot compute suffix of object files: cannot compile

See `config.log’ for more details.

* ERROR: cross-i686-pc-linux-gnu/glibc-2.11-r1 failed:

* failed to configure glibc

Back to top

View user's profile Send private message

regomodo
Guru
Guru

Joined: 25 Mar 2008
Posts: 445

PostPosted: Thu Jul 22, 2010 9:04 pm    Post subject: Reply with quote

Finally emerge -e world and still have the same error as above. I would post a bug at bugzilla but in my experience it’s a futile effort.
Back to top

View user's profile Send private message

xaviermiller
Bodhisattva
Bodhisattva

Joined: 23 Jul 2004
Posts: 8680
Location: ~Brussels — Belgique

PostPosted: Thu Jul 22, 2010 9:20 pm    Post subject: Reply with quote

You don’t need crossdev to build i686 code from a x86_64 processor.

Do you have support for 32 bit code in your 64 bits kernel ?

In that case, download a 32 bits stage 3, change the architecture and chroot into it :

Code:
linux32 chroot /mnt/gentoo32 bin/env -i /bin/bash —login


_________________
Kind regards,

Xavier Miller

Back to top

View user's profile Send private message

regomodo
Guru
Guru

Joined: 25 Mar 2008
Posts: 445

PostPosted: Fri Jul 23, 2010 6:22 pm    Post subject: Reply with quote

XavierMiller wrote:
You don’t need crossdev to build i686 code from a x86_64 processor.

Do you have support for 32 bit code in your 64 bits kernel ?

In that case, download a 32 bits stage 3, change the architecture and chroot into it :

Code:
linux32 chroot /mnt/gentoo32 bin/env -i /bin/bash —login

For distcc it is recommended to cross-compile the correct toolchain AFAIR

Back to top

View user's profile Send private message

SlashBeast
Developer
Developer

Joined: 23 May 2006
Posts: 2922

PostPosted: Mon Aug 23, 2010 9:46 pm    Post subject: Reply with quote

Anyone found a solution? I have the same problem here.
Back to top

View user's profile Send private message

zoolook
n00b
n00b

Joined: 05 Oct 2002
Posts: 16

PostPosted: Mon Aug 30, 2010 8:35 pm    Post subject: Reply with quote

Nobody a clue?
Back to top

View user's profile Send private message

tomatis
n00b
n00b

Joined: 18 Jan 2011
Posts: 1

PostPosted: Tue Jan 18, 2011 2:54 am    Post subject: is ccace active, f.e. in your preroot-path in make.conf? Reply with quote

If ccache is set in the PREROOTPATH-variable in make.conf, it could produce such compile-prolbems.

comment it out temporarily (and do: env-update && souce /etc/profile) for the crossdev-build.

That could help… ;-)
Back to top

View user's profile Send private message

Zer0COOL
n00b
n00b

Joined: 23 Jan 2011
Posts: 1

PostPosted: Sun Jan 23, 2011 8:41 pm    Post subject: Reply with quote

Quote:
I have tried to rebuild both system and world and still have the same error. When I check /var/log/portage/cross-i686-pc-linux-gnu-glibc.log, I get the following:

checking for i686-pc-linux-gnu-gcc… x86_64-pc-linux-gnu-gcc

checking for suffix of object files… configure: error: in `/var/tmp/cross/i686-pc-linux-gnu/portage/cross-i686-pc-linux-gnu/glibc-2.11-r1/work/build-default-i686-pc-linux-gnu-nptl’:

configure: error: cannot compute suffix of object files: cannot compile

See `config.log’ for more details.

* ERROR: cross-i686-pc-linux-gnu/glibc-2.11-r1 failed:

* failed to configure glibc

Try to comment:

Code:
CC=»gcc»

CXX=»g++»



, if you have them in make.conf

That helped for me.

Back to top

View user's profile Send private message

andy753421
n00b
n00b

Joined: 10 Dec 2004
Posts: 17

PostPosted: Wed Feb 16, 2011 5:59 am    Post subject: Reply with quote

I was getting this same error attempting to install mingw32 using crossdev with:

Code:
crossdev -S -s1 -t mingw32

After messing around with it for a while I found a script I wrote a while ago

for setting up mingw32:

Code:
#!/bin/bash

export CFLAGS=»»

export CXXFLAGS=»»

export ACCEPT_KEYWORDS=»x86″

export FEATURES=»buildpkg»

crossdev                     

    -S                       

    -s3                     

    —target i686-pc-mingw32

    -P -k

I’m not sure what the difference between the two is, but the script worked when

the command didn’t. Unforntuantly 2009 is beyond the limit of my memory so I

don’t remember why I wrote the script in the first place, but I may have had

simmilar problems then.

When I was trying to get it to work I tried updating the binutils-config for

mingw32 as well because I appeared to have symlinks for an older mingw32

binutils verison that I had previously uninstalled.

I also changed some things in CFLAGS in /usr/i686-pc-mingw32/etc/make.conf

after I had started the crossdev install but before it started compiling GCC.

I don’t really know what of all that fixed it, and gcc takes way too long to

install for me to debug it further… so… good luck!

Back to top

View user's profile Send private message

regomodo
Guru
Guru

Joined: 25 Mar 2008
Posts: 445

PostPosted: Sun Feb 20, 2011 11:35 am    Post subject: Reply with quote

I’ve got this wonderful error again trying to cross-compile avr-stable.

Why is this package marked stable? It is forever broken.

Looks like it’s time to get my hands dirty and skip out the useless middleman that is crossdev.

Back to top

View user's profile Send private message

regomodo
Guru
Guru

Joined: 25 Mar 2008
Posts: 445

PostPosted: Sun Feb 20, 2011 3:30 pm    Post subject: Reply with quote

Made up a quick and dirty script for building an avr-toolchain for gcc-4.4.5. Although 4.5.1 will build avr-libc fails against it due to bug in GCC, apparently.
Back to top

View user's profile Send private message

Truzzone
Guru
Guru

Joined: 16 Oct 2003
Posts: 492
Location: Italy

PostPosted: Fri Mar 11, 2011 5:15 pm    Post subject: Reply with quote

Code:
 * Building multilib glibc for ABIs: x86 amd64

 *             ABI:   x86

 *          CBUILD:   x86_64-pc-linux-gnu

 *           CHOST:   x86_64-pc-linux-gnu

 *         CTARGET:   armv4tl-softfloat-linux-gnueabi

 *      CBUILD_OPT:

 *     CTARGET_OPT:   i686-pc-linux-gnu

 *              CC:

 *          CFLAGS:   -m32 -pipe -O2 -fno-strict-aliasing

 *       Manual CC:   armv4tl-softfloat-linux-gnueabi-gcc

 * Configuring GLIBC for nptl

/var/tmp/portage/cross-armv4tl-softfloat-linux-gnueabi/glibc-2.11.3/work/glibc-2.11.3/configure —disable-stackguard-randomization —enable-old-ssp-compat —without-fp —enable-add-ons=nptl,c_stubs,libidn,ports —enable-kernel=2.6.9 —without-selinux —without-cvs —enable-bind-now —build=x86_64-pc-linux-gnu —host=i686-pc-linux-gnu —disable-profile —without-gd —with-headers=/usr/armv4tl-softfloat-linux-gnueabi/usr/include —prefix=/usr —libdir=/usr/lib32 —mandir=/usr/share/man —infodir=/usr/share/info —libexecdir=/usr/lib32/misc/glibc —disable-multi-arch

configure: loading site script /usr/share/config.site

configure: loading site script /usr/share/crossdev/include/site/linux

checking build system type… x86_64-pc-linux-gnu

checking host system type… i686-pc-linux-gnu

checking for i686-pc-linux-gnu-gcc… armv4tl-softfloat-linux-gnueabi-gcc

checking for suffix of object files… configure: error: in `/var/tmp/portage/cross-armv4tl-softfloat-linux-gnueabi/glibc-2.11.3/work/build-x86-armv4tl-softfloat-linux-gnueabi-nptl’:

configure: error: cannot compute suffix of object files: cannot compile

See `config.log’ for more details.

 * ERROR: cross-armv4tl-softfloat-linux-gnueabi/glibc-2.11.3 failed (compile phase):

 *   failed to configure glibc

 *

 * Call stack:

 *           ebuild.sh, line   56:  Called src_compile

 *         environment, line 3861:  Called eblit-run ‘src_compile’

 *         environment, line 1223:  Called eblit-glibc-src_compile

 *   src_compile.eblit, line  202:  Called src_compile

 *         environment, line 3861:  Called eblit-run ‘src_compile’

 *         environment, line 1223:  Called eblit-glibc-src_compile

 *   src_compile.eblit, line  210:  Called toolchain-glibc_src_compile

 *   src_compile.eblit, line  123:  Called glibc_do_configure ‘nptl’

 *   src_compile.eblit, line   99:  Called die

 * The specific snippet of code:

 *      «${S}»/configure ${myconf} || die «failed to configure glibc»

 *

 * If you need support, post the output of ’emerge —info =cross-armv4tl-softfloat-linux-gnueabi/glibc-2.11.3′,

 * the complete build log and the output of ’emerge -pqv =cross-armv4tl-softfloat-linux-gnueabi/glibc-2.11.3′.

 * This ebuild is from an overlay: ‘/usr/local/portage/’

 * The complete build log is located at ‘/var/tmp/portage/cross-armv4tl-softfloat-linux-gnueabi/glibc-2.11.3/temp/build.log’.

 * The ebuild environment file is located at ‘/var/tmp/portage/cross-armv4tl-softfloat-linux-gnueabi/glibc-2.11.3/temp/environment’.

 * S: ‘/var/tmp/portage/cross-armv4tl-softfloat-linux-gnueabi/glibc-2.11.3/work/glibc-2.11.3’



Any solution? :?:

Truzzone :?

Back to top

View user's profile Send private message

yokem55
Guru
Guru

Joined: 18 Apr 2002
Posts: 360
Location: Oregon

PostPosted: Sun Mar 13, 2011 1:07 am    Post subject: Reply with quote

I’m running into this. I’ve filed a bug. We’ll see where it goes.

https://bugs.gentoo.org/show_bug.cgi?id=358639
Back to top

View user's profile Send private message

newtrack4
n00b
n00b

Joined: 04 Feb 2006
Posts: 7
Location: Illinois, USA

PostPosted: Thu Jan 05, 2012 7:31 pm    Post subject: Reply with quote

Now I have this bug emerging cross-avr/avr-libc-1.8.0, this seems to have been fixed for a while, only to reemerge again! :(
Back to top

View user's profile Send private message

roarinelk
Guru
Guru

Joined: 04 Mar 2004
Posts: 519

PostPosted: Thu Jan 05, 2012 8:01 pm    Post subject: Reply with quote

newtrack4 wrote:
Now I have this bug emerging cross-avr/avr-libc-1.8.0, this seems to have been fixed for a while, only to reemerge again! :(



cross-avr builds fine for me; try and rebuild perl as well as all autoconf/automake/m4/make packages

(i.e. everything you have in /var/db/pkg/sys-devel/ except gcc, binutils, glibc) I found this often helps.

Back to top

View user's profile Send private message

newtrack4
n00b
n00b

Joined: 04 Feb 2006
Posts: 7
Location: Illinois, USA

PostPosted: Thu Feb 16, 2012 9:16 pm    Post subject: Reply with quote

Just in case someone lands here instead of at the later threads that solved this (https://forums.gentoo.org/viewtopic-t-909964-highlight-avrlibc.html), this seems to be just an amd64 architecture bug, brought out by a change in portage.

The quick solution for me, until amd64 ebuilds are fixed was:

Code:

ABI=»avr» emerge  cross-avr/avr-libc

Back to top

View user's profile Send private message

Wallance
n00b
n00b

Joined: 06 Aug 2015
Posts: 5

PostPosted: Sun Oct 11, 2015 11:27 am    Post subject: Reply with quote

I have the same issue when I building for arm.
Back to top

View user's profile Send private message

Display posts from previous:   

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Введение

Что же у нас есть для кросс-компиляции? Если не считать коммерческих продуктов и мелких поделок, то для того, чтобы скомпилировать любой проект под любую платформу, понадобится Gnu Compiler Collection, или, кратко, GCC. GCC — это один большой набор исходников, но собирать из него кросс-компилятор на каждую новую целевую платформу придётся отдельно.

Надо сказать, список целевых платформ довольно внушителен.

Вообще, для того, чтобы работать с GGC надо собрать т. н. Toolchain, набор утилит для компиляции. В toolchain входит помимно GCC, ещё Binutils, предназначенные для манипуляций с объектными и бинарными файлами. Для голого железа (если планируется работать не под ОС на целевой платформы, весьма полезной будет также NewLib — сборник стандартных процедур.

Binutils

В Binutils входят:

addr2line

Утилита определения места в исходнике по адресу.

ar

Утилита работы с объектными архивами.

c++filt

Дешифратор имён перегруженных функций и методов для языков C++ и Java.

dlltool

Генератор файлов для сборки и использования DLL.

gprof

Профилировщик.

libtool

Библиотекарь — утилита для работы с динамическими и статическими библиотеками.

nlmconv

Конвертер объектных файлов в NLM.

nm

Генератор списка символов.

objcopy

Копировщик и преобразователь объектных файлов.

objdump

Утилита вывода информации по объектным файлам.

ranlib

Утилита индексирования объектных архивов.

readelf

Утилита вывода информации по ELF-файлам.

size

Измеритель размера секций и программ в целом.

strings

Извлекатель символьных строк из объектных файлов.

strip

Утилита для отфильтровывания символических имён, отладочной информации из бинарных файлов.

windmc

Компилятор файлов сообщений для Windows.

windres

Компилятор ресурсов Windows.

GCC

В составе GCC большой набор разнообразных инструментов, однако, скорее всего иметь дело придётся с frontend, который так и называется, gcc. Он сам определяет тип исходного файла и вызывает соответствующий компилятор, а также, по необходимости, линковщик или библиотекарь.

NewLib

NewLib — специальная подборка стандартных функций для встраиваемых систем. Она включает в себя libc (функци работы со строками, файлами и т. д.), libm (разнообразные математические функции). Также она обладает широкими возможностями конфигурирования под разнообразные требования.

Надо сказать, NewLib далеко не единственный выбор. В принципе, если не пользоваться библиотечными функциями, можно вообще без библиотек обойтись, но этот путь сложен и тернист — стандарт си не требует наличия их в т. н. standalone environment1). Вполне возможно, есть другие подходящие варианты

GDB

GNU Debugger — стандартное средство отладки программ, и, в принципе, необязательно. Возможно, вы предпочтёте графический отладчик или вовсе пользуетесь исключительно printf-style-debug2).

Сборка Toolchain

Также стоит определить путь, куда будет всё установлено. В терминах GCC это называется prefix. По умолчанию этот путь — /usr/local. Однако по ряду различных причин иногда стоит специально указать другой. Первая причина — поставить в собственную домашнюю директорию, например, если нет root-полномочий на машине или просто его поставить только для себя (впрочем, лучше так не делать). Другая причина — бывает нужда с специальных вариантах сборки, и тогда это стоит делать, чтобы не спутать такую сборку с обычной. Стоит отметить, что компиляторы под различные платформы не перепутываются, так как имеют различные имена: gcc для ARM, например, будет именоваться arm-elf-gcc3) или arm-linux-gcc, и именно его придётся указывать при компиляции (либо указывать target, тогда gcc сам вызовет нужный). Если же оставить путь по-умолчанию, сборка попадёт в стандартный путь поиска исполняемых файлов — /usr/local/bin, и может вызываться без специального указания пути или модификации $path.

Для указания prefix у configure есть соответствующая опция: --prefix=…

Порядок сборки Toolchain

Сборка тулчейна в описанной конфигурации состоит из следующих этапов:

  1. подготовка пространства для сборки, скачивание и распаковка исходников и т. п.;

  2. сборка и установка Binutils;

  3. сборка и установка предварительного варианта GCC для сборки NewLib;

  4. сборка и установка NewLib;

  5. сборка и установка окончательного варианта GCC (с поддержкой NewLib).

Необходимые приготовления

Прежде всего нужно сделать себе „сборочную площадку“ для тулчейна. Пусть это будет директория. ~/toolchain. Создадим её и перейдём туда:

mkdir ~/toolchain
cd ~/toolchain

Для инсталляции требуются свежие исходники.

  • Binutils берётся с http://ftp.gnu.org/gnu/binutils/, файл типа binutils-n.n.n.tar.gz (n.n.n — версия, последняя на момент написания — 2.20.1)

  • GCC качается с сайта http://gcc.gnu.org/mirrors.html, нужен файл типа gcc-n.n.n.tar.bz2 (последний на момент написания — 4.3.5).

Маленькое замечание: в качестве последней версии GCC указана 4.3.5, несмотря на наличие 4.5.1. Дело в том, что это две параллельных ветки компилятора, однако 4.5.1 при этом мне собрать не удалось — возникала ошибка configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES.

В дальнейшем в качестве примеров я буду приводить данные версии и целевую платформу arm-elf, так как собирал именно их. Полагаю, описание также подойдёт и к другим версиям и платформам. Сборка проивзводилась на дистрибутиве Ubuntu 10.04 LTS, поэтому замечания, касающиеся дополнительных бинарных пакетов, будут касаться именно его. однако, думаю, нет никаких сложностей найти аналогичные пакеты для любого другого.

Распаковка сходников проста и элементарна для любого знакомого с командной строкой Linux:

tar xaf binutils-2.20.1.tar.gz
tar xaf gcc-4.3.5.tar.bz2
tar xaf newlib-1.18.0.tar.gz

Для сборки тулчейна также необходимы дополнительные пакеты:

build-essential

Набор средств для сборки пакетов Debian, нужен, так как включает в себя всё необходимое для компиляции.

texinfo

Cредства подготовки документации в формате texinfo. Вроде бы, опциональный пакет, судя по тому, что выдаётся только предупреждение о его желательности, но компиляция binutils прерывается.

sudo aptitude install build-essential texinfo libgmp3-dev libmpfr-dev libmpc-dev

Если какого-либо из этих пакетов, то сборка тулчейна прерывается с какой-нибудь ошибкой, причём из-за чего «лыжи не едут», бывает неочевидным. 4)

Binutils

Для сборки Binutils необходима отдельная пустая директория. И всё следует делать находясь в ней.
Стандартную подготовку можно сделать так:

mkdir build-binutils
cd build-binutils

Затем необходимо запустить скрипт конфигурации:

../binutils-2.20.1/configure --target=arm-elf --enable-interwork --enable-multilib 
--with-gnu-as --with-gnu-ld --disable-nls

Что значат эти опции:

–target=arm-elf

Наша целевая платформа

–enable-interwork

Специфичная для ARM опция, обеспецивающая взаимодействие режимов ARM и THUMB.

–enable-multilib

Также специфичная для ARM опция, необходимая для работы в нескольких режимах (LE, BE).

–with-gnu-as

Собирать ассемблер

–with-gnu-ld

Собирать линкер

–disable-nls

Отключает интернационализацию. Обычно оно не нужно.

Надо сказать, я сначала по ошибке скачал версию 2.9.1, и она отказалась собираться — configure выдавал ошибку под предлогом BFD does not support target arm-unknown-elf.

После этого происходит собственно сборка:

  make

Впрочем, для ускорения можно указать опцию make -j n, где n — число потоков, в которых будет производиться сборка. Это ускорит сборку на многопроцессорных машинах, правда несколько сложнее будет разобрать вывод на экране в случае ошибки сборки.

Затем установка в систему:

sudo make install

(sudo — команда, запускающая команду с правами root, если в вашей системе другой способ получения прав, используйте его).

Если префикс сохранён по умолчанию, можно убедиться, что команды доступны из консоли — если набрать arm-elf- и нажать Tab, шелл предложит на выбор команды из пакета — arm-elf-ar, arm-elf-ld и т. д.

Теперь стоит не забыть покинуть директорию сборки

cd ..

Предварительная сборка GCC

Так же, как и в случае с Binutils, процесс сборки GCC стоит проивзводить в отдельной директории

mkdir build-pre-gcc
cd build-pre-gcc
../gcc-4.3.5/configure --target=arm-elf --enable-interwork --enable-multilib 
--enable-languages="c" --with-newlib --without-headers --disable-shared --with-gnu-ld 
--with-gnu-as --with-float=soft --disable-nls

Снова стоит разобрать опции конфигурации: 5)

–enable-multilib

Всё то же, однако утверждают, что эта опция включена по умолчанию6), так что её указывать не нужно, более того, обработка этой опции сломана в некоторых версиях GCC (4.5.1 например).

–enable-languages=»c»

Для сборки NewLib ничего не нужно, кроме компилятора си.

–with-newlib

Хитрая опция совместимости с NewLib. Что она делает, читайте в документации к GCC, но делает она совсем немного.

–without-headers

Отключает установку стандартных хедеров, для сборки NewLib они не требуются.

–disable-shared

Отключает поддержку динамических библиотек, на встраиваемой системе оно и не нужно.

–with-float=soft

Способ работы с числами с плавающей запятой — если нет FPU, ставится эта опция.

make all-gcc
make install-gcc
cd ..

Сборка NewLib

Сборка NewLib начинается подобным одбразом:

mkdir build-newlib
cd build-newlib

А дальше следует заметить, что у NewLib огромное количество конфигурационных параметров. О них подробно можно почитать в статье «konfiguracija_newlib».

../newlib-1.18.0/configure --target=arm-elf --enable-interwork --enable-multilib 
--with-gnu-as --with-gnu-ld --disable-nls --disable-newlib-supplied-syscalls --enable-newlib-mb 
--enable-newlib-io-c99-formats --enable-newlib-io-long-long --enable-newlib-io-pos-args 
--enable-newlib-multithread

Сборка:

make
sudo make install
cd ..

Окончательная сборка GCC

mkdir build-gcc
cd build-gcc
../gcc-4.3.5/configure --target=arm-elf --enable-interwork --enable-multilib 
--enable-languages="c,c++" --with-newlib --disable-shared --with-gnu-ld 
--with-gnu-as --with-float=soft --disable-nls
make
sudo make install
cd ..

Замечания относительно ARM

Multilib

ARM отличается разнообразием вариантов исполнения, подчас несовместимых с собой — little / big endian, наборами инструкций ARM, Thumb, Thumb2, JAVA и т. д, без или с блоком плавающей арифметики и т. д. Если только вы не собираетесь всегда работать с одним и тем же чипом, вам понадобится держать по крайней мере несколько вариантов библиотек. Так что здесь как нигде полезна будет опция Multilib.

При сборке GCC обязательно укажите --enable-multilib, а также набор необходимых вариантов7).

Multilib конфигурируется в файле gcc-n.n.n/gcc/config/arm/t-arm-elf из архива исходников. В нём следует раскомментировать соответствующие нужным опциям строки (убрав решётку и пробел в начале).

Архитектура ARMv7 (Cortex, набор инструкций Thumb2):

MULTILIB_OPTIONS      += march=armv7
MULTILIB_DIRNAMES     += thumb2
MULTILIB_EXCEPTIONS   += march=armv7* marm/*march=armv7*
MULTILIB_MATCHES      += march?armv7=march?armv7-a
MULTILIB_MATCHES      += march?armv7=march?armv7-r
MULTILIB_MATCHES      += march?armv7=march?armv7-m
MULTILIB_MATCHES      += march?armv7=mcpu?cortex-a8
MULTILIB_MATCHES      += march?armv7=mcpu?cortex-r4
MULTILIB_MATCHES      += march?armv7=mcpu?cortex-m3

Способы передачи чисел с плавающей запятой:

MULTILIB_OPTIONS       += mfloat-abi=hard
MULTILIB_DIRNAMES      += fpu
MULTILIB_EXCEPTIONS    += *mthumb/*mfloat-abi=hard*
MULTILIB_EXCEPTIONS    += *mcpu=fa526/*mfloat-abi=hard*
MULTILIB_EXCEPTIONS    += *mcpu=fa626/*mfloat-abi=hard*

Разный порядок байтов:

MULTILIB_OPTIONS     += mlittle-endian/mbig-endian
MULTILIB_DIRNAMES    += le be
MULTILIB_MATCHES     += mbig-endian=mbe mlittle-endian=mle

С и без блока плавающей арифметики:

MULTILIB_OPTIONS    += mhard-float/msoft-float
MULTILIB_DIRNAMES   += fpu soft
MULTILIB_EXCEPTIONS += *mthumb/*mhard-float*

Поддержка Cortex (armv7) конфликтует с поддержкой hard-float (make возвращает «configure: error: cannot compute suffix of object files: cannot compile»), видимо требуется добавить некоторые исключения, но понять, какие, мне не удалось. Так что либо FPU, либо Cortex, либо ковырять дальше.

Строки, касающиеся поддержки разных ABI нужны, если их действительно нужно использовать.

Версии, поддерживающие и не поддерживающие перекрёстные вызовы (режимы ARM/Thumb):

MULTILIB_OPTIONS    += mno-thumb-interwork/mthumb-interwork
MULTILIB_DIRNAMES   += normal interwork

Разные способы именования:

MULTILIB_OPTIONS    += fno-leading-underscore/fleading-underscore
MULTILIB_DIRNAMES   += elf under

Строки, касающиеся отдельных чипов, старых архитектур обычно можно не раскомментировать.

Чипы Faraday Tech:

MULTILIB_OPTIONS     += mcpu=fa526/mcpu=fa626/mcpu=fa606te/mcpu=fa626te/mcpu=fmp626/mcpu=fa726te
MULTILIB_DIRNAMES    += fa526 fa626 fa606te fa626te fmp626 fa726te
MULTILIB_EXCEPTIONS  += *mthumb*/*mcpu=fa526 *mthumb*/*mcpu=fa626

Чипы Cirrus Logic

MULTILIB_OPTIONS    += mcpu=ep9312
MULTILIB_DIRNAMES   += ep9312
MULTILIB_EXCEPTIONS += *mthumb/*mcpu=ep9312*

ARMv3 и более ранние:

MULTILIB_OPTIONS    += mcpu=arm7
MULTILIB_DIRNAMES   += nofmult
MULTILIB_EXCEPTIONS += *mthumb*/*mcpu=arm7*
MULTILIB_MATCHES    += mcpu?arm7=mcpu?arm7d
MULTILIB_MATCHES    += mcpu?arm7=mcpu?arm7di
MULTILIB_MATCHES    += mcpu?arm7=mcpu?arm70
MULTILIB_MATCHES    += mcpu?arm7=mcpu?arm700
MULTILIB_MATCHES    += mcpu?arm7=mcpu?arm700i
MULTILIB_MATCHES    += mcpu?arm7=mcpu?arm710
MULTILIB_MATCHES    += mcpu?arm7=mcpu?arm710c
MULTILIB_MATCHES    += mcpu?arm7=mcpu?arm7100
MULTILIB_MATCHES    += mcpu?arm7=mcpu?arm7500
MULTILIB_MATCHES    += mcpu?arm7=mcpu?arm7500fe
MULTILIB_MATCHES    += mcpu?arm7=mcpu?arm6
MULTILIB_MATCHES    += mcpu?arm7=mcpu?arm60
MULTILIB_MATCHES    += mcpu?arm7=mcpu?arm600
MULTILIB_MATCHES    += mcpu?arm7=mcpu?arm610
MULTILIB_MATCHES    += mcpu?arm7=mcpu?arm620

Возможные проблемы и решения

  • Если сборка binutils или gcc обрывается странными ошибками компиляции, может помочь опция --disable-werror.

  • С libssp иногда не собирается gcc. К configure можно добавить ключ –disable-libssp.

Полезные советы

  • Про сборке (make) сообщение «configure: error: cannot compute suffix of object files: cannot compile» может говорить о том, что используются несовместимые опции, например в конфигурации Multilib (см. выше). Файл config.log при этом приходится искать в поддиректориях (можно использовать find, поиск в mc по указанному сообщению).

  • В GCC есть поддержка дробной арифметики с фиксированной запятой согласно TR 18037: Embedded C, которая включается опцией конфигурации --enable-fixed-point (и выключается соответстветственно --disable-fixed-point), однако она сделана только для платформы MIPS.

Рабочие конфигурации

ARM-EABI

binutils-2.22

Опции:

--target=arm-x-eabi --enable-interwork --enable-multilib 
--with-gnu-as --with-gnu-ld --disable-nls

gcc-4.6.3

Раскомментированы строки в файле gcc/config/t-arm-elf:

MULTILIB_OPTIONS      += march=armv7
MULTILIB_DIRNAMES     += thumb2
MULTILIB_EXCEPTIONS   += march=armv7* marm/*march=armv7*
MULTILIB_MATCHES      += march?armv7=march?armv7-a
MULTILIB_MATCHES      += march?armv7=march?armv7-r
MULTILIB_MATCHES      += march?armv7=march?armv7-m
MULTILIB_MATCHES      += march?armv7=mcpu?cortex-a8
MULTILIB_MATCHES      += march?armv7=mcpu?cortex-r4
MULTILIB_MATCHES      += march?armv7=mcpu?cortex-m3

...

MULTILIB_OPTIONS     += mlittle-endian/mbig-endian
MULTILIB_DIRNAMES    += le be
MULTILIB_MATCHES     += mbig-endian=mbe mlittle-endian=mle

Опции:

--target=arm-x-eabi --enable-interwork --enable-languages="c,c++" 
--with-newlib --without-headers --disable-shared --with-gnu-ld --with-gnu-as 
--disable-nls --disable-libssp --disable-libada --enable-lto --with-system-zlib

newlib-1.20.0

Опции:

--target=arm-x-eabi --enable-interwork --enable-multilib --with-gnu-as 
--with-gnu-ld --disable-nls --disable-newlib-supplied-syscalls 
--enable-newlib-mb --enable-newlib-io-c99-formats --enable-newlib-io-long-long

Правильность компиляции пока не проверил.

Ссылки

Понравилась статья? Поделить с друзьями:
  • Connection attempt failed with error 10060 proxifier
  • Connecting to the guest os via vix error mlocate was not found
  • Connecting to the guest os via ssh error mlocate was not found
  • Connecting to server error could not connect to server
  • Connecting to remote server failed with the following error message the client cannot connect to