Initial commit

This commit is contained in:
Your Name
2026-04-23 17:07:55 +08:00
commit b7e39e063b
16725 changed files with 1625565 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
SUMMARY = "GNU multiprecision arithmetic library"
DESCRIPTION = "GMP is a free library for arbitrary precision arithmetic, operating on signed integers, rational numbers, and floating point numbers"
HOMEPAGE = "http://gmplib.org/"
SECTION = "devel"
inherit autotools texinfo multilib_header
PACKAGECONFIG ??= ""
PACKAGECONFIG[readline] = "--with-readline=yes,--with-readline=no,readline"
ARM_INSTRUCTION_SET:armv4 = "arm"
ARM_INSTRUCTION_SET:armv5 = "arm"
@@ -0,0 +1,61 @@
From d3b9fc523fc11260ced890c35bc5c9e6391c8656 Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex.kanavin@gmail.com>
Date: Mon, 14 Dec 2015 14:19:49 +0200
Subject: [PATCH] Append the user provided flags to the auto-detected ones.
Upstream-Status: Inappropriate
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
configure.ac | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/configure.ac b/configure.ac
index 9cedfeb..87caee5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1921,8 +1921,12 @@ cclist=$cclist
EOF
-test_CFLAGS=${CFLAGS+set}
-test_CPPFLAGS=${CPPFLAGS+set}
+test_CFLAGS=
+test_CPPFLAGS=
+
+user_CFLAGS=$CFLAGS
+user_CPPFLAGS=$CPPFLAGS
+user_CXXFLAGS=$CXXFLAGS
for abi in $abilist; do
abi_last="$abi"
@@ -2353,7 +2357,7 @@ AC_SUBST(CCAS)
# The C++ compiler, if desired.
want_cxx=no
if test $enable_cxx != no; then
- test_CXXFLAGS=${CXXFLAGS+set}
+ test_CXXFLAGS=
AC_PROG_CXX
echo "CXXFLAGS chosen by autoconf: $CXXFLAGS" >&AC_FD_CC
@@ -2381,7 +2385,7 @@ if test $enable_cxx != no; then
# Automake includes $CPPFLAGS in a C++ compile, so we do the same here.
#
for cxxflags_choice in $cxxflags_list; do
- eval CXXFLAGS=\"\$cxxflags_$cxxflags_choice\"
+ eval CXXFLAGS=\"\$cxxflags_$cxxflags_choice $user_CXXFLAGS\"
GMP_PROG_CXX_WORKS($CXX $CPPFLAGS $CXXFLAGS,
[want_cxx=yes
break])
@@ -2477,6 +2481,8 @@ if test "$enable_assembly" = "no"; then
# done
fi
+CFLAGS="$CFLAGS $user_CFLAGS"
+CPPFLAGS="$CPPFLAGS $user_CPPFLAGS"
cat >&AC_FD_CC <<EOF
Decided:
--
2.6.2
@@ -0,0 +1,49 @@
From ae1a4c37417a3bbbf8ea1cab198982b0cad47e29 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 12 Aug 2016 17:08:13 +0000
Subject: [PATCH] confiure.ac: Believe the cflags from environment
In some toolchains e.g. OpenEmbedded -march options
are passed on compiler cmdline, it does not use
the expected target triplets to make these decision
during configure.
Secondly, dont set armv4 for march when no selection
is made, since it is passed from cmdline
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Upstream-Status: Inappropriate [OE-Specific]
---
configure.ac | 11 -----------
1 file changed, 11 deletions(-)
--- a/configure.ac
+++ b/configure.ac
@@ -625,17 +625,6 @@ case $host in
any_32_testlist="sizeof-void*-4"
any_64_testlist="sizeof-void*-8"
- # This is needed for clang, which is not content with flags like -mfpu=neon
- # alone.
- case $host in
- *-*-*eabi)
- gcc_cflags_fpmode="-mfloat-abi=softfp" ;;
- *-*-*eabihf)
- gcc_cflags_fpmode="-mfloat-abi=hard" ;;
- *-*-mingw*)
- limb_64=longlong ;;
- esac
-
# FIXME: We make mandatory compiler options optional here. We should
# either enforce them, or organise to strip paths as the corresponding
# options fail.
@@ -780,8 +769,6 @@ case $host in
;;
*)
path="arm"
- gcc_cflags_arch="-march=armv4"
- GMP_DEFINE_RAW(["define(<NOTHUMB>,1)"])
;;
esac
;;
@@ -0,0 +1,27 @@
CVE: CVE-2021-43618
Upstream-Status: Backport
Signed-off-by: Ross Burton <ross.burton@arm.com>
# HG changeset patch
# User Marco Bodrato <bodrato@mail.dm.unipi.it>
# Date 1634836009 -7200
# Node ID 561a9c25298e17bb01896801ff353546c6923dbd
# Parent e1fd9db13b475209a864577237ea4b9105b3e96e
mpz/inp_raw.c: Avoid bit size overflows
diff -r e1fd9db13b47 -r 561a9c25298e mpz/inp_raw.c
--- a/mpz/inp_raw.c Tue Dec 22 23:49:51 2020 +0100
+++ b/mpz/inp_raw.c Thu Oct 21 19:06:49 2021 +0200
@@ -88,8 +88,11 @@
abs_csize = ABS (csize);
+ if (UNLIKELY (abs_csize > ~(mp_bitcnt_t) 0 / 8))
+ return 0; /* Bit size overflows */
+
/* round up to a multiple of limbs */
- abs_xsize = BITS_TO_LIMBS (abs_csize*8);
+ abs_xsize = BITS_TO_LIMBS ((mp_bitcnt_t) abs_csize * 8);
if (abs_xsize != 0)
{
@@ -0,0 +1,18 @@
exec includedir should be pointing to general yocto includdir
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Index: gmp-6.1.2/Makefile.am
===================================================================
--- gmp-6.1.2.orig/Makefile.am
+++ gmp-6.1.2/Makefile.am
@@ -130,7 +130,7 @@ EXTRA_DIST += gmpxx.h
# but anyone knowledgeable enough to be playing with exec_prefix will be able
# to address that.
#
-includeexecdir = $(exec_prefix)/include
+includeexecdir = $(includedir)
include_HEADERS = $(GMPXX_HEADERS_OPTION)
nodist_includeexec_HEADERS = gmp.h
lib_LTLIBRARIES = libgmp.la $(GMPXX_LTLIBRARIES_OPTION)
@@ -0,0 +1,47 @@
require gmp.inc
LICENSE = "GPL-2.0-or-later | LGPL-3.0-or-later"
LIC_FILES_CHKSUM = "\
file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
file://COPYING.LESSERv3;md5=6a6a8e020838b23406c81b19c1d46df6 \
file://COPYINGv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
file://COPYINGv3;md5=11cc2d3ee574f9d6b7ee797bdce4d423 \
"
REVISION = ""
SRC_URI = "https://gmplib.org/download/${BPN}/${BP}${REVISION}.tar.bz2 \
file://use-includedir.patch \
file://0001-Append-the-user-provided-flags-to-the-auto-detected-.patch \
file://0001-confiure.ac-Believe-the-cflags-from-environment.patch \
file://cve-2021-43618.patch \
"
SRC_URI[md5sum] = "28971fc21cf028042d4897f02fd355ea"
SRC_URI[sha256sum] = "eae9326beb4158c386e39a356818031bd28f3124cf915f8c5b1dc4c7a36b4d7c"
acpaths = ""
EXTRA_OECONF += " --enable-cxx=detect"
EXTRA_OECONF:append:mipsarchr6 = " --disable-assembly"
PACKAGES =+ "libgmpxx"
FILES:libgmpxx = "${libdir}/libgmpxx${SOLIBS}"
do_install:append() {
oe_multilib_header gmp.h
}
do_install:prepend:class-target() {
sed -i \
-e "s|--sysroot=${STAGING_DIR_HOST}||g" \
-e "s|${DEBUG_PREFIX_MAP}||g" \
${B}/gmp.h
}
SSTATE_SCAN_FILES += "gmp.h"
# Doesn't compile in MIPS16e mode due to use of hand-written
# assembly
MIPS_INSTRUCTION_SET = "mips"
BBCLASSEXTEND = "native nativesdk"