在CentOS/Debian/Ubuntu上编译安装最新版gnu make 和GNU 'binutils' (as and ld)

本文介绍了如何在CentOS、Debian和Ubuntu系统上检查make的版本,并详细说明了如何升级到最新版的GNU make以及安装GNU 'binutils'中的as和ld工具。在编译安装过程中,首先确保已安装make,然后通过卸载旧版本并链接新版本来更新make。接着,详细阐述了如何编译和安装binutils中的必要组件。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

先查看make版本:

root@:~/clickhouse/gcc-build# make --version
GNU Make 3.82
Built for x86_64-redhat-linux-gnu
Copyright (C) 2010  Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

要求版本:

   * GNU 'make' 4.0 or newer

     As of relase time, GNU 'make' 4.2.1 is the newest verified to work
     to build the GNU C Library.

编译安装make:
你需要先安装make,才能使用make进行编译安装make

wget https://ftp.gnu.org/gnu/make/make-4.2.tar.gz
tar xvf make-4.2.tar.gz
cd make-4.2/
./configure 
make
sudo make install

查看版本:

root@:~/clickhouse/ft_local/make-4.2# /usr/local/bin/make --version
GNU Make 4.2
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

你可以把旧版本卸载了,链接新版本过去:

yum remove make
ln -s /usr/local/bin/make /usr/bin/
make --version

参考链接:makefile - how to update make 3.81 linux - Stack Overflow


然后安装最新版GNU ‘binutils’ (as and ld)
gnu binutils中有很多,但是编译glibc只需之2个:

   * GNU 'binutils' 2.25 or later

     You must use GNU 'binutils' (as and ld) to build the GNU C Library.
     No other assembler or linker has the necessary functionality at the
     moment.  As of release time, GNU 'binutils' 2.31.1 is the newest
     verified to work to build the GNU C Library.

编译安装方法:

wget https://ftp.gnu.org/gnu/binutils/binutils-2.32.tar.gz
tar xvf binutils-2.32.tar.gz
cd binutils-2.32/
./configure =
make
sudo make install

查看版本:

root@:~/clickhouse/binutils-2.32# /usr/local/bin/ld --version
GNU ld (GNU Binutils) 2.32
Copyright (C) 2019 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
### 如何在Linux上安装 `aarch64-linux-gnu-objdump` `aarch64-linux-gnu-objdump` 是 GNU Binutils 工具链的一部分,通常用于分析操作 ARM 架构的目标文件。要安装此工具,可以通过包管理器获取完整的 GNU Binutils 套件。 #### 使用 APT 安装(适用于 Debian/Ubuntu) 对于基于 Debian 的 Linux 发行版,可以运行以下命令来安装所需的工具: ```bash sudo apt update sudo apt install binutils-aarch64-linux-gnu ``` 这会安装包括 `aarch64-linux-gnu-objdump` 在内的多个交叉开发工具[^3]。 #### 使用 YUM 或 DNF 安装(适用于 CentOS/RHEL/Fedora) 对于 Red Hat 系列发行版,可能需要启用额外的存储库才能找到这些工具。以下是具体方法: 1. **Fedora**: 运行以下命令以安装必要的软件包: ```bash sudo dnf install binutils-arm-none-eabi ``` 2. **CentOS/RHEL**: 需要手动编译或通过第三方仓库(如 EPEL)获取支持: ```bash sudo yum install epel-release sudo yum search arm | grep binutils ``` 如果找不到预构建的二进制文件,则需自行编译源码[^4]。 #### 手动编译 GNU Binutils 如果无法通过包管理器获得该工具,可以选择从源代码编译 GNU Binutils: 1. 下载最新版本的 GNU Binutils 源代码: ```bash wget https://ftp.gnu.org/gnu/binutils/binutils-latest.tar.gz tar -xzf binutils-latest.tar.gz cd binutils-* ``` 2. 配置并编译项目: ```bash ./configure --target=aarch64-linux-gnu --prefix=/usr/local/aarch64-toolchain make -j$(nproc) sudo make install ``` 完成上述过程后,可以在指定路径下找到已安装的 `aarch64-linux-gnu-objdump` 及其他相关工具[^5]。 --- ### 示例验证 假设已经成功安装了工具,可通过以下方式测试其功能: ```bash aarch64-linux-gnu-objdump --version ``` 正常情况下应返回类似如下输出: ``` GNU objdump (GNU Binutils for Ubuntu) 2.37 ... ``` ---
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值