Gentoo Archives: gentoo-user

From: David Haller <gentoo@×××××××.de>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Make failed to compile: symbol __alloca not found...
Date: Mon, 11 Dec 2017 20:08:32
Message-Id: 20171211200759.ivmufb7ydrtqope2@grusum.endjinn.de
In Reply to: Re: [gentoo-user] Make failed to compile: symbol __alloca not found... by tuxic@posteo.de
1 Hello,
2
3 On Mon, 11 Dec 2017, tuxic@××××××.de wrote:
4 >On 12/11 05:13, David Haller wrote:
5 >> Hello,
6 >>
7 >> On Sun, 10 Dec 2017, tuxic@××××××.de wrote:
8 >> >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
9 >> >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
10 >> >glob/libglob.a(glob.o): In function `glob_in_dir':
11 >> >glob.c:(.text+0x2ed): undefined reference to `__alloca'
12 >>
13 >> IIRC, that's a missing #define somewhere. Or a #define where it
14 >> shouldn't. But the thing is: on my system, make doesn't build libglob
15 >> at all because it finds the globbing stuff in glibc. And make has its
16 >> own alloca.c.
17 >>
18 >> So, please show the output of the configure-part of the ebuild and
19 >> what's the output of:
20 >>
21 >> $ grep _GNU_GLOB_INTERFACE_VERSION /usr/include/gnu-versions.h
22 >
23 >Here it comes:
24 [..]
25 >./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
26 >configure: loading site script /usr/share/config.site
27 [..]
28 >checking if system libc has GNU glob... no
29 [..]
30
31 That figures.
32
33 >/root>grep _GNU_GLOB_INTERFACE_VERSION /usr/include/gnu-versions.h
34 >#define _GNU_GLOB_INTERFACE_VERSION 2 /* vs posix/glob.c */
35
36 You seem to be using glibc-2.26. Question is, is that new
37 GLOB_INTERFACE backwards compatible or not? If it is, you could just
38 mangle the configure, so that "GNU glob" is considered found, a patch
39 via the e{apply,patch}_user of configure{ac,} should work.
40
41 >Any ideas?
42
43 "downgrade" to the stable glibc-2.25 ... ;)
44
45 Or dig into why the following happens, i.e. why is __alloca not
46 defined in glob_in_dir() ...
47
48 >> Ah, yess:
49 >>
50 >> ==== make-4.2.1/glob/glob.c:211 ff. ====
51 >> #if !defined __alloca && !defined __GNU_LIBRARY__
52 >> [..]
53 >> # define alloca(n) __builtin_alloca (n)
54 >> [..]
55 >> # define __alloca alloca
56 >> [.. down to line 1217 ..]
57 >> static int
58 >> glob_in_dir( ..
59 >> [..]
60 >> char *fullname = (char *) __alloca(... /* line 1256 */
61 >> ====
62 >>
63 >> Somewhere between that and line 1256 of glob.c, where __alloca is
64 >> first used in that function you managed to undef __alloca...
65 >>
66 >> You must have done something weird ...
67
68 If I have the time, I'll try merging the glibc-2.26 and see what
69 happens. Usually, debugging preprocessor stuff involves (for me) a lot
70 of liberally sprinkling of in this case e.g.
71
72 #ifndef __alloca
73 #warning notdef __alloca
74 #endif
75
76 or somesuch throughout the relevant code, occasionally verified against the
77 preprocessed code (gcc -save-temps is nice ;) But it tends to be
78 tedious if you don't know the code (and circumstances) well already.
79
80 HTH,
81 -dnh
82
83 PS: I've not synced portage for quite some days, I wanted to get done
84 with the 'emerge -e @world' before adding updates and whatnot into
85 the mess... So dunno if glibc-2.26 is stable already.
86
87 --
88 The problem with people whose minds are in the gutter is that they keep
89 blocking my periscope. [Peter Gutman]

Replies