Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install older version of gnu-make in Ubuntu 18.04

I want to install make 3.81 on Ubuntu 18.04.

So I download this version of make and run ./configure and then make. But when compiling it gives me this error:

./glob/glob.c: In function ‘glob’:
./glob/glob.c:581:23: warning: implicit declaration of function ‘__alloca’; did you mean ‘alloca’? [-Wimplicit-function-declaration]
       newp = (char *) __alloca (dirlen + 1);
                       ^~~~~~~~
                       alloca
./glob/glob.c:581:14: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
       newp = (char *) __alloca (dirlen + 1);
              ^
./glob/glob.c:709:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
        newp = (char *) __alloca (home_len + dirlen);
               ^
./glob/glob.c:732:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
        newp = (char *) __alloca (end_name - dirname);
               ^
./glob/glob.c:783:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
        newp = (char *) __alloca (home_len + rest_len + 1);
               ^
./glob/glob.c:814:11: warning: implicit declaration of function ‘__stat’; did you mean ‘__xstat’? [-Wimplicit-function-declaration]
         : __stat (dirname, &st)) == 0
           ^~~~~~
           __xstat
./glob/glob.c: In function ‘glob_in_dir’:
./glob/glob.c:1256:21: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    char *fullname = (char *) __alloca (dirlen + 1 + patlen + 1);
                     ^
./glob/glob.c:1283:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    names = (struct globlink *) __alloca (sizeof (struct globlink));
            ^
./glob/glob.c:1341:32: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
         struct globlink *new = (struct globlink *)
                                ^
./glob/glob.c:1367:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
       names = (struct globlink *) __alloca (sizeof (struct globlink));

Same situation at building version 3.82. My current version of make is 4.1.

Is anybody know what could be wrong?

Thanks

EDIT:

glob/libglob.a(glob.o): In function `glob_in_dir':
/opt/make-3.81/glob/glob.c:1361: undefined reference to `__alloca'
/opt/make-3.81/glob/glob.c:1336: undefined reference to `__alloca'
/opt/make-3.81/glob/glob.c:1277: undefined reference to `__alloca'
/opt/make-3.81/glob/glob.c:1250: undefined reference to `__alloca'
glob/libglob.a(glob.o): In function `glob':
/opt/make-3.81/glob/glob.c:575: undefined reference to `__alloca'
glob/libglob.a(glob.o):/opt/make-3.81/glob/glob.c:726: more undefined references to `__alloca' follow
collect2: error: ld returned 1 exit status
Makefile:410: recipe for target 'make' failed
make[2]: *** [make] Error 1
make[2]: Leaving directory '/opt/make-3.81'
Makefile:603: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/opt/make-3.81'
Makefile:326: recipe for target 'all' failed
make: *** [all] Error 2
like image 709
Rastlyn Avatar asked Aug 03 '18 14:08

Rastlyn


People also ask

How do I install an older version of Ubuntu?

To start the downgrading process from Ubuntu 19.04 to Ubuntu 18.04 LTS, head to Ubuntu.com, and click the “Download” button on the menu to reveal the different download options available. Then, grab the ISO image for Ubuntu 18.04 LTS and download it to your PC.


1 Answers

You can try modify the glob.c file:

# if _GNU_GLOB_INTERFACE_VERSION == GLOB_INTERFACE_VERSION 

to

# if _GNU_GLOB_INTERFACE_VERSION >= GLOB_INTERFACE_VERSION

For me it's work and i can build make 3.82

(credit: http://gnu-make.2324884.n4.nabble.com/undefined-reference-to-alloca-td18308.html)

like image 68
dceccon Avatar answered Oct 05 '22 22:10

dceccon