首页 > 其他分享 >编译make 4.2.1

编译make 4.2.1

时间:2023-06-15 12:00:27浏览次数:47  
标签:__ 4.2 make 编译 alloca pointer glob

下载源码

https://mirrors.tuna.tsinghua.edu.cn/gnu/make/make-4.2.1.tar.gz

编译并安装

tar xzvf make-4.2.1.tar.gz
cd make-4.2.1
./configure --prefix=/home/wangyuan/soft/
/* 如果当前系统中没有安装make /
./build.sh
/
如果安装了make */
make
./make install

错误解决

错误日志:

点击查看错误日志
compiling glob/glob.c...
./glob/glob.c: In function ‘glob’:
./glob/glob.c:581:23: warning: implicit declaration of function ‘__alloca’; did you mean ‘alloca’? [-Wimplicit-function-declaration]
  581 |       newp = (char *) __alloca (dirlen + 1);
      |                       ^~~~~~~~
      |                       alloca
./glob/glob.c:581:14: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  581 |       newp = (char *) __alloca (dirlen + 1);
      |              ^
./glob/glob.c:709:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  709 |               newp = (char *) __alloca (home_len + dirlen);
      |                      ^
./glob/glob.c:732:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  732 |               newp = (char *) __alloca (end_name - dirname);
      |                      ^
./glob/glob.c:783:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  783 |               newp = (char *) __alloca (home_len + rest_len + 1);
      |                      ^
./glob/glob.c:814:18: warning: implicit declaration of function ‘__stat’; did you mean ‘lstat’? [-Wimplicit-function-declaration]
  814 |                : __stat (dirname, &st)) == 0
      |                  ^~~~~~
      |                  lstat
./glob/glob.c: In function ‘glob_in_dir’:
./glob/glob.c:1256:28: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
 1256 |           char *fullname = (char *) __alloca (dirlen + 1 + patlen + 1);
      |                            ^
./glob/glob.c:1283:19: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
 1283 |           names = (struct globlink *) __alloca (sizeof (struct globlink));
      |                   ^
./glob/glob.c:1341:46: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
 1341 |                       struct globlink *new = (struct globlink *)
      |                                              ^
./glob/glob.c:1367:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
 1367 |       names = (struct globlink *) __alloca (sizeof (struct globlink));
      |               ^
linking make...
/usr/bin/ld: glob.o: in function `glob_in_dir':
/home/wangyuan/make/make-4.2.1/./glob/glob.c:1367: undefined reference to `__alloca'
/usr/bin/ld: /home/wangyuan/make/make-4.2.1/./glob/glob.c:1342: undefined reference to `__alloca'
/usr/bin/ld: /home/wangyuan/make/make-4.2.1/./glob/glob.c:1283: undefined reference to `__alloca'
/usr/bin/ld: /home/wangyuan/make/make-4.2.1/./glob/glob.c:1256: undefined reference to `__alloca'
/usr/bin/ld: /home/wangyuan/make/make-4.2.1/./glob/glob.c:1269: undefined reference to `__stat'
/usr/bin/ld: glob.o: in function `glob':
/home/wangyuan/make/make-4.2.1/./glob/glob.c:581: undefined reference to `__alloca'
/usr/bin/ld: /home/wangyuan/make/make-4.2.1/./glob/glob.c:1036: undefined reference to `__stat'
/usr/bin/ld: /home/wangyuan/make/make-4.2.1/./glob/glob.c:732: undefined reference to `__alloca'
/usr/bin/ld: /home/wangyuan/make/make-4.2.1/./glob/glob.c:783: undefined reference to `__alloca'
/usr/bin/ld: /home/wangyuan/make/make-4.2.1/./glob/glob.c:814: undefined reference to `__stat'
/usr/bin/ld: /home/wangyuan/make/make-4.2.1/./glob/glob.c:960: undefined reference to `__stat'
/usr/bin/ld: /home/wangyuan/make/make-4.2.1/./glob/glob.c:709: undefined reference to `__alloca'
collect2: error: ld returned 1 exit status

解决方法:
修改glob.c文件:
将 # if _GNU_GLOB_INTERFACE_VERSION == GLOB_INTERFACE_VERSION 修改为 # if _GNU_GLOB_INTERFACE_VERSION >= GLOB_INTERFACE_VERSION

