Skip to content

Commit

Permalink
i686 Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
24bit-xjkp committed Mar 3, 2024
1 parent 0fd6fa5 commit ca39e77
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
18 changes: 18 additions & 0 deletions readme/x86_64-w64-mingw32-host-i686-linux-gnu-target-gcc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# GCC14工具链

## 平台

| build | host | target |
| :--------------- | :----------------- | :------------- |
| x86_64-linux-gnu | x86_64-w64-mingw32 | i686-linux-gnu |

## 版本

- GCC:14.0.1
- Binutils:2.42.50

## 组件

- gcc
- g++
- binutils
43 changes: 43 additions & 0 deletions script/x86_64_w64_mingw32_host_i686_linux_gnu_target_gcc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import gcc_environment as gcc

env = gcc.environment("14", host="x86_64-w64-mingw32", target="i686-linux-gnu")


def build() -> None:
# 更新源代码
# env.update()

basic_option = f"--disable-werror --prefix={env.prefix} --host={env.host} --target={env.target}"
gcc_option = "--disable-multilib --enable-languages=c,c++"

# 编译安装完整gcc
env.enter_build_dir("gcc")
env.configure(basic_option, gcc_option)
env.make()
env.install("install-strip")

# 编译安装binutils
env.enter_build_dir("binutils")
env.configure(basic_option, "--disable-gdb")
env.make()
env.install()

# 安装Linux头文件
env.enter_build_dir("linux")
env.make(f"ARCH=x86 INSTALL_HDR_PATH={env.lib_prefix} headers_install")

# 安装glibc
env.enter_build_dir("glibc")
env.configure(f"--disable-werror --host={env.target} --prefix={env.lib_prefix} --build={env.build}")
env.make()
env.install("install")
env.adjust_glibc()

# 打包工具链
env.package(False)


if __name__ == "__main__":
build()

0 comments on commit ca39e77

Please sign in to comment.