Error gnu stubs 32 h no such file or directory

I am trying to install Nachos on my laptop and I have Ubuntu 11.04 on the laptop. The code is in C and so to build it I assume I will need cross compiler. This is where my problem is. I download...

You’re missing the 32 bit libc dev package:

On Ubuntu it’s called libc6-dev-i386 — do sudo apt-get install libc6-dev-i386. See below for extra instructions for Ubuntu 12.04.

On Red Hat distros, the package name is glibc-devel.i686 (Thanks to David Gardner’s comment).

On CentOS 5.8, the package name is glibc-devel.i386 (Thanks to JimKleck’s comment).

On CentOS 6 / 7, the package name is glibc-devel.i686.

On SLES it’s called glibc-devel-32bit — do zypper in glibc-devel-32bit.

On Gentoo it’s called sys-libs/glibc — do emerge -1a sys-libs/gcc
[source] (Note : One may use equery to confirm this is correct; do equery belongs belongs /usr/include/gnu/stubs-32.h)

On ArchLinux, the package name is lib32-glibc — do pacman -S lib32-glibc.


Are you using Ubuntu 12.04? There is a known problem that puts the files in a non standard location. You’ll also need to do:

export LIBRARY_PATH=/usr/lib/$(gcc -print-multiarch)
export C_INCLUDE_PATH=/usr/include/$(gcc -print-multiarch)
export CPLUS_INCLUDE_PATH=/usr/include/$(gcc -print-multiarch)

somewhere before you build (say in your .bashrc).


If you are also compiling C++ code, you will also need the 32 bit stdc++ library. If you see this warning:

…. /usr/bin/ld: cannot find -lstdc++ ….

On Ubuntu you will need to do sudo apt-get install g++-multilib

On CentOS 5 you will need to do yum install libstdc++-devel.i386

On CentOS 6 you will need to do yum install libstdc++-devel.i686

Please feel free to edit in the packages for other systems.

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"
View previous topic :: View next topic  
Author Message
Evildad
Guru
Guru

Joined: 15 Apr 2004
Posts: 475

PostPosted: Mon Sep 25, 2006 4:51 pm    Post subject: gnu/stubs-32.h: No such file or directory(multilib?)[SOLVED] Reply with quote

mod edit:

split from GCC 4.1.1 and glibc 2.4 stable on x86 and amd64 and moved to the amd64 forum.

amne

HI there tried to

emerge -gcc but it fails

I could merge it with my old 3.4.6 gcc but after making the 4.1.1 default it fails…

Anyone can help me with this?

Thanks

evil

Code:

emerge -pv gcc

sys-devel/gcc-4.1.1-r1 [4.1.1] USE=»fortran gtk nls (-altivec) -bootstrap -build -doc -gcj (-hardened) -ip28 -ip32r10k -mudflap (-multilib) -multislot (-n32) (-n64) -nocxx -objc -objc++ -objc-gc -test -vanilla» 0 kB

Error Message:

In file included from /usr/include/features.h:346,

                 from /usr/include/stdio.h:28,

                 from /var/tmp/portage/gcc-4.1.1-r1/work/gcc-4.1.1/gcc/tsystem.h:90,

                 from /var/tmp/portage/gcc-4.1.1-r1/work/gcc-4.1.1/gcc/crtstuff.c:68:

/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory

make[4]: *** [32/crtbegin.o] Error 1

make[4]: Leaving directory `/var/tmp/portage/gcc-4.1.1-r1/work/build/gcc’

make[3]: *** [extra32] Error 2

make[3]: Leaving directory `/var/tmp/portage/gcc-4.1.1-r1/work/build/gcc’

make[2]: *** [stmp-multilib] Error 2

make[2]: Leaving directory `/var/tmp/portage/gcc-4.1.1-r1/work/build/gcc’

make[1]: *** [stage1_build] Error 2

make[1]: Leaving directory `/var/tmp/portage/gcc-4.1.1-r1/work/build/gcc’

make: *** [profiledbootstrap] Error 2

!!! ERROR: sys-devel/gcc-4.1.1-r1 failed.

Call stack:

  ebuild.sh, line 1546:   Called dyn_compile

  ebuild.sh, line 937:   Called src_compile

  ebuild.sh, line 1255:   Called toolchain_src_compile

  toolchain.eclass, line 24:   Called gcc_src_compile

  toolchain.eclass, line 1534:   Called gcc_do_make

  toolchain.eclass, line 1408:   Called die

!!! emake failed with profiledbootstrap

!!! If you need support, post the topmost build error, and the call stack if relevant.

emerge —info

Code:
emerge —info

Portage 2.1.1 (default-linux/amd64/2006.1/desktop, gcc-4.1.1, glibc-2.4-r3, 2.6.17-gentoo-r8 x86_64)

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

System uname: 2.6.17-gentoo-r8 x86_64 AMD Athlon(tm) 64 Processor 3000+

Gentoo Base System version 1.12.5

Last Sync: Sun, 24 Sep 2006 00:00:01 +0000

app-admin/eselect-compiler: [Not Present]

dev-java/java-config: 1.3.7, 2.0.30

dev-lang/python:     2.3.5-r2, 2.4.3-r1

dev-python/pycrypto: 2.0.1-r5

dev-util/ccache:     [Not Present]

dev-util/confcache:  [Not Present]

sys-apps/sandbox:    1.2.17

