bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: undefined reference to `__alloca'


From: Earnestly
Subject: Re: undefined reference to `__alloca'
Date: Sat, 18 Nov 2017 18:35:17 +0000
User-agent: Mutt/1.9.1 (2017-09-22)

On Sat, Nov 18, 2017 at 01:02:00PM -0500, Paul Smith wrote:
> Thanks for the good info on your version of make and GCC... but... can
> you provide details on what operating system you're using?

I'm currently using Arch Linux currently on kernel 4.13.11 with a lot of
packages built from latest development, such as glibc and make (to find
issues like these).

My environment includes the following:

    CPPFLAGS=-D_FORTIFY_SOURCE=2
    CFLAGS='-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong 
-fno-plt -g -fvar-tracking-assignments'
    LDFLAGS='-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'
    MAKEFLAGS=-j4

I believe I've included the versions for everything but if you'd like
any more details, feel free to ask.

> Also curious: why does the build decide to compile/link the version of
> glob that comes with make?  If you're using glibc then it should use
> the one that comes with glibc instead.

Wasn't this specifically done to workaround make using glibc internals
from this patch?

    [PATCH] Do not assume glibc glob internals
    http://lists.gnu.org/archive/html/bug-make/2017-09/msg00014.html

> You could try grabbing the glob.[ch] / fnmatch.[ch] from the latest
> gnulib; I'm not sure how easy it would be to just drop in.  The goal of
> the current set of changes is to switch over to using gnulib.

I had a go at replacing glob.[ch] and fnmatch.[ch] from the latest
gnulib git://git.savannah.gnu.org/gnulib.git but ran into several
issues.

I ended up having to copy flexmember.h, glob_internal.h,
scratch_buffer.h and malloc/scratch_buffer.h with it all ending in a
many syntax errors:

[nb. Sorry for the long output which is likely just noise]

    In file included from ./scratch_buffer.h:4:0,
                     from glob.c:77:
    ./malloc/scratch_buffer.h:95:1: warning: return type defaults to ‘int’ 
[-Wimplicit-int]
     libc_hidden_proto (__libc_scratch_buffer_grow)
     ^~~~~~~~~~~~~~~~~
    ./malloc/scratch_buffer.h: In function ‘libc_hidden_proto’:
    ./malloc/scratch_buffer.h:100:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or 
