Compare commits
25 Commits
master
...
loongarch6
Author | SHA1 | Date | |
---|---|---|---|
71500529c9 | |||
e7cda0e8f4 | |||
a73b457758 | |||
58d0441101 | |||
b25632c9ca | |||
be7fea1d23 | |||
1b6ee0ceab | |||
bc28a5dc67 | |||
f3329910f4 | |||
c103bec4bb | |||
1ade77ca76 | |||
717595bbc6 | |||
0d282996f0 | |||
d62998a357 | |||
9de3efe06c | |||
9e785c2c03 | |||
3f690b308c | |||
d2646c4bea | |||
2a92904f17 | |||
e8dce540b1 | |||
087a18bcc7 | |||
3d5a2e3868 | |||
c8b0db14cf | |||
07e54665b4 | |||
2aed7a8d20 |
110
0001_glibc_makeflags.patch
Normal file
110
0001_glibc_makeflags.patch
Normal file
@ -0,0 +1,110 @@
|
||||
From: Sergei Trofimovich <slyich@gmail.com>
|
||||
Date: Tue, 13 Sep 2022 17:39:13 +0000 (-0400)
|
||||
Subject: Makerules: fix MAKEFLAGS assignment for upcoming make-4.4 [BZ# 29564]
|
||||
X-Git-Tag: 2.35.0.6.491f2e-alt2~1^2~1
|
||||
X-Git-Url: http://git.altlinux.org/gears/g/glibc.git?p=glibc.git;a=commitdiff_plain;h=49ad8fd10963d42811a1dce28e2e77876e3054b0
|
||||
|
||||
Makerules: fix MAKEFLAGS assignment for upcoming make-4.4 [BZ# 29564]
|
||||
|
||||
make-4.4 will add long flags to MAKEFLAGS variable:
|
||||
|
||||
* WARNING: Backward-incompatibility!
|
||||
Previously only simple (one-letter) options were added to the MAKEFLAGS
|
||||
variable that was visible while parsing makefiles. Now, all options
|
||||
are available in MAKEFLAGS.
|
||||
|
||||
This causes locale builds to fail when long options are used:
|
||||
|
||||
$ make --shuffle
|
||||
...
|
||||
make -C localedata install-locales
|
||||
make: invalid shuffle mode: '1662724426r'
|
||||
|
||||
The change fixes it by passing eash option via whitespace and dashes.
|
||||
That way option is appended to both single-word form and whitespace
|
||||
separated form.
|
||||
|
||||
While at it fixed --silent mode detection in $(MAKEFLAGS) by filtering
|
||||
out --long-options. Otherwise options like --shuffle flag enable silent
|
||||
mode unintentionally. $(silent-make) variable consolidates the checks.
|
||||
|
||||
Resolves: BZ# 29564
|
||||
|
||||
CC: Paul Smith <psmith@gnu.org>
|
||||
CC: Siddhesh Poyarekar <siddhesh@gotplt.org>
|
||||
Signed-off-by: Sergei Trofimovich <slyich@gmail.com>
|
||||
Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
|
||||
(cherry picked from commit 2d7ed98add14f75041499ac189696c9bd3d757fe)
|
||||
---
|
||||
|
||||
diff --git a/Makeconfig b/Makeconfig
|
||||
index 46e008b..d615c4c 100644
|
||||
--- a/Makeconfig
|
||||
+++ b/Makeconfig
|
||||
@@ -43,6 +43,22 @@ else
|
||||
$(error objdir must be defined by the build-directory Makefile)
|
||||
endif
|
||||
|
||||
+# Did we request 'make -s' run? "yes" or "no".
|
||||
+# Starting from make-4.4 MAKEFLAGS now contains long
|
||||
+# options like '--shuffle'. To detect presence of 's'
|
||||
+# we pick first word with short options. Long options
|
||||
+# are guaranteed to come after whitespace. We use '-'
|
||||
+# prefix to always have a word before long options
|
||||
+# even if no short options were passed.
|
||||
+# Typical MAKEFLAGS values to watch for:
|
||||
+# "rs --shuffle=42" (silent)
|
||||
+# " --shuffle" (not silent)
|
||||
+ifeq ($(findstring s, $(firstword -$(MAKEFLAGS))),)
|
||||
+silent-make := no
|
||||
+else
|
||||
+silent-make := yes
|
||||
+endif
|
||||
+
|
||||
# Root of the sysdeps tree.
|
||||
sysdep_dir := $(..)sysdeps
|
||||
export sysdep_dir := $(sysdep_dir)
|
||||
@@ -920,7 +936,7 @@ endif
|
||||
# umpteen zillion filenames along with it (we use `...' instead)
|
||||
# but we don't want this echoing done when the user has said
|
||||
# he doesn't want to see commands echoed by using -s.
|
||||
-ifneq "$(findstring s,$(MAKEFLAGS))" "" # if -s
|
||||
+ifeq ($(silent-make),yes) # if -s
|
||||
+cmdecho := echo >/dev/null
|
||||
else # not -s
|
||||
+cmdecho := echo
|
||||
diff --git a/Makerules b/Makerules
|
||||
index 12f2ed7..301c501 100644
|
||||
--- a/Makerules
|
||||
+++ b/Makerules
|
||||
@@ -802,7 +802,7 @@ endif
|
||||
# Maximize efficiency by minimizing the number of rules.
|
||||
.SUFFIXES: # Clear the suffix list. We don't use suffix rules.
|
||||
# Don't define any builtin rules.
|
||||
-MAKEFLAGS := $(MAKEFLAGS)r
|
||||
+MAKEFLAGS := $(MAKEFLAGS) -r
|
||||
|
||||
# Generic rule for making directories.
|
||||
%/:
|
||||
@@ -819,7 +819,7 @@ MAKEFLAGS := $(MAKEFLAGS)r
|
||||
.PRECIOUS: $(foreach l,$(libtypes),$(patsubst %,$(common-objpfx)$l,c))
|
||||
|
||||
# Use the verbose option of ar and tar when not running silently.
|
||||
-ifeq "$(findstring s,$(MAKEFLAGS))" "" # if not -s
|
||||
+ifeq ($(silent-make),no) # if not -s
|
||||
verbose := v
|
||||
else # -s
|
||||
verbose :=
|
||||
diff --git a/elf/rtld-Rules b/elf/rtld-Rules
|
||||
index ca00dd1..3c5e273 100644
|
||||
--- a/elf/rtld-Rules
|
||||
+++ b/elf/rtld-Rules
|
||||
@@ -52,7 +52,7 @@ $(objpfx)rtld-libc.a: $(foreach dir,$(rtld-subdirs),\
|
||||
mv -f $@T $@
|
||||
|
||||
# Use the verbose option of ar and tar when not running silently.
|
||||
-ifeq "$(findstring s,$(MAKEFLAGS))" "" # if not -s
|
||||
+ifeq ($(silent-make),no) # if not -s
|
||||
verbose := v
|
||||
else # -s
|
||||
verbose :=
|
@ -1,18 +1,31 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
set -x
|
||||
MYDIR="${0%/*}"
|
||||
|
||||
TARGET=aarch64-linux-gnu
|
||||
ARCH=aarch64
|
||||
LINUX_ARCH=arm64
|
||||
QEMU_ARCH=aarch64
|
||||
TARGET='loongarch64-linux-gnu'
|
||||
ARCH=loongarch64
|
||||
LINUX_ARCH=loongarch
|
||||
QEMU_ARCH=loongarch64
|
||||
TARGET_LD_LINUX='/lib64/ld-linux-loongarch-lp64d.so.1'
|
||||
TARGET_LIBDIR=lib64
|
||||
|
||||
unset NIL
|
||||
|
||||
KERNEL_SOURCE="`find /usr/src/kernel/sources -type f -name 'kernel-source-*.tar'`"
|
||||
BINUTILS_SOURCE="`find /usr/src/binutils-source -type f -name 'binutils-*.tar'`"
|
||||
GCC_SOURCE="`find /usr/src/gcc-source -type f -name 'gcc-*.tar'`"
|
||||
GLIBC_SOURCE="`find /usr/src/glibc-source -type f -name 'glibc-*.tar'`"
|
||||
cd "$MYDIR"
|
||||
MYDIR=`pwd`
|
||||
BUILDDIR="`pwd`/build"
|
||||
SRCDIR="`pwd`/src"
|
||||
|
||||
KERNEL_SOURCE="`find $(pwd) -maxdepth 1 -type f -name 'kernel-source-*.tar*'`"
|
||||
BINUTILS_SOURCE="`find $(pwd) -maxdepth 1 -type f -name 'binutils-*.tar*'`"
|
||||
GCC_SOURCE="`find $(pwd) -maxdepth 1 -type f -name 'gcc-*.tar*'`"
|
||||
GLIBC_SOURCE="`find $(pwd) -maxdepth 1 -type f -name 'glibc-*.tar*'`"
|
||||
GCC_PATCHES=''
|
||||
gcc_patches_dir="`pwd`/patches/gcc"
|
||||
if [ -d "$gcc_patches_dir" ]; then
|
||||
GCC_PATCHES="`find $gcc_patches_dir -maxdepth 1 -type f -name '*.patch'`"
|
||||
fi
|
||||
|
||||
getversion() {
|
||||
local fname="${1##*/}"
|
||||
@ -21,11 +34,21 @@ getversion() {
|
||||
echo "$ver"
|
||||
}
|
||||
|
||||
unpack_to() {
|
||||
local tarball="$1"
|
||||
local destdir="$2"
|
||||
local name="${tarball##*/}"
|
||||
name="${name%%-*}"
|
||||
destdir="${destdir}/${name}"
|
||||
|
||||
mkdir -p "$destdir"
|
||||
tar --strip-components=1 -x -a -f "$tarball" -C "$destdir"
|
||||
}
|
||||
|
||||
GCC_VERSION=`getversion $GCC_SOURCE`
|
||||
GCC_MAJOR_VERSION="${GCC_VERSION%%.*}"
|
||||
GCC_PREREQS="gmp-6.2.1.tar.bz2 mpc-1.2.1.tar.gz mpfr-4.1.0.tar.bz2 isl-0.24.tar.bz2"
|
||||
|
||||
BUILDDIR="`pwd`/build"
|
||||
SRCDIR="`pwd`/src"
|
||||
INSTALLDIR="`pwd`/inst/altcross-gcc-${GCC_VERSION}"
|
||||
BOOTSTRAP_INSTALLDIR="`pwd`/stage1/altcross-gcc-${GCC_VERSION}"
|
||||
SYSROOT=/$TARGET/libc
|
||||
@ -35,14 +58,18 @@ mkdir -p -m755 "$SRCDIR"
|
||||
cd "$SRCDIR"
|
||||
|
||||
mkdir -p -m755 linux binutils gcc glibc
|
||||
tar -x --strip-components=1 -f "$KERNEL_SOURCE" -C linux
|
||||
tar -x --strip-components=1 -f "$BINUTILS_SOURCE" -C binutils
|
||||
tar -x --strip-components=1 -f "$GCC_SOURCE" -C gcc
|
||||
tar -x --strip-components=1 -f "$GLIBC_SOURCE" -C glibc
|
||||
tar -x -a --strip-components=1 -f "$KERNEL_SOURCE" -C linux
|
||||
tar -x -a --strip-components=1 -f "$BINUTILS_SOURCE" -C binutils
|
||||
tar -x -a --strip-components=1 -f "$GCC_SOURCE" -C gcc
|
||||
tar -x -a --strip-components=1 -f "$GLIBC_SOURCE" -C glibc
|
||||
|
||||
cd "gcc"
|
||||
sed -i contrib/download_prerequisites -e '/base_url=/s/ftp/http/'
|
||||
./contrib/download_prerequisites
|
||||
for p in $GCC_PATCHES; do
|
||||
patch -p1 -i $p
|
||||
done
|
||||
for tarball in $GCC_PREREQS; do
|
||||
unpack_to "$MYDIR/$tarball" "."
|
||||
done
|
||||
|
||||
mkdir -p -m755 "$INSTALLDIR/bin" "$BOOTSTRAP_INSTALLDIR/bin"
|
||||
save_PATH="$PATH"
|
||||
@ -65,7 +92,10 @@ cd "$BUILDDIR/obj_binutils"
|
||||
--prefix= \
|
||||
--with-sysroot="$SYSROOT" \
|
||||
--with-build-sysroot="$SYSROOTDIR" \
|
||||
--disable-nls \
|
||||
--disable-multilib \
|
||||
--disable-gdb \
|
||||
--disable-werror \
|
||||
${NIL}
|
||||
|
||||
make -j$(nproc)
|
||||
@ -90,6 +120,8 @@ cd "$BUILDDIR/obj_gcc_bootstrap"
|
||||
--disable-libvtv \
|
||||
--disable-libatomic \
|
||||
--disable-libcilkrts \
|
||||
--disable-nls \
|
||||
--disable-werror \
|
||||
--with-newlib \
|
||||
--without-headers \
|
||||
--with-sysroot="$SYSROOT" \
|
||||
@ -124,6 +156,7 @@ cd "$BUILDDIR/obj_glibc"
|
||||
--with-lib="$SYSROOTDIR"/usr/lib \
|
||||
--disable-multilib \
|
||||
--disable-crypt \
|
||||
--disable-werror \
|
||||
libc_cv_forced_unwind=yes \
|
||||
${NIL}
|
||||
|
||||
@ -149,6 +182,8 @@ cd "$BUILDDIR/obj_gcc"
|
||||
--with-gcc-major-version-only \
|
||||
--disable-libsanitizer \
|
||||
--disable-multilib \
|
||||
--disable-nls \
|
||||
--disable-werror \
|
||||
${NIL}
|
||||
|
||||
make -j$(nproc)
|
||||
@ -167,10 +202,12 @@ sed -e "s; objcopy ; ../../../../bin/${TARGET}-objcopy ;" -i $BUILDDIR/specs
|
||||
mv $BUILDDIR/specs "$INSTALLDIR/lib/gcc/$TARGET/${GCC_MAJOR_VERSION}/"
|
||||
|
||||
# relocate libgcc_s
|
||||
mv $INSTALLDIR/lib/gcc/$TARGET/lib64/libgcc_s.so* "$INSTALLDIR/lib/gcc/$TARGET/${GCC_MAJOR_VERSION}/"
|
||||
rmdir "$INSTALLDIR/lib/gcc/$TARGET/lib64"
|
||||
|
||||
if [ -d "$INSTALLDIR/lib/gcc/$TARGET/lib64" ]; then
|
||||
mv $INSTALLDIR/lib/gcc/$TARGET/lib64/libgcc_s.so* "$INSTALLDIR/lib/gcc/$TARGET/${GCC_MAJOR_VERSION}/"
|
||||
rmdir "$INSTALLDIR/lib/gcc/$TARGET/lib64"
|
||||
fi
|
||||
|
||||
cd "$MYDIR"
|
||||
$INSTALLDIR/bin/${TARGET}-gcc -o ${BUILDDIR}/hello_c hello.c || exit 2
|
||||
$INSTALLDIR/bin/${TARGET}-g++ -o ${BUILDDIR}/hello_cpp hello.cpp || exit 3
|
||||
$INSTALLDIR/bin/${TARGET}-gcc -o ${BUILDDIR}/bye_asm -static -nostdlib bye-${LINUX_ARCH}.S || exit 11
|
||||
|
BIN
binutils-2.40.tar.xz
Normal file
BIN
binutils-2.40.tar.xz
Normal file
Binary file not shown.
20
bye-loongarch.S
Normal file
20
bye-loongarch.S
Normal file
@ -0,0 +1,20 @@
|
||||
#include <sys/syscall.h>
|
||||
|
||||
.data
|
||||
message: .asciz "bye-bye ...\n"
|
||||
|
||||
.text
|
||||
.global _start
|
||||
_start:
|
||||
li.w $a7, __NR_write
|
||||
li.w $a0, 1 # stdout file descriptor
|
||||
la $a1, message
|
||||
li.w $a2, 12 # message length
|
||||
syscall 0x0
|
||||
|
||||
li.w $a7, __NR_exit
|
||||
li.w $a0, 0
|
||||
syscall 0x0
|
||||
|
||||
.section .note.GNU-stack,"",@progbits
|
||||
|
@ -3,8 +3,7 @@
|
||||
# %%define target_arch arm
|
||||
# %%define target_arch mipsel
|
||||
# %%define target_arch riscv64
|
||||
%define target_arch @targetarch@
|
||||
|
||||
%define target_arch loongarch64
|
||||
|
||||
%if "%target_arch" == "aarch64"
|
||||
%define target_kernel arm64
|
||||
@ -12,6 +11,7 @@
|
||||
%define target_ld_linux /lib64/ld-linux-aarch64.so.1
|
||||
%define target_libdir lib64
|
||||
%define target_has_itm 1
|
||||
%define target_has_gold 1
|
||||
%endif
|
||||
|
||||
%if "%target_arch" == "arm"
|
||||
@ -20,6 +20,7 @@
|
||||
%define target_ld_linux /lib/ld-linux-armhf.so.3
|
||||
%define target_libdir lib
|
||||
%define target_has_itm 1
|
||||
%define target_has_gold 1
|
||||
# armhf: use the same arch/fp instruction set as the native compiler
|
||||
%define arm_arch armv7-a
|
||||
%define arm_fp_isa vfpv3-d16
|
||||
@ -31,6 +32,7 @@
|
||||
%define target_qemu_arch mipsel
|
||||
%define target_ld_linux /lib/ld.so.1
|
||||
%define target_libdir lib
|
||||
%define target_has_gold 1
|
||||
%endif
|
||||
|
||||
|
||||
@ -46,6 +48,7 @@
|
||||
%define target_qemu_arch loongarch64
|
||||
%define target_ld_linux /lib64/ld-linux-loongarch-lp64d.so.1
|
||||
%define target_libdir lib64
|
||||
%define target_has_itm 1
|
||||
%endif
|
||||
|
||||
%if "%target_arch" != "arm"
|
||||
@ -59,34 +62,40 @@
|
||||
%brp_strip_none %sysroot/* %prefix/lib/gcc/*.a %prefix/lib/gcc/*.o
|
||||
|
||||
Name: cross-toolchain-%target
|
||||
Version: 20220605
|
||||
Version: 20230202
|
||||
Release: alt1
|
||||
Packager: Alexey Sheplyakov <asheplyakov@altlinux.org>
|
||||
Summary: GCC cross-toolchain for %target
|
||||
License: LGPL-2.1-or-later and LGPL-3.0-or-later and GPL-2.0-or-later and GPL-3.0-or-later and GPL-3.0-or-later with GCC-exception-3.1
|
||||
Group: Development/C
|
||||
|
||||
ExclusiveArch: x86_64
|
||||
|
||||
%define gcc_version %{get_version gcc-source}
|
||||
%define gcc_version 13.0.0.20230128.gfe4608efc15
|
||||
%define gcc_branch %(v=%gcc_version; v=${v%%%%.*}; echo $v)
|
||||
%define binutils_version %{get_version binutils-source}
|
||||
%define glibc_version %{get_version glibc-source}
|
||||
%define binutils_version 2.40
|
||||
%define glibc_version 2.36.20221009
|
||||
%if "%target_arch" == "loongarch64"
|
||||
%define kernel_version 6.0
|
||||
%else
|
||||
%define kernel_version 5.10
|
||||
%endif
|
||||
|
||||
Source0: gcc-13.0.0-20230128-gfe4608efc15.tar
|
||||
Source1: binutils-2.40.tar
|
||||
Source2: glibc-2.36-20221009.tar
|
||||
Source3: kernel-source-6.1.0.tar
|
||||
Source4: gmp-6.2.1.tar
|
||||
Source5: isl-0.24.tar
|
||||
Source6: mpc-1.2.1.tar
|
||||
Source7: mpfr-4.1.0.tar
|
||||
|
||||
Patch0: 0001_glibc_makeflags.patch
|
||||
|
||||
BuildPreReq: gcc-c++
|
||||
BuildPreReq: libmpc-devel libmpfr-devel libgmp-devel zlib-devel
|
||||
BuildPreReq: coreutils flex bison makeinfo perl-Pod-Parser findutils
|
||||
# Linux' headers_install uses rsync
|
||||
BuildPreReq: rsync
|
||||
BuildRequires(pre): gcc-source
|
||||
BuildRequires(pre): binutils-source
|
||||
BuildRequires(pre): glibc-source
|
||||
BuildPreReq: kernel-source-%kernel_version
|
||||
BuildRequires: /usr/bin/qemu-%target_qemu_arch-static
|
||||
BuildRequires: python3
|
||||
|
||||
@ -100,19 +109,30 @@ Version: %gcc_version
|
||||
Summary: %target_arch-targeted GCC cross-compiler
|
||||
Group: Development/C
|
||||
Requires: gcc-%target-static = %gcc_version
|
||||
Requires: cross-gcc-libs-%target = %gcc_version
|
||||
Requires: binutils-%target = %binutils_version
|
||||
Requires: cross-glibc-%target_arch = %glibc_version
|
||||
|
||||
%description -n gcc-%target
|
||||
%target_arch-targeted GCC cross-compiler
|
||||
|
||||
%package -n cross-gcc-libs-%target
|
||||
Version: %gcc_version
|
||||
Summary: %target_arch-targeted GCC cross-compiler, target libraries
|
||||
Group: Development/C
|
||||
BuildArch: noarch
|
||||
|
||||
%description -n cross-gcc-libs-%target
|
||||
%target_arch-targeted GCC cross-compiler, shared libraries for target
|
||||
|
||||
%package -n gcc-%target-static
|
||||
Version: %gcc_version
|
||||
Summary: %target_arch-targeted GCC cross-compiler, static libraries
|
||||
Group: Development/C
|
||||
BuildArch: noarch
|
||||
|
||||
%description -n gcc-%target-static
|
||||
%target_arch-targeted GCC cross-compiler, static libraries
|
||||
%target_arch-targeted GCC cross-compiler, static libraries for target
|
||||
|
||||
%package -n binutils-%target
|
||||
Version: %binutils_version
|
||||
@ -145,10 +165,19 @@ static glibc for %target_arch. Should be used for cross-compilation only
|
||||
%setup -cT
|
||||
mkdir -p -m755 linux binutils gcc glibc
|
||||
|
||||
find /usr/src/gcc-source -type f -name 'gcc-*.tar' | xargs -I {} -n1 tar -x --strip-components=1 -f {} -C gcc
|
||||
find /usr/src/binutils-source -type f -name 'binutils-*.tar' | xargs -I {} -n1 tar -x --strip-components=1 -f {} -C binutils
|
||||
find /usr/src/kernel/sources -type f -name 'kernel-source-*.tar' | xargs -I {} -n1 tar -x --strip-components=1 -f {} -C linux
|
||||
find /usr/src/glibc-source -type f -name 'glibc-*.tar' | xargs -I {} -n1 tar -x --strip-components=1 -f {} -C glibc
|
||||
tar -x --strip-components=1 -f %SOURCE0 -C gcc
|
||||
tar -x --strip-components=1 -f %SOURCE1 -C binutils
|
||||
tar -x --strip-components=1 -f %SOURCE2 -C glibc
|
||||
tar -x --strip-components=1 -f %SOURCE3 -C linux
|
||||
|
||||
mkdir -p -m755 gcc/gmp gcc/mpc gcc/mpfr gcc/isl
|
||||
tar -x --strip-components=1 -f %SOURCE4 -C gcc/gmp
|
||||
tar -x --strip-components=1 -f %SOURCE5 -C gcc/isl
|
||||
tar -x --strip-components=1 -f %SOURCE6 -C gcc/mpc
|
||||
tar -x --strip-components=1 -f %SOURCE7 -C gcc/mpfr
|
||||
|
||||
# glibc makeflags + make 4.4 hiccup
|
||||
patch -d glibc -p1 -i %PATCH0
|
||||
|
||||
rm -rf stage
|
||||
|
||||
@ -161,7 +190,11 @@ mkdir -p obj_glibc
|
||||
mkdir -p -m755 stage%prefix/bin
|
||||
mkdir -p -m755 stage1%prefix/bin
|
||||
save_PATH="$PATH"
|
||||
export PATH=`pwd`/stage1%prefix/bin:$PATH
|
||||
if [ -d "/usr/lib/ccache" ]; then
|
||||
export PATH=`pwd`/stage1%prefix/bin:/usr/lib/ccache:$PATH
|
||||
else
|
||||
export PATH=`pwd`/stage1%prefix/bin:$PATH
|
||||
fi
|
||||
stagedir=`pwd`/stage
|
||||
stage1dir=`pwd`/stage1
|
||||
|
||||
@ -193,9 +226,10 @@ cd obj_binutils
|
||||
--disable-nls \
|
||||
--with-sysroot=%sysroot \
|
||||
--with-build-sysroot=${stagedir}%sysroot \
|
||||
--with-system-zlib \
|
||||
--enable-plugins \
|
||||
%if 0%{?target_has_gold}
|
||||
--enable-gold=yes \
|
||||
%endif
|
||||
--enable-ld=default \
|
||||
%if "%target_arch" != "mipsel"
|
||||
--enable-64-bit-bfd \
|
||||
@ -244,7 +278,6 @@ cd ../obj_gcc_bootstrap
|
||||
--disable-libcilkrts \
|
||||
--enable-version-specific-runtime-libs \
|
||||
--with-gcc-major-version-only \
|
||||
--with-system-zlib \
|
||||
%if "%target_arch" == "mipsel"
|
||||
--with-arch-32=mips32r2 \
|
||||
--with-fp-32=xx \
|
||||
@ -281,6 +314,9 @@ cd ../obj_glibc
|
||||
--with-lib=${stagedir}%sysroot/usr/lib \
|
||||
--disable-multilib \
|
||||
--disable-crypt \
|
||||
%if "%target_arch" == "loongarch64"
|
||||
--disable-werror \
|
||||
%endif
|
||||
libc_cv_forced_unwind=yes \
|
||||
%nil
|
||||
|
||||
@ -319,7 +355,6 @@ cd ../obj_gcc
|
||||
--enable-version-specific-runtime-libs \
|
||||
--disable-nls \
|
||||
--disable-libsanitizer \
|
||||
--with-system-zlib \
|
||||
%if "%target_arch" == "mipsel"
|
||||
--with-arch-32=mips32r2 \
|
||||
--with-fp-32=xx \
|
||||
@ -416,8 +451,10 @@ rm -rf %buildroot%prefix/share/info
|
||||
rm -rf %buildroot%prefix/share/man/man7
|
||||
# python pretty-printers conflict with native compiler
|
||||
rm -rf %buildroot%prefix/share/gcc-%gcc_branch/python
|
||||
# conficts with the native compiler and is not particularly useful
|
||||
# conflicts with the native compiler and is not particularly useful
|
||||
rm -f %buildroot%prefix/%_lib/libcc1.so*
|
||||
# conflicts with the native bfd and is not particularly useful
|
||||
rm -rf %buildroot%prefix/lib/bfd-plugins
|
||||
# Useless for Linux targets
|
||||
rm -f %buildroot%_man1dir/%target-windmc*
|
||||
rm -f %buildroot%_man1dir/%target-windres*
|
||||
@ -573,6 +610,7 @@ _start:
|
||||
|
||||
.section .note.GNU-stack,"",@progbits
|
||||
EOF
|
||||
%endif
|
||||
|
||||
env PATH=%buildroot%prefix/bin:$PATH \
|
||||
%buildroot%prefix/bin/%target-gcc -static -nostdlib -o bye_asm bye.S || exit 11
|
||||
@ -589,12 +627,28 @@ qemu-%target_qemu_arch-static ./bye_asm || exit 13
|
||||
%prefix/libexec/gcc/%target/*
|
||||
# avoid 'static library packaging violation' "error"
|
||||
%exclude %prefix/lib/gcc/%target/%gcc_branch/libatomic.a
|
||||
%exclude %prefix/lib/gcc/%target/%gcc_branch/libgcc.a
|
||||
%exclude %prefix/lib/gcc/%target/%gcc_branch/libgcc_eh.a
|
||||
%exclude %prefix/lib/gcc/%target/%gcc_branch/libgcov.a
|
||||
%exclude %prefix/lib/gcc/%target/%gcc_branch/libgomp.a
|
||||
%if 0%{?target_has_itm}
|
||||
%exclude %prefix/lib/gcc/%target/%gcc_branch/libitm.a
|
||||
%endif
|
||||
%exclude %prefix/lib/gcc/%target/%gcc_branch/libssp.a
|
||||
%exclude %prefix/lib/gcc/%target/%gcc_branch/libssp_nonshared.a
|
||||
%exclude %prefix/lib/gcc/%target/%gcc_branch/libstdc++.a
|
||||
%exclude %prefix/lib/gcc/%target/%gcc_branch/libstdc++fs.a
|
||||
%exclude %prefix/lib/gcc/%target/%gcc_branch/libsupc++.a
|
||||
# avoid 'NEW bad_elf_symbols detected' "error"
|
||||
%exclude %prefix/lib/gcc/%target/%gcc_branch/crt*.o
|
||||
%exclude %prefix/lib/gcc/%target/%gcc_branch/libatomic.so*
|
||||
%exclude %prefix/lib/gcc/%target/%gcc_branch/libgcc_s.so*
|
||||
%exclude %prefix/lib/gcc/%target/%gcc_branch/libgomp.so*
|
||||
%if 0%{?target_has_itm}
|
||||
%exclude %prefix/lib/gcc/%target/%gcc_branch/libitm.so*
|
||||
%endif
|
||||
%exclude %prefix/lib/gcc/%target/%gcc_branch/libssp.so*
|
||||
%exclude %prefix/lib/gcc/%target/%gcc_branch/libstdc++.so*
|
||||
# binunitls
|
||||
%exclude %prefix/libexec/gcc/%target/bin/*
|
||||
%exclude %prefix/libexec/gcc/%target/lib/*
|
||||
@ -606,12 +660,29 @@ qemu-%target_qemu_arch-static ./bye_asm || exit 13
|
||||
|
||||
%files -n gcc-%target-static
|
||||
%prefix/lib/gcc/%target/%gcc_branch/libatomic.a
|
||||
%prefix/lib/gcc/%target/%gcc_branch/libgcc.a
|
||||
%prefix/lib/gcc/%target/%gcc_branch/libgcc_eh.a
|
||||
%prefix/lib/gcc/%target/%gcc_branch/libgcov.a
|
||||
%prefix/lib/gcc/%target/%gcc_branch/libgomp.a
|
||||
%if 0%{?target_has_itm}
|
||||
%prefix/lib/gcc/%target/%gcc_branch/libitm.a
|
||||
%endif
|
||||
%prefix/lib/gcc/%target/%gcc_branch/libssp.a
|
||||
%prefix/lib/gcc/%target/%gcc_branch/libssp_nonshared.a
|
||||
%prefix/lib/gcc/%target/%gcc_branch/libstdc++.a
|
||||
%prefix/lib/gcc/%target/%gcc_branch/libstdc++fs.a
|
||||
%prefix/lib/gcc/%target/%gcc_branch/libsupc++.a
|
||||
|
||||
%files -n cross-gcc-libs-%target
|
||||
%prefix/lib/gcc/%target/%gcc_branch/crt*.o
|
||||
%prefix/lib/gcc/%target/%gcc_branch/libatomic.so*
|
||||
%prefix/lib/gcc/%target/%gcc_branch/libgcc_s.so*
|
||||
%prefix/lib/gcc/%target/%gcc_branch/libgomp.so*
|
||||
%if 0%{?target_has_itm}
|
||||
%prefix/lib/gcc/%target/%gcc_branch/libitm.so*
|
||||
%endif
|
||||
%prefix/lib/gcc/%target/%gcc_branch/libssp.so*
|
||||
%prefix/lib/gcc/%target/%gcc_branch/libstdc++.so*
|
||||
|
||||
%files -n cross-glibc-%target_arch
|
||||
%sysroot/usr/include/*
|
||||
@ -627,7 +698,9 @@ qemu-%target_qemu_arch-static ./bye_asm || exit 13
|
||||
%sysroot/usr/lib
|
||||
%endif
|
||||
%exclude %sysroot/usr/%target_libdir/libBrokenLocale.a
|
||||
%if %target_arch != "loongarch64"
|
||||
%exclude %sysroot/usr/%target_libdir/libanl.a
|
||||
%endif
|
||||
%exclude %sysroot/usr/%target_libdir/libdl.a
|
||||
%exclude %sysroot/usr/%target_libdir/libm.a
|
||||
%exclude %sysroot/usr/%target_libdir/libpthread.a
|
||||
@ -637,7 +710,9 @@ qemu-%target_qemu_arch-static ./bye_asm || exit 13
|
||||
|
||||
%files -n cross-glibc-static-%target_arch
|
||||
%sysroot/usr/%target_libdir/libBrokenLocale.a
|
||||
%if %target_arch != "loongarch64"
|
||||
%sysroot/usr/%target_libdir/libanl.a
|
||||
%endif
|
||||
%sysroot/usr/%target_libdir/libdl.a
|
||||
%sysroot/usr/%target_libdir/libm.a
|
||||
%sysroot/usr/%target_libdir/libpthread.a
|
||||
@ -650,14 +725,14 @@ qemu-%target_qemu_arch-static ./bye_asm || exit 13
|
||||
%_bindir/%target-ar
|
||||
%_bindir/%target-as
|
||||
%_bindir/%target-c++filt
|
||||
%if "%target_arch" != "riscv64"
|
||||
%if 0%{?target_has_gold}
|
||||
%_bindir/%target-dwp
|
||||
%endif
|
||||
%_bindir/%target-elfedit
|
||||
%_bindir/%target-gprof
|
||||
%_bindir/%target-ld
|
||||
%_bindir/%target-ld.bfd
|
||||
%if "%target_arch" != "riscv64"
|
||||
%if 0%{?target_has_gold}
|
||||
%_bindir/%target-ld.gold
|
||||
%endif
|
||||
%_bindir/%target-nm
|
||||
@ -690,6 +765,13 @@ qemu-%target_qemu_arch-static ./bye_asm || exit 13
|
||||
|
||||
|
||||
%changelog
|
||||
* Thu Feb 02 2023 Alexey Sheplyakov <asheplyakov@altlinux.org> 20230202-alt1
|
||||
- Moved GCC target libraries to a noarch subpackage to avoid spurious
|
||||
'bad ELF symbols' errors.
|
||||
|
||||
* Mon Jan 30 2023 Alexey Sheplyakov <asheplyakov@altlinux.org> 20230130-alt1
|
||||
- Added loongarch64 cross-toolchain
|
||||
|
||||
* Sun Jun 05 2022 Alexey Sheplyakov <asheplyakov@altlinux.org> 20220605-alt1
|
||||
- Use slow 2-stage bootstrap to avoid a build failure with GCC 12
|
||||
|
||||
|
BIN
gcc-13.0.0-20230128-gfe4608efc15.tar.xz
Normal file
BIN
gcc-13.0.0-20230128-gfe4608efc15.tar.xz
Normal file
Binary file not shown.
BIN
glibc-2.36-20221009.tar.xz
Normal file
BIN
glibc-2.36-20221009.tar.xz
Normal file
Binary file not shown.
BIN
gmp-6.2.1.tar.bz2
Normal file
BIN
gmp-6.2.1.tar.bz2
Normal file
Binary file not shown.
BIN
isl-0.24.tar.bz2
Normal file
BIN
isl-0.24.tar.bz2
Normal file
Binary file not shown.
BIN
kernel-source-6.1.0.tar.xz
Normal file
BIN
kernel-source-6.1.0.tar.xz
Normal file
Binary file not shown.
BIN
mpc-1.2.1.tar.gz
Normal file
BIN
mpc-1.2.1.tar.gz
Normal file
Binary file not shown.
BIN
mpfr-4.1.0.tar.bz2
Normal file
BIN
mpfr-4.1.0.tar.bz2
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user