sys-devel/autoconf:  2.13, 2.59-r7

sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2

sys-devel/binutils:  2.16.1-r3

sys-devel/gcc-config: 1.3.13-r3

sys-devel/libtool:   1.5.22

virtual/os-headers:  2.6.11-r2

ACCEPT_KEYWORDS=»amd64″

AUTOCLEAN=»yes»

CBUILD=»x86_64-pc-linux-gnu»

CFLAGS=»-march=athlon64 -O2 -pipe»

CHOST=»x86_64-pc-linux-gnu»

CONFIG_PROTECT=»/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/lib/X11/xkb /usr/share/X11/xkb /usr/share/config»

CONFIG_PROTECT_MASK=»/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/splash /etc/terminfo»

CXXFLAGS=»-march=athlon64 -O2 -pipe»

DISTDIR=»/usr/portage/distfiles»

FEATURES=»autoconfig distlocks metadata-transfer parallel-fetch sandbox sfperms strict»

GENTOO_MIRRORS=»http://pandemonium.tiscali.de/pub/gentoo/ ftp://pandemonium.tiscali.de/pub/gentoo/ http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/»

LINGUAS=»en»

MAKEOPTS=»-j2″

PKGDIR=»/usr/portage/packages»

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

PORTAGE_TMPDIR=»/var/tmp»

PORTDIR=»/usr/portage»

PORTDIR_OVERLAY=»/usr/local/portage»

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

USE=»amd64 X alsa arts avi berkdb bitmap-fonts cairo cdr cli crypt cups dbus dlloader dri dvd dvdr eds elibc_glibc emboss encode esd fam firefox fortran gdbm gif gnome gpm gstreamer gtk gtk2 hal input_devices_keyboard input_devices_mouse isdnlog jpeg kernel_linux libg++ linguas_en mad mikmod mp3 mpeg mysql ncurses nls nptl nptlonly ogg opengl oss pam pcre pdflib perl png ppds pppd python qt3 qt4 quicktime readline reflection sdl session spell spl ssl tcpd truetype truetype-fonts type1-fonts udev unicode userland_GNU video_cards_nvidia vorbis xml xorg xv zlib»

Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS


Code:

gcc-config -c

x86_64-pc-linux-gnu-4.1.1

Last edited by Evildad on Mon Oct 23, 2006 9:35 am; edited 1 time in total

Back to top

View user's profile Send private message

amne
Bodhisattva
Bodhisattva

Joined: 17 Nov 2002
Posts: 6378
Location: Graz / EU

PostPosted: Mon Sep 25, 2006 7:01 pm    Post subject: Reply with quote

Perhaps you forgot to do

Code:
source /etc/profile

after updating gcc?

Try doing that and then compile again.
_________________
Dinosaur week! (Ok, this thread is so last week)

Back to top

View user's profile Send private message

Evildad
Guru
Guru

Joined: 15 Apr 2004
Posts: 475

PostPosted: Tue Sep 26, 2006 4:23 am    Post subject: Reply with quote

amne wrote:
Perhaps you forgot to do

Code:
source /etc/profile

after updating gcc?

Try doing that and then compile again.

Same error…

And I think I already did that step…

To which package belongs stubs because this is causing the error…

Code:
 /usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory

Back to top

View user's profile Send private message

ikshaar
Veteran
Veteran

Joined: 23 Jul 2002
Posts: 1339
Location: Baltimore, MD

PostPosted: Tue Sep 26, 2006 11:56 am    Post subject: Reply with quote

equery is your friend ;)

Code:
 # equery belongs /usr/include/gnu/stubs.h

[ Searching for file(s) /usr/include/gnu/stubs.h in *… ]

sys-libs/glibc-2.4-r3 (/usr/include/gnu/stubs.h)



and

Code:
 equery belongs /usr/include/gnu/stubs-32.h

[ Searching for file(s) /usr/include/gnu/stubs-32.h in *… ]

sys-libs/glibc-2.4-r3 (/usr/include/gnu/stubs-32.h)


_________________
«May God stands between you and harm in all the empty places where you must walk» — Babylon 5

Back to top

View user's profile Send private message

Evildad
Guru
Guru

Joined: 15 Apr 2004
Posts: 475

PostPosted: Tue Sep 26, 2006 1:43 pm    Post subject: Reply with quote

ikshaar wrote:
equery is your friend ;)

I know that but

Code:

equery belongs /usr/include/gnu/stubs-32.h

[ Searching for file(s) /usr/include/gnu/stubs-32.h in *… ]

and

Code:

equery belongs /usr/include/gnu/stubs.h

[ Searching for file(s) /usr/include/gnu/stubs.h in *… ]

sys-libs/glibc-2.4-r3 (/usr/include/gnu/stubs.h)

But why isn’t there a stubs-32.h

Is this x86 related bc I’m running on AMD64

Thanks,

evil

Back to top

View user's profile Send private message

ikshaar
Veteran
Veteran

Joined: 23 Jul 2002
Posts: 1339
Location: Baltimore, MD

PostPosted: Tue Sep 26, 2006 4:44 pm    Post subject: Reply with quote

running amd64 too here.. and I have it… not sure why you don’t.

only flag I had on emerging glibc were ntpl and ntplonly and fortran and gtk for gcc.
_________________
«May God stands between you and harm in all the empty places where you must walk» — Babylon 5