‘__attribute__’ before ‘{’ token
     {
     ^
    ./malloc/scratch_buffer.h:107:1: error: expected declaration specifiers 
before ‘libc_hidden_proto’
     libc_hidden_proto (__libc_scratch_buffer_grow_preserve)
     ^~~~~~~~~~~~~~~~~
    ./malloc/scratch_buffer.h:124:1: error: expected declaration specifiers 
before ‘libc_hidden_proto’
     libc_hidden_proto (__libc_scratch_buffer_set_array_size)
     ^~~~~~~~~~~~~~~~~
    glob.c:79:20: error: storage class specified for parameter ‘next_brace_sub’
     static const char *next_brace_sub (const char *begin, int flags) __THROWNL;
                        ^~~~~~~~~~~~~~
    glob.c:79:1: warning: ‘__nothrow__’ attribute ignored [-Wattributes]
     static const char *next_brace_sub (const char *begin, int flags) __THROWNL;
     ^~~~~~
    glob.c:81:22: error: storage class specified for parameter ‘dirent_type’
     typedef uint_fast8_t dirent_type;
                          ^~~~~~~~~~~
    glob.c:100:3: error: expected specifier-qualifier-list before ‘dirent_type’
       dirent_type type;
       ^~~~~~~~~~~
    glob.c:96:1: warning: empty declaration
     struct readdir_result
     ^~~~~~
    glob.c:106:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ 
before ‘readdir_result_type’
     readdir_result_type (struct readdir_result d)
     ^~~~~~~~~~~~~~~~~~~
    glob.c:136:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ 
before ‘{’ token
     {
     ^
    glob.c:188:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ 
before ‘{’ token
     {
     ^
    glob.c:199:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ 
before ‘{’ token
     {
     ^
    glob.c:205:12: error: storage class specified for parameter ‘glob_in_dir’
     static int glob_in_dir (const char *pattern, const char *directory,
                ^~~~~~~~~~~
    glob.c:208:12: error: storage class specified for parameter ‘prefix_array’
     static int prefix_array (const char *prefix, char **array, size_t n) 
__THROWNL;
                ^~~~~~~~~~~~
    glob.c:208:1: warning: ‘__nothrow__’ attribute ignored [-Wattributes]
     static int prefix_array (const char *prefix, char **array, size_t n) 
__THROWNL;
     ^~~~~~
    glob.c:209:12: error: storage class specified for parameter 
‘collated_compare’
     static int collated_compare (const void *, const void *) __THROWNL;
                ^~~~~~~~~~~~~~~~
    glob.c:209:1: warning: ‘__nothrow__’ attribute ignored [-Wattributes]
     static int collated_compare (const void *, const void *) __THROWNL;
     ^~~~~~
    glob.c:216:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ 
before ‘{’ token
     {
     ^
    glob.c:227:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ 
before ‘{’ token
     {
     ^
    glob.c:263:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ 
before ‘{’ token
     {
     ^
    glob.c:1145:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ 
before ‘{’ token
     {
     ^
    glob.c:1165:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ 
before ‘{’ token
     {
     ^
    glob.c:1221:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ 
before ‘{’ token
     {
     ^
    In file included from ./scratch_buffer.h:4:0,
                     from glob.c:77:
    ./malloc/scratch_buffer.h:95:1: warning: type of ‘gl_scratch_buffer_grow’ 
defaults to ‘int’ [-Wimplicit-int]
     libc_hidden_proto (__libc_scratch_buffer_grow)
     ^~~~~~~~~~~~~~~~~
    glob.c:209:12: error: declaration for parameter ‘collated_compare’ but no 
such parameter
     static int collated_compare (const void *, const void *) __THROWNL;
                ^~~~~~~~~~~~~~~~
    glob.c:208:12: error: declaration for parameter ‘prefix_array’ but no such 
parameter
     static int prefix_array (const char *prefix, char **array, size_t n) 
__THROWNL;
                ^~~~~~~~~~~~
    glob.c:205:12: error: declaration for parameter ‘glob_in_dir’ but no such 
parameter
     static int glob_in_dir (const char *pattern, const char *directory,
                ^~~~~~~~~~~
    glob.c:81:22: error: declaration for parameter ‘dirent_type’ but no such 
parameter
     typedef uint_fast8_t dirent_type;
                          ^~~~~~~~~~~
    glob.c:79:20: error: declaration for parameter ‘next_brace_sub’ but no such 
parameter
     static const char *next_brace_sub (const char *begin, int flags) __THROWNL;
                        ^~~~~~~~~~~~~~
    In file included from glob.c:77:0:
    ./scratch_buffer.h:3:46: error: declaration for parameter 
‘gl_scratch_buffer_set_array_size’ but no such parameter
     #define __libc_scratch_buffer_set_array_size 
gl_scratch_buffer_set_array_size
                                                  ^
    ./malloc/scratch_buffer.h:122:6: note: in expansion of macro 
‘__libc_scratch_buffer_set_array_size’
     bool __libc_scratch_buffer_set_array_size (struct scratch_buffer *buffer,
          ^
    ./scratch_buffer.h:2:45: error: declaration for parameter 
‘gl_scratch_buffer_grow_preserve’ but no such parameter
     #define __libc_scratch_buffer_grow_preserve gl_scratch_buffer_grow_preserve
                                                 ^
    ./malloc/scratch_buffer.h:106:6: note: in expansion of macro 
‘__libc_scratch_buffer_grow_preserve’
     bool __libc_scratch_buffer_grow_preserve (struct scratch_buffer *buffer);
          ^
    glob.c:1464:1: error: expected ‘{’ at end of input
     }
     ^



reply via email to

[Prev in Thread] Current Thread [Next in Thread]