【问题标题】:Install older version of gnu-make in Ubuntu 18.04在 Ubuntu 18.04 中安装旧版本的 gnu-make
【发布时间】:2019-01-11 11:58:48
【问题描述】:

我想在 Ubuntu 18.04 上安装 make 3.81。

所以我下载了这个版本的 make 并运行 ./configure,然后 ma​​ke。但是在编译时它给了我这个错误:

./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' 的引用如下 collect2:错误:ld 返回 1 个退出状态 Makefile:410: 目标“make”的配方失败 make[2]: *** [make] 错误 1 make[2]: 离开目录 '/opt/make-3.81' Makefile:603:目标“全递归”的配方失败 make[1]: *** [all-recursive] 错误 1 make[1]: 离开目录 '/opt/make-3.81' Makefile:326:目标“全部”的配方失败 make: *** [全部] 错误 2

【问题讨论】:

  • 您应该在Ask Ubuntu stackexchange 上提问。虽然这是一个构建工具并且有点主题,但您可能会在安装问题上得到更好的响应
  • 只是一个猜测,但您似乎没有包含正确的 .h 文件集。对不起,没有想到让你前进。在这里搜索看看其他[make]Qs?祝你好运!
  • @scrappedcola 是的,我应该在那里问,不知道为什么我没有想到它:D
  • 这些只是警告。你真的得到一个编译错误吗? make 可执行文件是否生成?如果是这样,你就完成了,恭喜!如果没有,您必须向我们展示导致编译失败的 错误 消息,而不是警告。
  • 由 AskUbuntu 上的同一 question 解决。这个discussion 中描述并解决了问题

标签: linux ubuntu gnu-make


【解决方案1】:

您可以尝试修改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

【讨论】:

  • (在 4.2.1 版中)此更改给我一个分段错误。从 gnu-make.2324884.n4.nabble.com/… ,替换 #if !defined alloca && !defined __GNU_LIBRARY 为 #if !defined alloca && defined __GNU_LIBRARY
猜你喜欢
  • 2015-09-08
  • 1970-01-01
  • 2018-12-30
  • 1970-01-01
  • 1970-01-01
  • 2023-04-08
  • 2019-03-08
  • 2021-10-13
  • 2020-10-22
相关资源
最近更新 更多