Gentoo Archives: gentoo-user

From: tuxic@××××××.de
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Make failed to compile: symbol __alloca not found...
Date: Tue, 12 Dec 2017 02:08:19
Message-Id: 20171212020745.htules3sqryoieke@solfire
In Reply to: Re: [gentoo-user] Make failed to compile: symbol __alloca not found... by David Haller
1 Hi,
2
3
4 On 12/11 09:07, David Haller wrote:
5 > Hello,
6 >
7 > On Mon, 11 Dec 2017, tuxic@××××××.de wrote:
8 > >On 12/11 05:13, David Haller wrote:
9 > >> Hello,
10 > >>
11 > >> On Sun, 10 Dec 2017, tuxic@××××××.de wrote:
12 > >> >x86_64-pc-linux-gnu-gcc -DLOCALEDIR=\"/usr/share/locale\" -DLIBDIR=\"/usr/lib64\" -DINCLUDEDIR=\"/usr/include\" -DHAVE_CONFIG_H -I. -I./glob -march=native -O2 -pipe -c -o remote-stub.o remote-stub.c
13 > >> >x86_64-pc-linux-gnu-gcc -march=native -O2 -pipe -Wl,--export-dynamic -Wl,-O1 -Wl,--as-needed -o make ar.o arscan.o commands.o default.o dir.o expand.o file.o function.o getopt.o getopt1.o guile.o implicit.o job.o load.o loadapi.o main.o misc.o posixos.o output.o read.o remake.o rule.o signame.o strcache.o variable.o version.o vpath.o hash.o remote-stub.o glob/libglob.a -ldl
14 > >> >glob/libglob.a(glob.o): In function `glob_in_dir':
15 > >> >glob.c:(.text+0x2ed): undefined reference to `__alloca'
16 > >>
17 > >> IIRC, that's a missing #define somewhere. Or a #define where it
18 > >> shouldn't. But the thing is: on my system, make doesn't build libglob
19 > >> at all because it finds the globbing stuff in glibc. And make has its
20 > >> own alloca.c.
21 > >>
22 > >> So, please show the output of the configure-part of the ebuild and
23 > >> what's the output of:
24 > >>
25 > >> $ grep _GNU_GLOB_INTERFACE_VERSION /usr/include/gnu-versions.h
26 > >
27 > >Here it comes:
28 > [..]
29 > >./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --disable-dependency-tracking --disable-silent-rules --libdir=/usr/lib64 --program-prefix=g --without-guile --enable-nls
30 > >configure: loading site script /usr/share/config.site
31 > [..]
32 > >checking if system libc has GNU glob... no
33 > [..]
34 >
35 > That figures.
36 >
37 > >/root>grep _GNU_GLOB_INTERFACE_VERSION /usr/include/gnu-versions.h
38 > >#define _GNU_GLOB_INTERFACE_VERSION 2 /* vs posix/glob.c */
39 >
40 > You seem to be using glibc-2.26. Question is, is that new
41 > GLOB_INTERFACE backwards compatible or not? If it is, you could just
42 > mangle the configure, so that "GNU glob" is considered found, a patch
43 > via the e{apply,patch}_user of configure{ac,} should work.
44 >
45 > >Any ideas?
46 >
47 > "downgrade" to the stable glibc-2.25 ... ;)
48
49
50 emerge prevets this, saying any downgrade would cripple my system...
51
52
53 Cheers
54 Meino
55
56
57
58
59
60 >
61 > Or dig into why the following happens, i.e. why is __alloca not
62 > defined in glob_in_dir() ...
63 >
64 > >> Ah, yess:
65 > >>
66 > >> ==== make-4.2.1/glob/glob.c:211 ff. ====
67 > >> #if !defined __alloca && !defined __GNU_LIBRARY__
68 > >> [..]
69 > >> # define alloca(n) __builtin_alloca (n)
70 > >> [..]
71 > >> # define __alloca alloca
72 > >> [.. down to line 1217 ..]
73 > >> static int
74 > >> glob_in_dir( ..
75 > >> [..]
76 > >> char *fullname = (char *) __alloca(... /* line 1256 */
77 > >> ====
78 > >>
79 > >> Somewhere between that and line 1256 of glob.c, where __alloca is
80 > >> first used in that function you managed to undef __alloca...
81 > >>
82 > >> You must have done something weird ...
83 >
84 > If I have the time, I'll try merging the glibc-2.26 and see what
85 > happens. Usually, debugging preprocessor stuff involves (for me) a lot
86 > of liberally sprinkling of in this case e.g.
87 >
88 > #ifndef __alloca
89 > #warning notdef __alloca
90 > #endif
91 >
92 > or somesuch throughout the relevant code, occasionally verified against the
93 > preprocessed code (gcc -save-temps is nice ;) But it tends to be
94 > tedious if you don't know the code (and circumstances) well already.
95 >
96 > HTH,
97 > -dnh
98 >
99 > PS: I've not synced portage for quite some days, I wanted to get done
100 > with the 'emerge -e @world' before adding updates and whatnot into
101 > the mess... So dunno if glibc-2.26 is stable already.
102 >
103 > --
104 > The problem with people whose minds are in the gutter is that they keep
105 > blocking my periscope. [Peter Gutman]
106 >