Back to top

View user's profile Send private message

Evildad
Guru
Guru

Joined: 15 Apr 2004
Posts: 475

PostPosted: Tue Sep 26, 2006 5:06 pm    Post subject: Reply with quote

ikshaar wrote:
running amd64 too here.. and I have it… not sure why you don’t.

only flag I had on emerging glibc were ntpl and ntplonly and fortran and gtk for gcc.

Just wanted to

#emerge -v glibc

Code:
checking whether x86_64-pc-linux-gnu-gcc accepts -g… yes

checking for x86_64-pc-linux-gnu-gcc option to accept ANSI C… none needed

checking how to run the C preprocessor… /lib/cpp

configure: error: C preprocessor «/lib/cpp» fails sanity check

See `config.log’ for more details.

!!! ERROR: sys-libs/glibc-2.4-r3 failed.

Call stack:

  ebuild.sh, line 1546:   Called dyn_compile

  ebuild.sh, line 937:   Called src_compile

  glibc-2.4-r3.ebuild, line 1173:   Called src_compile

  glibc-2.4-r3.ebuild, line 1184:   Called toolchain-glibc_src_compile

  glibc-2.4-r3.ebuild, line 251:   Called glibc_do_configure ‘nptl’

  glibc-2.4-r3.ebuild, line 941:   Called die

!!! failed to configure glibc

!!! If you need support, post the topmost build error, and the call stack if relevant.

There is a /lib/cpp but

equery belongs /lib/cpp says

Code:
equery belongs /lib/cpp

[ Searching for file(s) /lib/cpp in *… ]

Really strange…

Back to top

View user's profile Send private message

amne
Bodhisattva
Bodhisattva

Joined: 17 Nov 2002
Posts: 6378
Location: Graz / EU

PostPosted: Tue Sep 26, 2006 5:12 pm    Post subject: Reply with quote

While i have nfc about AMD64 and multilib issues i think i saw something similar in the german forums a few days ago (without a real solution though). Have you guys switched your profile recently, and if so perhaps from/to a (non-)multilib one?
_________________
Dinosaur week! (Ok, this thread is so last week)
Back to top

View user's profile Send private message

ikshaar
Veteran
Veteran

Joined: 23 Jul 2002
Posts: 1339
Location: Baltimore, MD

PostPosted: Tue Sep 26, 2006 5:15 pm    Post subject: Reply with quote

using default-linux/amd64/2006.1/desktop here, if that matters.
_________________
«May God stands between you and harm in all the empty places where you must walk» — Babylon 5
Back to top

View user's profile Send private message

Evildad
Guru
Guru

Joined: 15 Apr 2004
Posts: 475

PostPosted: Wed Sep 27, 2006 3:47 am    Post subject: Reply with quote

amne wrote:
While i have nfc about AMD64 and multilib issues i think i saw something similar in the german forums a few days ago (without a real solution though). Have you guys switched your profile recently, and if so perhaps from/to a (non-)multilib one?

I changed my profile from 2005.0 to amd64/2006.1/desktop…

And i will have a look at the German Thread.

Edit: Danke Amne, dass du extra nen Thread erstellt hast…

Back to top

View user's profile Send private message

gregw
Tux’s lil’ helper
Tux's lil' helper

Joined: 20 Nov 2004
Posts: 106
Location: Warrington, Cheshire, England

PostPosted: Tue Oct 03, 2006 9:49 pm    Post subject: Reply with quote

Quote:
I changed my profile from 2005.0 to amd64/2006.1/desktop…

This sounds very familiar to me. I saw this problem on my amd64 box when i recompiled with -eN Like an idiot my profile link was wrong it should hae pointed to amd64/2006.1/desktop and i linked it to x86/2006.1/desktop rebuild everything with a couple of errors realised what I had done (after 2 days) changed the link, emerged everything again and got these glibc errors and gcc compilation errors.

Just attempting to do a stage 3 over the top now.

GregW

Back to top

View user's profile Send private message

Evildad
Guru
Guru

Joined: 15 Apr 2004
Posts: 475

PostPosted: Mon Oct 23, 2006 9:34 am    Post subject: Reply with quote

Got it back on track :D :D

I accidently switched to a non multilib profile…

Steps i made

Code:

1. I had a working x86_64-pc-linux-gnu-3.4.6 multilib gcc. Reverted back to it

2. switched to a multilib profile

3. emerged glibc gcc

4. switched to a working multilib gcc-4.1.1

5. emerged system

6. emerged world



Everything’s fine now.

Thanks to all

Back to top

View user's profile Send private message

AeroIllini
Tux’s lil’ helper
Tux's lil' helper

Joined: 01 Feb 2004
Posts: 94

PostPosted: Mon Jan 29, 2007 2:58 am    Post subject: Reply with quote

I’m having the same issue: glibc complains that lib/cpp is not sane, and gcc complains that it cannot find stubs-32.h, which glibc provides. It’s a circular dependency issue.

However, I do not have an old install of gcc to fall back on. Only 4.1.1 is installed on my system.

I am using default-linux/amd64/2006.1/desktop as my profile, and have not changed it since first install.

How can I fix this, short of reinstalling everything?

Back to top

View user's profile Send private message

Sysa
Apprentice
Apprentice

Joined: 16 Mar 2005
Posts: 161
Location: Europe

PostPosted: Fri Apr 27, 2007 10:03 am    Post subject: Reply with quote

AeroIllini wrote:
I’m having the same issue: glibc complains that lib/cpp is not sane, and gcc complains that it cannot find stubs-32.h, which glibc provides. It’s a circular dependency issue.

However, I do not have an old install of gcc to fall back on. Only 4.1.1 is installed on my system.

I am using default-linux/amd64/2006.1/desktop as my profile, and have not changed it since first install.

How can I fix this, short of reinstalling everything?

I had the same problem recently: after kernel upgrade I set wrong profile (/usr/portage/profiles/default-linux/x86/2007.0/server instead of /usr/portage/profiles/default-linux/amd64/2007.0/server) and started to recompile all ;(((.

The problem was solved by installing gcc and glibc from binaries:

1. Copy necessary packages from http://tinderbox.dev.gentoo.org/default-linux/amd64/ to /usr/portage/packages/All/

2. Emerge broken packages:

emerge -Kv1 gpm mpfr gcc glibc etc

3. Recompile all:

emerge glibc binutils gcc

env-update

source /etc/profile

emerge -e system

env-update

source /etc/profile

emerge -e world

4. Clean-up:

emerge —depclean

5. Check and repair:

revdep-rebuild

6. Enjoy!
_________________
RedHat -> SuSE -> Debian -> Gentoo

Back to top

View user's profile Send private message

AlecTavi
n00b
n00b

Joined: 21 Jul 2005
Posts: 18
Location: Washington, DC

PostPosted: Mon May 07, 2007 4:23 pm    Post subject: Thanks Reply with quote

I just wanted to say thanks to everybody on this thread. I accidentally set my profile to an x86 profile for almost a month :oops:, before updating glibc and getting very bizarre behavior. This thread pointed me in the right direction to fix everything. Thanks!
Back to top

View user's profile Send private message

rojanu
Guru
Guru

Joined: 02 Feb 2004
Posts: 361
Location: London

PostPosted: Mon Jun 11, 2007 1:19 pm    Post subject: Reply with quote

I am having the same problem but I have checked my profile and seems OK to me.

Code:
In file included from /usr/include/features.h:346,

                 from /usr/include/signal.h:29,

                 from ../include/setjmp.h:11,

                 from ../include/pngconf.h:313,

                 from ../include/png.h:363,

                 from sys/vesa/background.c:29:

/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory


Code:
# emerge —info

Portage 2.1.2.9 (default-linux/amd64/2007.0/no-multilib, gcc-4.1.2, glibc-2.5-r3, 2.6.21-gentoo-r2 x86_64)

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

System uname: 2.6.21-gentoo-r2 x86_64 AMD Athlon(tm) 64 Processor 3000+

Gentoo Base System release 1.12.10

Timestamp of tree: Mon, 11 Jun 2007 08:50:01 +0000

ccache version 2.4 [enabled]

dev-java/java-config: 1.3.7, 2.0.33-r1

dev-lang/python:     2.4.4-r4

dev-python/pycrypto: 2.0.1-r5

dev-util/ccache:     2.4-r7

sys-apps/sandbox:    1.2.18.1

sys-devel/autoconf:  2.13, 2.61

sys-devel/automake:  1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10

sys-devel/binutils:  2.17

sys-devel/gcc-config: 1.3.16

sys-devel/libtool:   1.5.23b

virtual/os-headers:  2.6.21

ACCEPT_KEYWORDS=»amd64 ~amd64″

AUTOCLEAN=»yes»

CBUILD=»x86_64-pc-linux-gnu»

CFLAGS=» -msse2″

CHOST=»x86_64-pc-linux-gnu»

CONFIG_PROTECT=»/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config»

CONFIG_PROTECT_MASK=»/etc/env.d /etc/env.d/java/ /etc/gconf /etc/init.d /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/rc.d /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/wget»

CXXFLAGS=» -msse2″

DISTDIR=»/usr/portage/distfiles»

FEATURES=»ccache distlocks fixpackages metadata-transfer sandbox sfperms strict with-bdeps»

GENTOO_MIRRORS=»http://mirror.ovh.net/gentoo-distfiles/ http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/ http://www.mirrorservice.org/sites/www.ibiblio.org/gentoo/»

LANG=»en_GB@euro»

LC_ALL=»en_GB@euro»

LINGUAS=»en_GB ku tr»

MAKEOPTS=»-j2″

PKGDIR=»/usr/portage/packages»

PORTAGE_RSYNC_EXTRA_OPTS=»—exclude-from=/etc/portage/package.excludes»

PORTAGE_RSYNC_OPTS=»—recursive —links —safe-links —perms —times —compress —force —whole-file —delete —delete-after —stats —timeout=180 —exclude=/distfiles —exclude=/local —exclude=/packages —filter=H_**/files/digest-*»

PORTAGE_TMPDIR=»/var/tmp»

PORTDIR=»/usr/portage»

PORTDIR_OVERLAY=»/usr/local/portage»

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

USE=»3dnow X a52 aalib acl acpi alsa amd64 apache2 automount berkdb bitmap-fonts cdr cjk cli cracklib crypt cups dbus directfb doc dri dv dvd dvdr dvdread fam fbdev ffmpeg firefox flash fortran ftp gdbm gphoto2 gpm hal howl iconv imap isdnlog java javascript junit kde ldap libg++ lm_sensors logrotate midi mmx mono mozsvg mp3 mpi msn mudflap mysql nas ncurses network nfs nls nptl nptlonly nsplugin oav odbc openmp openssl pam pcre pdf perl php pic ppds pppd python qt qt4 quicktime quotas readline reflection rtc samba sasl scanner session slp sox spl sse sse2 ssl tcpd tiff truetype truetype-fonts type1-fonts udev unicode usb vcd videos wmf xine xml xorg xscreensaver xvid zip zlib» ALSA_CARDS=»intel8x0″ ALSA_PCM_PLUGINS=»adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol» ELIBC=»glibc» INPUT_DEVICES=»keyboard mouse vmmouse» KERNEL=»linux» LCD_DEVICES=»bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text» LINGUAS=»en_GB ku tr» USERLAND=»GNU» VIDEO_CARDS=»vga sis vmware»

Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS


_________________
«Any fool can write code that a computer can understand. Good programmers write code that humans can understand.» — Martin Fowler,

Linux User: #416714

Back to top

View user's profile Send private message

Massimo B.
Veteran
Veteran

Joined: 09 Feb 2005
Posts: 1714
Location: PB, Germany

PostPosted: Sat Oct 20, 2007 7:28 am    Post subject: Reply with quote

Still the same problem here: Which binary packages do I need? I fetched and installed these:

Code:
# ls /usr/portage/packages/All/

binutils-2.18-r1.tbz2  gcc-4.1.2.tbz2  glibc-2.6.1.tbz2  libart_lgpl-2.3.19-r1.tbz2  mpfr-2.2.1_p5.tbz2



But the first non-binary emerge fails:

Code:
checking for long double… yes

checking size of long double… configure: error: cannot compute sizeof (long double), 77

See `config.log’ for more details.

 *

 * ERROR: sys-libs/glibc-2.6.1 failed.



