在Ubuntu 18.04中安装旧版本的gnu-make
收藏

我想在Ubuntu18.04上安装make 3.81。
所以我下载这个版本的make并运行./configure,然后make。但编译时会出现以下错误:

./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));

在3.82版本中的情况相同。我现在的make版本是4.1。
有人知道怎么回事吗?
谢谢
编辑:
glob/libglob.a(glob.o):在函数“glob-in-dir”中:
/opt/make-3.81/glob/glob.c:1361:对“alloca”的未定义引用
/opt/make-3.81/glob/glob.c:1336:对“alloca”的未定义引用
/opt/make-3.81/glob/glob.c:1277:对“alloca”的未定义引用
/opt/make-3.81/glob/glob.c:1250:对“alloca”的未定义引用
glob/libglob.a(glob.o):在函数“glob”中:
/opt/make-3.81/glob/glob.c:575:对“alloca”的未定义引用
glob/libglob.a(glob.o):/opt/make-3.81/glob/glob.c:726:对“alloca”follow的更多未定义引用
错误2:LD返回1退出状态
makefile:410:目标“make”的配方失败
make[2]:***[make]错误1
make[2]:离开目录'/opt/make-3.81'
makefile:603:目标'all recursive'的配方失败
make[1]:***[所有递归]错误1
make[1]:离开目录'/opt/make-3.81'
makefile:326:目标“all”的配方失败
make:**[all]错误2


最佳答案:

您可以尝试修改glob.c文件:

# if _GNU_GLOB_INTERFACE_VERSION == GLOB_INTERFACE_VERSION 


# if _GNU_GLOB_INTERFACE_VERSION >= GLOB_INTERFACE_VERSION

对我来说这是工作,我可以建立make 3.82
(学分:http://gnu-make.2324884.n4.nabble.com/undefined-reference-to-alloca-td18308.html

公众号