标签:__,4.2,make,编译,alloca,pointer,glob
From: https://www.cnblogs.com/coolYuan/p/17482505.html

相关文章

  • django 更改了modules.py 数据库模型,但是 python3 manage.py makemigrations 提示无
    现象:明明改了modules.py文件。删了appname/migrations/下所有内容。而且也删除了django模型变更记录表django_migrations中appname项目的记录 原因:删多了: appname/migrations/下所有内容。__init__.py不能删,需要重新创建一个,否则识别不了包了  ......
  • CUDA编译设置
    CUDA版本和GPU卡的对应关系,以及编译设置:Fermi (CUDA3.2untilCUDA8) (deprecatedfromCUDA9):SM20orSM_20,compute_30–Oldercardssuchas GeForce400,500,600,GT-630Kepler(CUDA5andlater):SM30orSM_30,compute_30–Keplerarchitecture(ge......
  • Java中String类型能够存放多大的数据量?编译器只支持String只能存放65535个字符,运行时
    Java中String类型能够存放多大的数据量?https://blog.csdn.net/weixin_52707625/article/details/125583678最近在编写博客系统时,在文章上传遇到了个问题:到底使用什么来接收文章呢?String类型能接收多大的数据量?随后,我去网上找了一下,发现都是说String只能存放65535个字符啊......
  • Ubuntu 源代码编译安装 Nginx
    建立nginx用户和用户组sudogroupaddnginxsudouseraddnginx-gnginx-s/sbin/nologin-M在线安装依赖sudoapt-yinstallgccmakeopenssllibssl-devlibpcre3libpcre3-devlibgd-devvimwgetnet-tools下载并解压nginx源代码wgethttp://nginx.org/download/nginx-1.24......
  • 构建简单CMake及vscode调试
    main.cpp#include<iostream>intmain(){intnum_a,num_b;num_a=10;num_b=20;std::cout<<"num_a="<<num_a<<std::endl;std::cout<<"num_b="<<num_b<<std......
  • 编译原理动手实操,用java实现编译器-算术表达式及其语法解析器的实现
     本节代码下载地址:http://pan.baidu.com/s/1sjWiwPn代码的理解和运行是吃透编译原理的关键,如果我们看的是爱情动作片,自然选择无码的好,但如果看得是计算机课程,则必须有码,无码的计算机理论都是耍流氓。当前,java所实现的简易编译器目的是将一条或一组含有加号和乘号的算术表达式编译......
  • java开发C语言编译器:jvm的return指令以及局部变量的操作
    jvm运行字节码时,代码的运行必须围绕两种数据结构,一种是堆栈,一种是队列,如果jvm执行某条指令时,该指令需要对数据进行操作,那么被操作的数据在指令执行前,必须要压倒堆栈上。如果堆栈上的数据需要暂时保持起来时,它就会被加载到局部变量队列上。java代码中,每个方法里面的局部变量包括函数......
  • 自己动手写编译器:使用NFA识别字符串
    在前面章节中我们构建了NFA状态机,现在我们看看如何使用它来识别给定字符串是否合法。首先我们先构造如下正则表达式对应的NFA,在input文件的表达式部分输入:({D}*\.{D}|{D}\.{D}*)这个表达式的目的是识别浮点数,用我们前面做好的代码生成的NFA状态机如下:  这里我们需要引入两个......
  • 自己动手写编译器:汤普森构造法
    上节我们描述了正则表达式的规则,有过一些编程经验的同学或许都用过正则表达式功能,通常使用它来检验特定格式的字符串,例如检验输入的邮箱是否合法等。当然大多数时候我们只要“调用”即可,但对于要做编译器而言,我们必须自己实现正则表达式引擎的功能。本节我们要实现的正则表达式引擎......
  • 自己动手写编译器:词法解析的系统化研究
    在前面章节中,我们千辛万苦的做了一个可以将部分c语言代码进行解析并编译成中间语言的微型编译器,通过实践我们对编译技术的整体架构和实现原理有了一定的感性认识,实现了“没吃过猪肉但见过猪跑”,从本节开始,我们正式进入“吃猪肉”的过程,我们将非常系统的去研究编译原理各部分理论和......