My initial problem was that emerge -e system compiled fine only gcc failed when looking for stubs-32.h.
_________________
HP ZBook Power 15.6″ G8 i7-11800H|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770

Back to top

View user's profile Send private message

kernelOfTruth
Watchman
Watchman

Joined: 20 Dec 2005
Posts: 6111
Location: Vienna, Austria; Germany; hello world :)

PostPosted: Sun Oct 28, 2007 10:55 am    Post subject: Reply with quote

thanks everybody involved in solving this, now hopefully glibc & gcc will build until they’re finished :roll: (at least on my system, I’ll keep you updated)

@Massimo B.:

glibc, gcc should suffice, you can then build the others (mpfr, libart_lgpl, binutils)

mark that glibc & gcc need to match each other & also regarding the system they were built on [profile] (it seemed to be obligatory for me), then you’ll be able to first build glibc & then gcc



update:

ok, well that did it — all compiled :D
_________________
https://github.com/kernelOfTruth/ZFS-for-SystemRescueCD/tree/ZFS-for-SysRescCD-4.9.0

https://github.com/kernelOfTruth/pulseaudio-equalizer-ladspa

Hardcore Gentoo Linux user since 2004 :D

Back to top

View user's profile Send private message

drescherjm
Advocate
Advocate

Joined: 05 Jun 2004
Posts: 2788
Location: Pittsburgh, PA, USA

