diff options
| author | CoprDistGit <infra@openeuler.org> | 2026-06-09 03:30:29 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2026-06-09 03:30:29 +0000 |
| commit | 908b7bce1774452df4aa0d20bc9887bf76abf30a (patch) | |
| tree | e83316d03f5de6c12de91339248c85a98a128b9b | |
| parent | ccccf4161ea7163a8be671134df32e838e212b76 (diff) | |
automatic import of ai-builder-glibcopeneuler24.03_LTS_SP2
| -rw-r--r-- | .gitignore | 8 | ||||
| -rw-r--r-- | ai-builder-glibc.spec | 132 | ||||
| -rw-r--r-- | sources | 8 |
3 files changed, 148 insertions, 0 deletions
@@ -0,0 +1,8 @@ +/glibc-2.17-326.el7_9.aarch64.tar.gz +/glibc-2.17-326.el7_9.x86_64.tar.gz +/glibc-common-2.17-317.el7.aarch64.tar.gz +/glibc-common-2.17-317.el7.x86_64.tar.gz +/glibc-devel-2.17-317.el7.aarch64.tar.gz +/glibc-devel-2.17-317.el7.x86_64.tar.gz +/glibc-headers-2.17-317.el7.aarch64.tar.gz +/glibc-headers-2.17-317.el7.x86_64.tar.gz diff --git a/ai-builder-glibc.spec b/ai-builder-glibc.spec new file mode 100644 index 0000000..fbb5b34 --- /dev/null +++ b/ai-builder-glibc.spec @@ -0,0 +1,132 @@ +%global gcc_toolset_base /opt/openEuler/gcc-toolset-7 +%global gcc_toolset_root %{gcc_toolset_base}/root +%global debug_package %{nil} + +%ifarch x86_64 +%global glibc_tar %{SOURCE0} +%global glibc_common_tar %{SOURCE1} +%global glibc_devel_tar %{SOURCE2} +%global glibc_headers_tar %{SOURCE3} +%global arch_asm_dir x86_64-linux-gnu +%endif + +%ifarch aarch64 +%global glibc_tar %{SOURCE4} +%global glibc_common_tar %{SOURCE5} +%global glibc_devel_tar %{SOURCE6} +%global glibc_headers_tar %{SOURCE7} +%global arch_asm_dir aarch64-linux-gnu +%endif + +Name: ai-builder-glibc +Version: 2.17 +Release: 1%{?dist} +Summary: Extract EL7 glibc runtime and development files for gcc-toolset-7 sysroot +License: LGPLv2+ and LGPLv2+ with exceptions and GPLv2+ +URL: https://www.gnu.org/software/libc/ + +# Put these tar.gz files into rpmbuild SOURCES. They are RPM payloads already +# converted to archive form, and the package build selects the matching set by +# target architecture. +Source0: glibc-2.17-326.el7_9.x86_64.tar.gz +Source1: glibc-common-2.17-317.el7.x86_64.tar.gz +Source2: glibc-devel-2.17-317.el7.x86_64.tar.gz +Source3: glibc-headers-2.17-317.el7.x86_64.tar.gz +Source4: glibc-2.17-326.el7_9.aarch64.tar.gz +Source5: glibc-common-2.17-317.el7.aarch64.tar.gz +Source6: glibc-devel-2.17-317.el7.aarch64.tar.gz +Source7: glibc-headers-2.17-317.el7.aarch64.tar.gz + +ExclusiveArch: x86_64 aarch64 +BuildRequires: gzip +BuildRequires: tar + +# The extracted EL7 glibc is private to %%{gcc_toolset_root}. Do not let RPM +# dependency generators advertise these files as system glibc providers. +AutoReqProv: no +Provides: bundled(glibc) = %{version} + +%description +This package extracts glibc, glibc-common, glibc-devel and glibc-headers binary +RPM payload archives into the private gcc-toolset-7 sysroot layout used on openEuler 24.03. +It is intended to provide the libc runtime, crt objects, linker scripts and +headers needed by the devtoolset-7 GCC build flow. + +%prep +rm -rf extract-root +mkdir -p extract-root + +cd extract-root +for tar_file in \ + "%{glibc_tar}" \ + "%{glibc_common_tar}" \ + "%{glibc_devel_tar}" \ + "%{glibc_headers_tar}" +do + tar --no-same-owner -xzf "${tar_file}" +done + +%build +# Nothing to build. This package only repackages glibc files into a private +# gcc-toolset-7 sysroot. + +%install +rm -rf %{buildroot} + +install -d -m 0755 %{buildroot}%{gcc_toolset_root} +cp -a extract-root/. %{buildroot}%{gcc_toolset_root}/ + +# glibc-devel/glibc-headers depend on kernel headers. Keep the same behavior +# as build-devtoolset7.sh: use the openEuler 24.03 system kernel headers from +# outside the private sysroot. Use relative symlink targets to avoid RPM +# absolute-symlink warnings while resolving to the same host headers. +install -d -m 0755 %{buildroot}%{gcc_toolset_root}/usr/include +rm -rf \ + %{buildroot}%{gcc_toolset_root}/usr/include/linux \ + %{buildroot}%{gcc_toolset_root}/usr/include/asm-generic \ + %{buildroot}%{gcc_toolset_root}/usr/include/asm +ln -sfn ../../../../../../usr/include/linux \ + %{buildroot}%{gcc_toolset_root}/usr/include/linux +ln -sfn ../../../../../../usr/include/asm-generic \ + %{buildroot}%{gcc_toolset_root}/usr/include/asm-generic +ln -sfn ../../../../../../usr/include/asm \ + %{buildroot}%{gcc_toolset_root}/usr/include/asm + +# Some GCC probes and older build scripts look for the Debian/Ubuntu-style +# architecture include directory. Point it at the rpm-style asm headers. +install -d -m 0755 %{buildroot}%{gcc_toolset_root}/usr/include/%{arch_asm_dir} +rm -rf %{buildroot}%{gcc_toolset_root}/usr/include/%{arch_asm_dir}/asm +ln -sfn ../../../../../../../usr/include/asm \ + %{buildroot}%{gcc_toolset_root}/usr/include/%{arch_asm_dir}/asm + +# RPM payloads may contain absolute symlinks such as /lib64/libc-2.17.so. +# Inside the private sysroot they should resolve to %%{gcc_toolset_root}/lib64. +find %{buildroot}%{gcc_toolset_root} -type l | while read link_path +do + link_target="$(readlink "${link_path}")" + case "${link_target}" in + /lib*|/usr/lib*) + ln -sfn "%{gcc_toolset_root}${link_target}" "${link_path}" + ;; + esac +done + +# Convenience environment file matching the new openEuler installation prefix. +cat > %{buildroot}%{gcc_toolset_base}/enable <<'EOF' +export PATH=/opt/openEuler/gcc-toolset-7/root/usr/bin:${PATH} +export CC=/opt/openEuler/gcc-toolset-7/root/usr/bin/gcc +export CXX=/opt/openEuler/gcc-toolset-7/root/usr/bin/g++ +EOF + +%files +%dir /opt/openEuler +%dir %{gcc_toolset_base} +%{gcc_toolset_base}/enable +%{gcc_toolset_root} + +%changelog +* Tue Jun 09 2026 Example Maintainer <example@example.com> - 2.17-1 +- Switch sources from RPM files to converted tar.gz payload archives + +* Thu May 28 2026 Example Maintainer <example@example.com> - 2.17-1 +- Extract EL7 glibc RPM payloads into gcc-toolset-7 sysroot for openEuler 24.03 @@ -0,0 +1,8 @@ +154124881303191f6f8205374936de6a glibc-2.17-326.el7_9.aarch64.tar.gz +fbb186bc15d90a86c13dda0a73f11ed3 glibc-2.17-326.el7_9.x86_64.tar.gz +f16f2f56bc2d4c0ee1a43c8f0208f602 glibc-common-2.17-317.el7.aarch64.tar.gz +221067f6bcadcc2ddd59e9d34f1400e6 glibc-common-2.17-317.el7.x86_64.tar.gz +bf75a742bfe111a15ea21739deed42ae glibc-devel-2.17-317.el7.aarch64.tar.gz +838873ac97693ee9b0ad2a5ecd9bca6c glibc-devel-2.17-317.el7.x86_64.tar.gz +7406683f91ec551814bdbfa917766f7a glibc-headers-2.17-317.el7.aarch64.tar.gz +389db7442b4c145251e6ac1c152c5e78 glibc-headers-2.17-317.el7.x86_64.tar.gz |
