Re: [gentoo-user] Make failed to compile: symbol __alloca not found...

2017-12-12 Thread Joerg Schilling
Raffaele Belardi  wrote:

> > Or dig into why the following happens, i.e. why is __alloca not
> > defined in glob_in_dir() ...
> > 
>
> I don't think it's glibc, here make compiles fine:

It is built into gcc, but you need the right include file that defines:

#define   alloca(x)   __builtin_alloca(x)

Jörg

-- 
 EMail:jo...@schily.net(home) Jörg Schilling D-13353 Berlin
joerg.schill...@fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/
 URL: http://cdrecord.org/private/ http://sf.net/projects/schilytools/files/'



Re: [gentoo-user] Make failed to compile: symbol __alloca not found...

2017-12-11 Thread Raffaele Belardi
David Haller wrote:
> Hello,
> 
> On Mon, 11 Dec 2017, tu...@posteo.de wrote:
>> On 12/11 05:13, David Haller wrote:
>>> Hello,
>>>
>>> On Sun, 10 Dec 2017, tu...@posteo.de wrote:
 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
 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 
 glob/libglob.a(glob.o): In function `glob_in_dir':
 glob.c:(.text+0x2ed): undefined reference to `__alloca'
>>>
>>> IIRC, that's a missing #define somewhere. Or a #define where it
>>> shouldn't. But the thing is: on my system, make doesn't build libglob
>>> at all because it finds the globbing stuff in glibc. And make has its
>>> own alloca.c.
>>>
>>> So, please show the output of the configure-part of the ebuild and
>>> what's the output of:
>>>
>>> $ grep _GNU_GLOB_INTERFACE_VERSION /usr/include/gnu-versions.h
>>
>> Here it comes:
> [..]
>> ./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
>> configure: loading site script /usr/share/config.site
> [..]
>> checking if system libc has GNU glob... no
> [..]
> 
> That figures.
> 
>> /root>grep _GNU_GLOB_INTERFACE_VERSION /usr/include/gnu-versions.h
>> #define _GNU_GLOB_INTERFACE_VERSION  2 /* vs posix/glob.c */
> 
> You seem to be using glibc-2.26. Question is, is that new
> GLOB_INTERFACE backwards compatible or not? If it is, you could just
> mangle the configure, so that "GNU glob" is considered found, a patch
> via the e{apply,patch}_user of configure{ac,} should work.
> 
>> Any ideas?
> 
> "downgrade" to the stable glibc-2.25 ... ;)
> 
> Or dig into why the following happens, i.e. why is __alloca not
> defined in glob_in_dir() ...
> 

I don't think it's glibc, here make compiles fine:

$ eix -I make
...
sys-devel/make
 Installed versions:  4.2.1-r1(06:56:41 PM 12/11/2017)(nls -guile -static)

$ eix -I glibc
...
Installed versions:  2.26-r3(2.2)^s(07:08:24 PM 12/04/2017)(-audit -caps -debug 
-gd
-hardened -multilib -nscd -profile -selinux -suid -systemtap -vanilla
CROSSCOMPILE_OPTS="-headers-only")

...but:

$ grep _GNU_GLOB_INTERFACE_VERSION /usr/include/gnu-versions.h
#define _GNU_GLOB_INTERFACE_VERSION 1 /* vs posix/glob.c */

raffaele



Re: [gentoo-user] Make failed to compile: symbol __alloca not found...

2017-12-11 Thread tuxic
 Hi,