PostPosted: Tue Mar 11, 2008 4:36 pm    Post subject: Reply with quote

I have the same problem on one server at work. I can not upgrade glibc because of the /lib/cpp fails sainity check on the 32 bit build and I can not update gcc because of the missing header on the 32 bit build.

Code:
# emerge —info

Portage 2.1.4.4 (default-linux/amd64/2007.0, gcc-3.4.6, glibc-2.5-r4, 2.6.22-vs2.2.0.3-gentoo-r2 x86_64)

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

System uname: 2.6.22-vs2.2.0.3-gentoo-r2 x86_64 AMD Opteron(tm) Processor 246

Timestamp of tree: Mon, 10 Mar 2008 15:46:01 +0000

distcc 2.18.3 x86_64-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]

ccache version 2.4 [disabled]

app-shells/bash:     3.2_p33

dev-java/java-config: 1.3.7, 2.0.33-r1

dev-lang/python:     2.4.4-r5

dev-python/pycrypto: 2.0.1-r6

dev-util/ccache:     2.4-r7

dev-util/confcache:  0.4.2-r1

sys-apps/baselayout: 1.12.11.1

sys-apps/sandbox:    1.2.18.1

sys-devel/autoconf:  2.13, 2.61-r1

sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10

sys-devel/binutils:  2.18-r1

sys-devel/gcc-config: 1.4.0-r4

sys-devel/libtool:   1.5.26

virtual/os-headers:  2.6.22-r2

ACCEPT_KEYWORDS=»amd64″

CBUILD=»x86_64-pc-linux-gnu»

CFLAGS=»-O2 -march=k8″

CHOST=»x86_64-pc-linux-gnu»

CONFIG_PROTECT=»/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/lib64/mozilla/defaults/pref /usr/share/X11/xkb /usr/share/config»

CONFIG_PROTECT_MASK=»/etc/env.d /etc/env.d/java/ /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d»

CXXFLAGS=»-O2 -march=k8″

DISTDIR=»/usr/portage/distfiles»

FEATURES=»candy distlocks metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch»

