Gentoo Archives: gentoo-user

From: Jack <ostroffjh@×××××××××××××××××.net>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] C compiler cannot create executables
Date: Sat, 10 Sep 2022 19:44:28
Message-Id: OV7GMUEU.IMUYMGNT.7DE36CYW@4T4RAHOE.MM2HLTQV.GJA4J3AJ
In Reply to: Re: [gentoo-user] C compiler cannot create executables by David Haller
1 On 2022.09.10 13:56, David Haller wrote:
2 > Hello,
3 >
4 > On Sat, 10 Sep 2022, Jack wrote:
5 > >I now get this error trying to emerge two different packages:
6 > libofx-0.10.7
7 > >and gnupg (both 2.2.39 and 2.3.6).  It might also be the same
8 > problem for a
9 > >few bugs on b.g.o found by searching on "cannot create exectuables."
10 > >
11 > >The relevant lines from build.log are
12 > >
13 > >checking for x86_64-pc-linux-gnu-gcc... x86_64-pc-linux-gnu-gcc
14 > >checking whether the C compiler works... no
15 > >configure: error: in
16 > >`/var/tmp/portage/dev-libs/libofx-0.10.7/work/libofx-0.10.7':
17 > >configure: error: C compiler cannot create executables
18 > >See `config.log' for more details
19 > >
20 > >and from config.log:
21 > >
22 > >configure:2941: x86_64-pc-linux-gnu-gcc -V >&5
23 > >x86_64-pc-linux-gnu-gcc: error: unrecognized command-line option '-V'
24 > >x86_64-pc-linux-gnu-gcc: fatal error: no input files
25 > >compilation terminated.
26 > >configure:2952: $? = 1
27 > >configure:2941: x86_64-pc-linux-gnu-gcc -qversion >&5
28 > >x86_64-pc-linux-gnu-gcc: error: unrecognized command-line option
29 > '-qversion';
30 > >did you mean '--version'?
31 > >x86_64-pc-linux-gnu-gcc: fatal error: no input files
32 > >compilation terminated.
33 > >configure:2952: $? = 1
34 >
35 > These tests are normal fails with gcc, they are version checks for
36 > other compilers.
37 >
38 > >configure:2972: checking whether the C compiler works
39 > >configure:2994: x86_64-pc-linux-gnu-gcc -march=native -O2 -pipe -og
40 > -ggdb 
41 > >-Wl,-O1 -Wl,--as-needed conftest.c  >&5
42 > >configure:2998: $? = 0
43 > >configure:3036: result: no
44 > >configure: failed program was:
45 > [..boilerplate..]
46 > >configure:3041: error: in
47 > >`/var/tmp/portage/dev-libs/libofx-0.10.7/work/libofx-0.10.7':
48 > >configure:3043: error: C compiler cannot create executables
49 > >See `config.log' for more details
50 > >
51 > >The thing I find curious is that it appears to me that the output of
52 > the test
53 > >compile is a file called "g" which I don't recall ever seeing, and
54 > so I
55 > >wonder if the problem is that something has changed with gcc
56 > defaults and
57 > >configure does not yet recognize that change.  I also don't know the 
58 > >significance of the two "fatal error: no input files".
59 > >
60 > >The fact that this happens with two unrelated packages suggests that
61 > it's 
62 > >not specific to either of them, but something in my system or
63 > configuration.
64 >
65 > And it's a standard autoconf macro, namely AC_PROG_CC that results in
66 > the error and the stuff before that is also standard. And as no
67 > autoreconf is called, autotools versions should not matter.
68 >
69 > >Any thoughts or suggestions?
70 >
71 > I use gcc 11.3.0 here as well, and have no problem. Check for the
72 > variables CC, CFLAGS, CPPFLAGS, LDFLAGS and LIBS in
73 > /var/tmp/portage/dev-libs/libofx-0.10.7/temp/environment.
74 >
75 > Somehow, that '-og' must have crept in there.
76 David - thank you, thank you, thank you.
77
78 No wonder my recent debugging wasn't doing what I expected. That stray
79 "-og" was supposed to be "-Og" (upper instead of lower case) and it is
80 in /etc/portage/env/debug.conf, which is referenced in
81 /etc/portage/package.env for those packages I wish to compile with
82 various debugging related compiler settings, as well as not deleting
83 the build dir, even on success.
84
85 It shows what a fresh pair of eyes can do. When looking at the various
86 error related files, I really just saw -Og, and when you pointed that
87 out, my first thought was why any debugging setting would possible
88 cause this type of failure. Of course in hindsight, it now all makes
89 sense.
90
91 Thanks again to the list for all sorts of ongoing assistance.
92
93 Jack