On 12/11 09:07, David Haller wrote:
> Hello,
> 
> On Mon, 11 Dec 2017, tu...@posteo.de wrote:
> >On 12/11 05:13, David Haller wrote:
> >> Hello,
> >> 
> >> On Sun, 10 Dec 2017, tu...@posteo.de wrote:
> >> >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
> >> >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 
> >> >glob/libglob.a(glob.o): In function `glob_in_dir':
> >> >glob.c:(.text+0x2ed): undefined reference to `__alloca'
> >> 
> >> IIRC, that's a missing #define somewhere. Or a #define where it
> >> shouldn't. But the thing is: on my system, make doesn't build libglob
> >> at all because it finds the globbing stuff in glibc. And make has its
> >> own alloca.c.
> >> 
> >> So, please show the output of the configure-part of the ebuild and
> >> what's the output of:
> >> 
> >> $ grep _GNU_GLOB_INTERFACE_VERSION /usr/include/gnu-versions.h
> >
> >Here it comes:
> [..]
> >./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
> >configure: loading site script /usr/share/config.site
> [..]
> >checking if system libc has GNU glob... no
> [..]
> 
> That figures.
> 
> >/root>grep _GNU_GLOB_INTERFACE_VERSION /usr/include/gnu-versions.h
> >#define _GNU_GLOB_INTERFACE_VERSION  2 /* vs posix/glob.c */
> 
> You seem to be using glibc-2.26. Question is, is that new
> GLOB_INTERFACE backwards compatible or not? If it is, you could just
> mangle the configure, so that "GNU glob" is considered found, a patch
> via the e{apply,patch}_user of configure{ac,} should work.
> 
> >Any ideas?
> 
> "downgrade" to the stable glibc-2.25 ... ;)


emerge prevets this, saying any downgrade would cripple my system...


Cheers
Meino