GENTOO_MIRRORS=»http://adelie.polymtl.ca/ http://pandemonium.tiscali.de/pub/gentoo/ http://distro.ibiblio.org/pub/linux/distributions/gentoo/ http://mirrors.acm.cs.rpi.edu/gentoo/ http://mirror.fslutd.org/linux/distributions/gentoo/»

MAKEOPTS=»-j4″

PKGDIR=»/usr/portage/packages»

PORTAGE_RSYNC_EXTRA_OPTS=»—progress»

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

PORTAGE_TMPDIR=»/var/tmp»

PORTDIR=»/usr/portage»

PORTDIR_OVERLAY=»/usr/local/portage/gentoo-overlay /usr/portage/local/layman/masterdriverz»

SYNC=»rsync://datastore0/gentoo-portage»

USE=»7zip X acl acpi alsa amd64 apache2 apm async bacula-console bacula-split-init bash bash-completion berkdb bzip2 c++ cdr chroot cli cracklib crosscompile crypt cups cvs doc dpms dri dvd dvdr emul-linux-x86 firefox font-server fortran gdbm gnome gpm gtk gtk2 hddtemp iconv isdnlog jpeg kqemu midi mmx mng mozbranding mudflap ncurses nls nptl nptlonly opengl openmp pam pcre perl php png postgres pppd python rdesktop readline reflection reiserfs samba session spl sse sse2 ssl szip tcltk tcpd threads truetype unicode wxwindows xml xml2 xorg zlib» ALSA_CARDS=»ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci» ALSA_PCM_PLUGINS=»adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter 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=»keyboard mouse» KERNEL=»linux» LCD_DEVICES=»bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text» USERLAND=»GNU» VIDEO_CARDS=»ati radeon mach64″

Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS

I have dozens of amd64 servers at work and this is the last one to update since it is the most important box. The other servers all have been recently upgraded from gcc-3.4.6 to gcc-4.2.3 (fully rebuilt) and all is working well with them. Would it be a problem to grab binary packages for glibc-2.6.1 and gcc-4.2.3 from these systems to fix this problem? I am most worried about glibc since it is very difficult to downgrade glibc.
_________________
John

My gentoo overlay

Instructons for overlay

Back to top

View user's profile Send private message

drescherjm
Advocate
Advocate

Joined: 05 Jun 2004
Posts: 2788
Location: Pittsburgh, PA, USA

PostPosted: Mon Mar 17, 2008 7:29 pm    Post subject: Reply with quote

It appears like the fix for me was using the bin packages for gcc-4.2.3 and glibc-2.6.1 I had created on my other amd64 machines. Right now I am reemerging glibc and it appears to be working as the sanity check failure did not happen this time.

[EDIT]Yes that definitely solved the problem for me. Now that I have a working toolchain I can finally do a system update..[/EDIT]
_________________
John

My gentoo overlay

Instructons for overlay

Back to top

View user's profile Send private message

cord
Guru
Guru

Joined: 28 Apr 2007
Posts: 337

PostPosted: Wed Jul 23, 2008 7:10 pm    Post subject: Reply with quote

Hello,

I have this problem again on hardened,no-multilib profile.

gcc-3.4.6 fails with

Code:
/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory



and glibc with

Code:

configure: error: C preprocessor «/lib/cpp» fails sanity check