> 
> Or dig into why the following happens, i.e. why is __alloca not
> defined in glob_in_dir() ...
> 
> >> Ah, yess:
> >> 
> >>  make-4.2.1/glob/glob.c:211 ff. 
> >> #if !defined __alloca && !defined __GNU_LIBRARY__
> >> [..]
> >> #  define alloca(n) __builtin_alloca (n)
> >> [..]
> >> # define __alloca   alloca
> >> [.. down to line 1217 ..]
> >> static int
> >> glob_in_dir( ..
> >> [..]
> >> char *fullname = (char *) __alloca(... /* line 1256 */
> >> 
> >> 
> >> Somewhere between that and line 1256 of glob.c, where __alloca is
> >> first used in that function you managed to undef __alloca...
> >> 
> >> You must have done something weird ...
> 
> If I have the time, I'll try merging the glibc-2.26 and see what
> happens. Usually, debugging preprocessor stuff involves (for me) a lot
> of liberally sprinkling of in this case e.g.
> 
> #ifndef __alloca
> #warning notdef __alloca
> #endif
> 
> or somesuch throughout the relevant code, occasionally verified against the
> preprocessed code (gcc -save-temps is nice ;) But it tends to be
> tedious if you don't know the code (and circumstances) well already.
> 
> HTH,
> -dnh
> 
> PS: I've not synced portage for quite some days, I wanted to get done
> with the 'emerge -e @world' before adding updates and whatnot into
> the mess... So dunno if glibc-2.26 is stable already.
> 
> -- 
> The problem with people whose minds are in the gutter is that they keep
> blocking my periscope.  [Peter Gutman]
> 



Re: [gentoo-user] Make failed to compile: symbol __alloca not found...

2017-12-11 Thread David Haller
Hello,

On Mon, 11 Dec 2017, tu...@posteo.de wrote:
>On 12/11 05:13, David Haller wrote:
>> Hello,
>> 
>> On Sun, 10 Dec 2017, tu...@posteo.de wrote:
>> >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
>> >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 
>> >glob/libglob.a(glob.o): In function `glob_in_dir':
>> >glob.c:(.text+0x2ed): undefined reference to `__alloca'
>> 
>> IIRC, that's a missing #define somewhere. Or a #define where it
>> shouldn't. But the thing is: on my system, make doesn't build libglob
>> at all because it finds the globbing stuff in glibc. And make has its
>> own alloca.c.
>> 
>> So, please show the output of the configure-part of the ebuild and
>> what's the output of:
>> 
>> $ grep _GNU_GLOB_INTERFACE_VERSION /usr/include/gnu-versions.h
>
>Here it comes:
[..]
>./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
>configure: loading site script /usr/share/config.site
[..]
>checking if system libc has GNU glob... no
[..]

That figures.

>/root>grep _GNU_GLOB_INTERFACE_VERSION /usr/include/gnu-versions.h
>#define _GNU_GLOB_INTERFACE_VERSION2 /* vs posix/glob.c */

You seem to be using glibc-2.26. Question is, is that new
GLOB_INTERFACE backwards compatible or not? If it is, you could just
mangle the configure, so that "GNU glob" is considered found, a patch
via the e{apply,patch}_user of configure{ac,} should work.

>Any ideas?

"downgrade" to the stable glibc-2.25 ... ;)

Or dig into why the following happens, i.e. why is __alloca not
defined in glob_in_dir() ...

>> Ah, yess:
>> 
>>  make-4.2.1/glob/glob.c:211 ff. 
>> #if !defined __alloca && !defined __GNU_LIBRARY__
>> [..]
>> #  define alloca(n) __builtin_alloca (n)
>> [..]
>> # define __alloca   alloca
>> [.. down to line 1217 ..]
>> static int
>> glob_in_dir( ..
>> [..]
>> char *fullname = (char *) __alloca(... /* line 1256 */
>> 
>> 
>> Somewhere between that and line 1256 of glob.c, where __alloca is
>> first used in that function you managed to undef __alloca...
>> 
>> You must have done something weird ...

If I have the time, I'll try merging the glibc-2.26 and see what
happens. Usually, debugging preprocessor stuff involves (for me) a lot
of liberally sprinkling of in this case e.g.

#ifndef __alloca
#warning notdef __alloca
#endif

or somesuch throughout the relevant code, occasionally verified against the
preprocessed code (gcc -save-temps is nice ;) But it tends to be
tedious if you don't know the code (and circumstances) well already.

HTH,
-dnh

PS: I've not synced portage for quite some days, I wanted to get done
with the 'emerge -e @world' before adding updates and whatnot into
the mess... So dunno if glibc-2.26 is stable already.

-- 
The problem with people whose minds are in the gutter is that they keep
blocking my periscope.  [Peter Gutman]



Re: [gentoo-user] Make failed to compile: symbol __alloca not found...

2017-12-11 Thread tuxic
On 12/11 06:38, Raffaele Belardi wrote:
> tu...@posteo.de wrote:
> > On 12/11 10:12, Raffaele Belardi wrote:
> >> tu...@posteo.de wrote:
> >>>
> >>> sys-devel/make-4.2.1-r1 failed to compile with this:
> >>>
> >>> How can I recompile make -- it is still non-PIE and one of those
> >>> application which I cant convince to be friendly to gcc :)
> >>>
> >>> How serious is this alloca-thingy at all?
> >>>
> >>
> >> Is there anything special about your environment? For example, I notice 
> >> '--as-needed' in
> >> your linker flags: that affects how the linker works which in turn may 
> >> cause your problem,
> >> was it your choice or a default option?
> >>
> > 
> > My root-environment look like this:
> > 
> 
> What's the output of:
> 
> $ grep CFLAGS /etc/portage/make.conf
> $ grep USE /etc/portage/make.conf
> 
> Are you defining per-package USE or CFLAGS?
> 
> raffaele
> 

I am not defining per package CFLAGS an alike.

CFLAGS="-march=native -O2 -pipe"
USE="nvidia X lua sdl mp3 flac jack alsa gtk cairo sndfile qt3support kpathsea 
gif tga jpeg png jpeg2k mad dvb dvdr encode lzo bzip2 ogg sox v4l v4l2 vorbis 
x264 x265 zsh-completion -hal -lirc"
USE_PYTHON=3.5

Meino





Re: [gentoo-user] Make failed to compile: symbol __alloca not found...

2017-12-11 Thread Raffaele Belardi
tu...@posteo.de wrote:
> On 12/11 10:12, Raffaele Belardi wrote:
>> tu...@posteo.de wrote:
>>>
>>> sys-devel/make-4.2.1-r1 failed to compile with this:
>>>
>>> How can I recompile make -- it is still non-PIE and one of those
>>> application which I cant convince to be friendly to gcc :)
>>>
>>> How serious is this alloca-thingy at all?
>>>
>>
>> Is there anything special about your environment? For example, I notice 
>> '--as-needed' in
>> your linker flags: that affects how the linker works which in turn may cause 
>> your problem,
>> was it your choice or a default option?
>>
> 
> My root-environment look like this:
> 

What's the output of:

$ grep CFLAGS /etc/portage/make.conf
$ grep USE /etc/portage/make.conf

Are you defining per-package USE or CFLAGS?

raffaele



Re: [gentoo-user] Make failed to compile: symbol __alloca not found...

2017-12-11 Thread tuxic
On 12/11 10:12, Raffaele Belardi wrote:
> tu...@posteo.de wrote:
> > Hi,
> > 
> > sys-devel/make-4.2.1-r1 failed to compile with this:
> > 
> 
> > Online I found articles which explain, why it is not recommended to
> > use alloca() at all:
> > RETURN VALUE The alloca() function returns a pointer to the beginning of 
> > the allocated space. If the allocation causes stack overflow, program 
> > behaviour is undefined.
> > (https://stackoverflow.com/questions/1018853/why-is-the-use-of-alloca-not-considered-good-practice)
> > 
> > How can I recompile make -- it is still non-PIE and one of those
> > application which I cant convince to be friendly to gcc :)
> > 
> > How serious is this alloca-thingy at all?
> > 
> 
> Not being able to build sys-devel/make is a really serious thing but rather 
> than trying to
> debug the sources I'd try to understand why it does not build for you while 
> it does for
> most of the gentoo users (otherwise bugzilla and this list would be 
> overwhelmed with panic
> messages!).
> 
> Is there anything special about your environment? For example, I notice 
> '--as-needed' in
> your linker flags: that affects how the linker works which in turn may cause 
> your problem,
> was it your choice or a default option?
> 
> Once your build issue is solved you could investigate on the 'make' online 
> resources why
> they chose to use alloca function (BTW, this may give you a hint: "This 
> temporary space is
> automatically freed when the function that called alloca() returns to its 
> caller." I
> wouldn't use it but it may make some coding easier)
> 
> raffaele
> 
> 


My root-environment look like this:


LS_COLORS=no=00:fi=00:di=00;32:ln=00;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;31:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.tar=00;31:*.tgz=00;31:*.bz2=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.ZIP=00;31:*.z=00;31:*.7z=00;31:*.Z=00;31:*.gz=00;31:*.rpm=00;31:*.maff=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.png=00;35:*.pgm=00;35:*.ppm=00;35:*.pnm=00;35:*.pcx=00;35:*.xbm=00;35:*.xpm=00;35:*.xcf=00;35:*.tif=00;35:*.GIF=00;35:*.BMP=00;35:*.PNG=00;35:*.PGM=00;35:*.PPM=00;35:*.PNM=00;35:*.PCX=00;35:*.XBM=00;35:*.XPM=00;35:*.XCF=00;35:*.TIF=00;35:
LANG=en_US.UTF-8
DISPLAY=:0.0
COLORTERM=rxvt
SHELL=/bin/zsh
TERM=xterm-256color
XAUTHORITY=/home/mccramer/.Xauthority
PATH=/usr/local/cuda/open64/bin:/bin/:/sbin:/usr/sbin:/usr/teTeX/bin/i686-pc-linux-gnu:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin:/usr/lib/llvm/5/bin:/opt/nvidia-cg-toolkit/bin:/opt/cuda/bin:/usr/games/bin:/root/bin:/opt/bin:/opt/maintech/gcc-3.4.5-glibc-2.3.6/arm-920t-linux-gnu/bin:/usr/avr/bin
MAIL=/var/spool/mail/root
LOGNAME=root
USER=root
USERNAME=root
HOME=/root
SUDO_COMMAND=/bin/zsh
SUDO_USER=mccramer
SUDO_UID=1001
SUDO_GID=100
SHLVL=1
PWD=/root
OLDPWD=/home/mccramer
zshloader=:/root/.zshenv:/root/.zshrc
HELPDIR=/usr/local/lib/zsh/help
PKG_CONFIG_PATH=/usr/lib/pkgconfig
AXIOM=/usr/axiom/mnt/linux
GNOME_LIBCONFIG_PATH=/usr/lib
XDG_DATA_DIRS=/root/.local/share:/usr/local/share/:/usr/share/
KFORTH_DIR=/usr/share/kForth
TEXDOCVIEW_dvi=kgh %s
TEXDOCVIEW_pdf=kgh %s
TEXDOCVIEW_ps=kghostview %s
TEXDOCVIEW_html=dillo %s
PS1=%M:%2d>
LESSOPEN=|/usr/bin/lesspipe.sh %s
PERLIO=stdio
PILOTPORT=/dev/tts/0
MC_COLOR_TABLE=base_color=normal=green,black:normal=green,black:menuhot=red,cyan:menuhotsel=red,cyan:directory=cyan,black:executable=green,black:link=red,black:device=green,black:special=green,black:core=green,black:hidden=green,black:temp=green,black:doc=green,black:archive=green,black:source=green,black:media=green,black:graph=green,black:database=green,black:marked=black,yellow:stalelink=black,red:editnormal=green,black
EDITOR=/usr/local/bin/vim
G_BROKEN_FILENAMES=
HISTSIZE=3
EIX_LIMIT=0
PKGHOME=/root/NetModule/nmpackages
DIFMT=SvFUaPTM
CUDA_VISIBLE_DEVICES=0
RANGER_LOAD_DEFAULT_RC=FALSE
_=/bin//env

Cheers
Meino




Re: [gentoo-user] Make failed to compile: symbol __alloca not found...

2017-12-11 Thread tuxic
On 12/11 05:13, David Haller wrote:
> Hello,
> 
> On Sun, 10 Dec 2017, tu...@posteo.de wrote:
> >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
> >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 
> >glob/libglob.a(glob.o): In function `glob_in_dir':
> >glob.c:(.text+0x2ed): undefined reference to `__alloca'
> 
> IIRC, that's a missing #define somewhere. Or a #define where it
> shouldn't. But the thing is: on my system, make doesn't build libglob
> at all because it finds the globbing stuff in glibc. And make has its
> own alloca.c.
> 
> So, please show the output of the configure-part of the ebuild and
> what's the output of:
> 
> $ grep _GNU_GLOB_INTERFACE_VERSION /usr/include/gnu-versions.h
> 
> Ah, yess:
> 
>  make-4.2.1/glob/glob.c:211 ff. 
> #if !defined __alloca && !defined __GNU_LIBRARY__
> [..]
> #  define alloca(n) __builtin_alloca (n)
> [..]
> # define __alloca   alloca
> [.. down to line 1217 ..]
> static int
> glob_in_dir( ..
> [..]
> char *fullname = (char *) __alloca(... /* line 1256 */
> 
> 
> Somewhere between that and line 1256 of glob.c, where __alloca is
> first used in that function you managed to undef __alloca...
> 
> You must have done something weird ...
> 
> -dnh
> 
> -- 
> prom_printf("No VAC. Get some bucks and buy a real computer.");
>   linux-2.6.19/arch/sparc/mm/sun4c.c
> 


Here it comes:


 * Package:sys-devel/make-4.2.1-r1
 * Repository: gentoo
 * Maintainer: base-sys...@gentoo.org
 * USE:abi_x86_64 amd64 elibc_glibc kernel_linux nls userland_GNU
 * FEATURES:   preserve-libs sandbox userpriv usersandbox
>>> Unpacking source...
>>> Unpacking make-4.2.1.tar.bz2 to 
>>> /var/tmp/portage/sys-devel/make-4.2.1-r1/work
>>> Source unpacked in /var/tmp/portage/sys-devel/make-4.2.1-r1/work
>>> Preparing source in 
>>> /var/tmp/portage/sys-devel/make-4.2.1-r1/work/make-4.2.1 ...
 * Applying make-3.82-darwin-library_search-dylib.patch ...
 [ ok ]
 * Applying make-4.2-default-cxx.patch ...
 [ ok ]
>>> Source prepared.
>>> Configuring source in 
>>> /var/tmp/portage/sys-devel/make-4.2.1-r1/work/make-4.2.1 ...
 * econf: updating make-4.2.1/config/config.sub with 
/usr/share/gnuconfig/config.sub
 * econf: updating make-4.2.1/config/config.guess with 
/usr/share/gnuconfig/config.guess
./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
configure: loading site script /usr/share/config.site
checking for a BSD-compatible install... 
/usr/lib/portage/python3.5/ebuild-helpers/xattr/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for style of include used by make... GNU
checking for x86_64-pc-linux-gnu-gcc... x86_64-pc-linux-gnu-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether x86_64-pc-linux-gnu-gcc accepts -g... yes
checking for x86_64-pc-linux-gnu-gcc option to accept ISO C89... none needed
checking whether x86_64-pc-linux-gnu-gcc understands -c and -o together... yes
checking dependency style of x86_64-pc-linux-gnu-gcc... none
checking how to run the C preprocessor... x86_64-pc-linux-gnu-gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for x86_64-pc-linux-gnu-gcc... (cached) x86_64-pc-linux-gnu-gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether 

Re: [gentoo-user] Make failed to compile: symbol __alloca not found...

2017-12-11 Thread David Haller
Hello,

On Sun, 10 Dec 2017, tu...@posteo.de wrote:
>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
>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 
>glob/libglob.a(glob.o): In function `glob_in_dir':
>glob.c:(.text+0x2ed): undefined reference to `__alloca'

IIRC, that's a missing #define somewhere. Or a #define where it
shouldn't. But the thing is: on my system, make doesn't build libglob
at all because it finds the globbing stuff in glibc. And make has its
own alloca.c.

So, please show the output of the configure-part of the ebuild and
what's the output of:

$ grep _GNU_GLOB_INTERFACE_VERSION /usr/include/gnu-versions.h

Ah, yess:

 make-4.2.1/glob/glob.c:211 ff. 
#if !defined __alloca && !defined __GNU_LIBRARY__
[..]
#  define alloca(n) __builtin_alloca (n)
[..]
# define __alloca   alloca
[.. down to line 1217 ..]
static int
glob_in_dir( ..
[..]
char *fullname = (char *) __alloca(... /* line 1256 */


Somewhere between that and line 1256 of glob.c, where __alloca is
first used in that function you managed to undef __alloca...

You must have done something weird ...

-dnh

-- 
prom_printf("No VAC. Get some bucks and buy a real computer.");
linux-2.6.19/arch/sparc/mm/sun4c.c



Re: [gentoo-user] Make failed to compile: symbol __alloca not found...

2017-12-11 Thread Raffaele Belardi
tu...@posteo.de wrote:
> Hi,
> 
> sys-devel/make-4.2.1-r1 failed to compile with this:
> 

> Online I found articles which explain, why it is not recommended to
> use alloca() at all:
> RETURN VALUE The alloca() function returns a pointer to the beginning of the 
> allocated space. If the allocation causes stack overflow, program behaviour 
> is undefined.
> (https://stackoverflow.com/questions/1018853/why-is-the-use-of-alloca-not-considered-good-practice)
> 
> How can I recompile make -- it is still non-PIE and one of those
> application which I cant convince to be friendly to gcc :)
> 
> How serious is this alloca-thingy at all?
> 

Not being able to build sys-devel/make is a really serious thing but rather 
than trying to
debug the sources I'd try to understand why it does not build for you while it 
does for
most of the gentoo users (otherwise bugzilla and this list would be overwhelmed 
with panic
messages!).

Is there anything special about your environment? For example, I notice 
'--as-needed' in
your linker flags: that affects how the linker works which in turn may cause 
your problem,
was it your choice or a default option?

Once your build issue is solved you could investigate on the 'make' online 
resources why
they chose to use alloca function (BTW, this may give you a hint: "This 
temporary space is
automatically freed when the function that called alloca() returns to its 
caller." I
wouldn't use it but it may make some coding easier)

raffaele