FAQ about glibc does’t help :(

I’ve tried CFLAGS=-m64″ for gcc compilation, but there is no effect too.

What can I do?

Back to top

View user's profile Send private message

ali3nx
l33t
l33t

Joined: 21 Sep 2003
Posts: 703
Location: Winnipeg, Canada

PostPosted: Wed Jul 23, 2008 7:58 pm    Post subject: Reply with quote

the libpaths for amd64 emul libs since 2006 gcc3.x.x have been drastically altered. updating will likely be more of a nuicance than reinstalling
Back to top

View user's profile Send private message

cord
Guru
Guru

Joined: 28 Apr 2007
Posts: 337

PostPosted: Thu Jul 24, 2008 8:29 am    Post subject: Reply with quote

I am not updating my system. I make fresh install from stage3-amd64-hardened+nomultilib-2008.0.
Back to top

View user's profile Send private message

diablo465
Apprentice
Apprentice

Joined: 10 Sep 2013
Posts: 194

PostPosted: Wed Feb 19, 2014 5:05 am    Post subject: Reply with quote

same problem here. who can help??
Back to top

View user's profile Send private message

zerbino
n00b
n00b

Joined: 10 Apr 2014
Posts: 13

PostPosted: Fri Apr 11, 2014 3:59 am    Post subject: Reply with quote

diablo465 wrote:
same problem here. who can help??

same problem. no profile changes, x86_64 kernel, NO no_multil installation.

can’t compile glibc, can’t compile gcc. dead circle…

what should I do?

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

Вам не хватает 32-битного пакета libc dev:

В Ubuntu он называется libc6-dev-i386 — do sudo apt-get install libc6-dev-i386. См. Ниже дополнительные инструкции для Ubuntu 12.04.

В Red Hat дистрибутивах имя пакета glibc-devel.i686 (спасибо комментарию Дэвида Гарднера)

В CentOS 5.8 имя пакета glibc-devel.i386 (спасибо комментарию JimKleck)

В CentOS 6/7 имя пакета glibc-devel.i686.

В SLES он называется glibc-devel-32bit — do zypper in glibc-devel-32bit


Используете ли вы Ubuntu 12.04? Существует известная проблема, которая помещает файлы в нестандартное расположение. Вы также должны сделать:

export LIBRARY_PATH=/usr/lib/$(gcc -print-multiarch)
export C_INCLUDE_PATH=/usr/include/$(gcc -print-multiarch)
export CPLUS_INCLUDE_PATH=/usr/include/$(gcc -print-multiarch)

где-нибудь перед тем, как вы построите (скажем, в вашем .bashrc).


Если вы также компилируете код на С++, вам также понадобится 32-битная библиотека stdС++. Если вы видите это предупреждение:

…./usr/bin/ld: не удается найти -lstdС++….

В Ubuntu вам нужно будет сделать sudo apt-get install g++-multilib

В CentOS 5 вам нужно будет сделать yum install libstdc++-devel.i386

В CentOS 6 вам нужно будет сделать yum install libstdc++-devel.i686

Пожалуйста, не стесняйтесь редактировать в пакетах для других систем.

Skip to navigation
Skip to main content

Red Hat Customer Portal

Infrastructure and Management

  • Red Hat Enterprise Linux

  • Red Hat Virtualization

  • Red Hat Identity Management

  • Red Hat Directory Server

  • Red Hat Certificate System

  • Red Hat Satellite

  • Red Hat Subscription Management

  • Red Hat Update Infrastructure

  • Red Hat Insights

  • Red Hat Ansible Automation Platform

Cloud Computing

  • Red Hat OpenShift

  • Red Hat CloudForms

  • Red Hat OpenStack Platform

  • Red Hat OpenShift Container Platform

  • Red Hat OpenShift Data Science

  • Red Hat OpenShift Online

  • Red Hat OpenShift Dedicated

  • Red Hat Advanced Cluster Security for Kubernetes

  • Red Hat Advanced Cluster Management for Kubernetes

  • Red Hat Quay

  • OpenShift Dev Spaces

  • Red Hat OpenShift Service on AWS

Storage

  • Red Hat Gluster Storage

  • Red Hat Hyperconverged Infrastructure

  • Red Hat Ceph Storage

  • Red Hat OpenShift Data Foundation

Runtimes

  • Red Hat Runtimes

  • Red Hat JBoss Enterprise Application Platform

  • Red Hat Data Grid

  • Red Hat JBoss Web Server

  • Red Hat Single Sign On

  • Red Hat support for Spring Boot

  • Red Hat build of Node.js

  • Red Hat build of Thorntail

  • Red Hat build of Eclipse Vert.x

  • Red Hat build of OpenJDK

  • Red Hat build of Quarkus

Integration and Automation

  • Red Hat Process Automation

  • Red Hat Process Automation Manager

  • Red Hat Decision Manager

All Products

Issue

  • Compilation fails with ‘error: gnu/stubs-32.h: No such file or directory’ when building a program with -m32 gcc argument
  • As an example, build the following program:

    #include <iostream>
    using namespace std;

    int main(){
        cout << «HELLOn»;
        return 0;
    }with the command:

g++ -m32 t.CThe output is as follows:

In file included from /usr/include/features.h:385,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../include/c++/4.4.4/x86_64-redhat-linux/32/bits/os_defines.h:39,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../include/c++/4.4.4/x86_64-redhat-linux/32/bits/c++config.h:243,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../include/c++/4.4.4/iostream:39,
                 from t.C:1:
/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory

Environment

  • Red Hat Enterprise Linux 6

  • Red Hat Enterprise Linux 5

  • Red Hat Enterprise Linux 4
  • x86_64 architecture

  • glibc-devel

  • gcc

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

Comments

@tgraf

@tgraf
tgraf

added
the

kind/question

Frequently asked questions & answers. This issue will be linked from the documentation’s FAQ.

label

Mar 20, 2017

@vadorovsky
vadorovsky

added

kind/bug

This is a bug in the Cilium logic.

sig/datapath

Impacts bpf/ or low-level forwarding details, including map management and monitor messages.

and removed

kind/question

Frequently asked questions & answers. This issue will be linked from the documentation’s FAQ.

labels

Jul 23, 2019

@stale
stale
bot

added
the

stale

The stale bot thinks this issue is old. Add «pinned» label to prevent this from becoming stale.

label

Sep 21, 2019

tklauser

added a commit
that referenced
this issue

Feb 18, 2020

@tklauser

Use stddef.h to get size_t, use kernel definitions for fixed size types
where appropriate (e.g. uint32_t -> __u32)

This allows to get rid of the x32 libc header dependency to pull in the
GNU libc stub headers needed by stdint.h. This should thus more easily
allow to compile the BPF programs on platforms other than amd64 (e.g.
arm64, ppc64).

Also clean up some other unused includes.

For some reason these changes lead to clang complaining about several
functions defined in .h files being unused. Mark these as __maybe_unused
or if they are used in a single place move them to the .c file.

Fixes #368
Fixes #8529

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>

tklauser

added a commit
that referenced
this issue

Feb 20, 2020

@tklauser

Use stddef.h to get size_t, use kernel definitions for fixed size types
where appropriate (e.g. uint32_t -> __u32)

This allows to get rid of the x32 libc header dependency to pull in the
GNU libc stub headers needed by stdint.h. This should thus more easily
allow to compile the BPF programs on platforms other than amd64 (e.g.
arm64, ppc64).

Also clean up some other unused includes.

For some reason these changes lead to clang complaining about several
functions defined in .h files being unused. Mark these as __maybe_unused
or if they are used in a single place move them to the .c file.

Fixes #368
Fixes #8529

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>

aanm

pushed a commit
that referenced
this issue

Feb 21, 2020

@tklauser

@aanm

Use stddef.h to get size_t, use kernel definitions for fixed size types
where appropriate (e.g. uint32_t -> __u32)

This allows to get rid of the x32 libc header dependency to pull in the
GNU libc stub headers needed by stdint.h. This should thus more easily
allow to compile the BPF programs on platforms other than amd64 (e.g.
arm64, ppc64).

Also clean up some other unused includes.

For some reason these changes lead to clang complaining about several
functions defined in .h files being unused. Mark these as __maybe_unused
or if they are used in a single place move them to the .c file.

Fixes #368
Fixes #8529

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>

vadorovsky

pushed a commit
to vadorovsky/cilium
that referenced
this issue

Feb 24, 2020

@tklauser

@vadorovsky

Use stddef.h to get size_t, use kernel definitions for fixed size types
where appropriate (e.g. uint32_t -> __u32)

This allows to get rid of the x32 libc header dependency to pull in the
GNU libc stub headers needed by stdint.h. This should thus more easily
allow to compile the BPF programs on platforms other than amd64 (e.g.
arm64, ppc64).

Also clean up some other unused includes.

For some reason these changes lead to clang complaining about several
functions defined in .h files being unused. Mark these as __maybe_unused
or if they are used in a single place move them to the .c file.

Fixes cilium#368
Fixes cilium#8529

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>

vadorovsky

pushed a commit
to vadorovsky/cilium
that referenced
this issue

Mar 28, 2020

@tklauser

@vadorovsky

Use stddef.h to get size_t, use kernel definitions for fixed size types
where appropriate (e.g. uint32_t -> __u32)

This allows to get rid of the x32 libc header dependency to pull in the
GNU libc stub headers needed by stdint.h. This should thus more easily
allow to compile the BPF programs on platforms other than amd64 (e.g.
arm64, ppc64).

Also clean up some other unused includes.

For some reason these changes lead to clang complaining about several
functions defined in .h files being unused. Mark these as __maybe_unused
or if they are used in a single place move them to the .c file.

Fixes cilium#368
Fixes cilium#8529

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>

dirkmueller

pushed a commit
to dirkmueller/cilium
that referenced
this issue

Jun 12, 2020

@tklauser

@dirkmueller

Use stddef.h to get size_t, use kernel definitions for fixed size types
where appropriate (e.g. uint32_t -> __u32)

This allows to get rid of the x32 libc header dependency to pull in the
GNU libc stub headers needed by stdint.h. This should thus more easily
allow to compile the BPF programs on platforms other than amd64 (e.g.
arm64, ppc64).

Also clean up some other unused includes.

For some reason these changes lead to clang complaining about several
functions defined in .h files being unused. Mark these as __maybe_unused
or if they are used in a single place move them to the .c file.

Fixes cilium#368
Fixes cilium#8529

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
(cherry picked from commit a1d93e0)

dirkmueller

pushed a commit
to dirkmueller/cilium
that referenced
this issue

Jun 12, 2020

@tklauser

@dirkmueller

Use stddef.h to get size_t, use kernel definitions for fixed size types
where appropriate (e.g. uint32_t -> __u32)

This allows to get rid of the x32 libc header dependency to pull in the
GNU libc stub headers needed by stdint.h. This should thus more easily
allow to compile the BPF programs on platforms other than amd64 (e.g.
arm64, ppc64).

Also clean up some other unused includes.

For some reason these changes lead to clang complaining about several
functions defined in .h files being unused. Mark these as __maybe_unused
or if they are used in a single place move them to the .c file.

Fixes cilium#368
Fixes cilium#8529

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>

You know how sometimes you just have to compile and run a 32 bit program on a 64 bit machine, and it’s really annoying that it doesn’t seem to work?

Yeah, me too.

Turns out it’s actually pretty straightforward on Fedora 19.

First of all, you need to use the -m32 build flag. Below I’m using it to compile my program ‘pointers’:

gcc -m32 pointers.c -o pointers

You may run into the following error:

/usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file or directory
# include <gnu/stubs-32.h>
^
compilation terminated.

To fix this you need to install the 32 bit glibc-devel package. You can do this by running:

yum install glibc-devel.i686

Next, you might see this error:

/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.8.2/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
collect2: error: ld returned 1 exit status

Which means you need to install the 32 bit standard C++ library package. You can do this by running:

yum install libstdc++-devel.i686

Then you can quite happily compile your executable with the -m32 flag, as above:

gcc -m32 pointers.c -o pointers

And, as if by magic, you get a 32 bit exe that runs on your 64 bit machine.

You can use the file command to admire what you’ve made:

[faye@localhost src]$ file pointers
pointers: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), 
for GNU/Linux 2.6.32, BuildID[sha1]=0x39958fed2f5c099ad97fd7512e780066acfb1231, not stripped

Понравилась статья? Поделить с друзьями:
  • Error git is not installed
  • Error girl anime
  • Error game specific settings could not be initialised none of the supported games were detected
  • Error game shop invalidserver
  • Error game installation not found