summaryrefslogtreecommitdiff
path: root/core/pacman
diff options
context:
space:
mode:
Diffstat (limited to 'core/pacman')
-rw-r--r--core/pacman/PKGBUILD32
-rw-r--r--core/pacman/makepkg.conf39
-rw-r--r--core/pacman/pacman.conf5
-rw-r--r--core/pacman/replace-i686-by-pentium4-when-architecture-is-auto.patch46
4 files changed, 79 insertions, 43 deletions
diff --git a/core/pacman/PKGBUILD b/core/pacman/PKGBUILD
index 7429bd4b..e7e5974b 100644
--- a/core/pacman/PKGBUILD
+++ b/core/pacman/PKGBUILD
@@ -1,14 +1,14 @@
-# upstream git revision: 18811ca7ee347721a700db2080a50df06a0a79fc
+# upstream git revision: 557099dcb495b55b563735a21fdc393d0fc050fb
depends+=(archlinux32-keyring)
# fail if upstream changes makepkg.conf or pacman.conf
for ((i=0; i<${#sha256sums[@]}; i++)); do
- if [ "${sha256sums[${i}]}" = '46a7fda0f2ebd2957db1c0264ed8a659df0916ba30e1353ecc70ef47d2b118ff' ]; then
- sha256sums[${i}]='0af8eda66e530096cd4ff3e64f0b1ef2af669a7fb31b85faf9e6d906c6098ba1'
+ if [ "${sha256sums[${i}]}" = '072020e34f2c55b94a9a486829a7eadab0a830ddb4d8e759b0c4e6cf1bde73a6' ]; then
+ sha256sums[${i}]='2ad58ba534fed9d728d273c7b5920a495c15cfb58b5c3864bfa023a939abc5d0'
fi
- if [ "${sha256sums[${i}]}" = '3353f363088c73f1f86a890547c0f87c7473e5caf43bbbc768c2e9a7397f2aa2' ]; then
- sha256sums[${i}]='428ceeb0d8b96ac5e4274ef098bde00916f9e1b62369eb3566eaf6f6b3ac3984'
+ if [ "${sha256sums[${i}]}" = '606e55f06c297d2b508bc4438890b229a1abaa68b0374a2d7f94c8e7be6792d7' ]; then
+ sha256sums[${i}]='fa05e6f8a83f09fc347988a8ad9dce6fad50d542b2d77fc07fd1b604309990be'
fi
done
@@ -23,8 +23,9 @@ if [ ! "${CARCH}" = "i686" ]; then
)"
fi
+# patch pacman for automatic architecture detection
source+=('replace-i686-by-pentium4-when-architecture-is-auto.patch')
-sha256sums+=('e8d5f8979c4dfab49e7ac058846f2454b865c1da451e086c23e61034fd820c19')
+sha256sums+=('6a7906bd28a57cbcff58d856ffefbbb9096a163aaff79913b4fac69d75d0028a')
eval "$(
{
@@ -37,10 +38,17 @@ eval "$(
'
)"
-# FAIL: test 600 (also 64-bit), ignore for now
-eval "$(
- declare -f check | \
- sed '
- s/make\(.*\)check/make \1 check || true/
+# not supported on i486 -fcf-protection
+# LTO currently no availavle on i486
+if [ "${CARCH}" = "i486" ]; then
+ eval "$(
+ {
+ declare -f package || \
+ printf 'package() {\n}\n'
+ } \
+ | sed '
+ $i sed -i "s/-fcf-protection//g" "$pkgdir/etc/makepkg.conf"
+ $i sed -i "s/LTOFLAGS.*/LTOFLAGS=\\\"-fno-lto\\\"/" "$pkgdir/etc/makepkg.conf"
'
-)"
+ )"
+fi
diff --git a/core/pacman/makepkg.conf b/core/pacman/makepkg.conf
index 006ece0d..12bd0a97 100644
--- a/core/pacman/makepkg.conf
+++ b/core/pacman/makepkg.conf
@@ -9,10 +9,10 @@
#
#-- The download utilities that makepkg should use to acquire sources
# Format: 'protocol::agent'
-DLAGENTS=('file::/usr/bin/curl -gqC - -o %o %u'
- 'ftp::/usr/bin/curl -gqfC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
- 'http::/usr/bin/curl -gqb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
- 'https::/usr/bin/curl -gqb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
+DLAGENTS=('file::/usr/bin/curl -qgC - -o %o %u'
+ 'ftp::/usr/bin/curl -qgfC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
+ 'http::/usr/bin/curl -qgb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
+ 'https::/usr/bin/curl -qgb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
'rsync::/usr/bin/rsync --no-motd -z %u %o'
'scp::/usr/bin/scp -C %u %o')
@@ -24,6 +24,7 @@ DLAGENTS=('file::/usr/bin/curl -gqC - -o %o %u'
#-- The package required by makepkg to download VCS sources
# Format: 'protocol::package'
VCSCLIENTS=('bzr::bzr'
+ 'fossil::fossil'
'git::git'
'hg::mercurial'
'svn::subversion')
@@ -36,26 +37,26 @@ CARCH="i686"
CHOST="i686-pc-linux-gnu"
#-- Compiler and Linker Flags
-CPPFLAGS=""
+#CPPFLAGS=""
CFLAGS="-march=i686 -mtune=generic -O2 -pipe -fno-plt -fexceptions \
- -Wp,-D_FORTIFY_SOURCE=2,-D_GLIBCXX_ASSERTIONS \
- -Wformat -Werror=format-security \
- -fstack-clash-protection"
-CXXFLAGS="$CFLAGS"
+ -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \
+ -fstack-clash-protection -fcf-protection"
+CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"
+LTOFLAGS="-flto=auto"
#RUSTFLAGS="-C opt-level=2"
#-- Make Flags: change this for DistCC/SMP systems
#MAKEFLAGS="-j2"
#-- Debugging flags
-DEBUG_CFLAGS="-g -fvar-tracking-assignments"
-DEBUG_CXXFLAGS="-g -fvar-tracking-assignments"
+DEBUG_CFLAGS="-g"
+DEBUG_CXXFLAGS="$DEBUG_CFLAGS"
#DEBUG_RUSTFLAGS="-C debuginfo=2"
#########################################################################
# BUILD ENVIRONMENT
#########################################################################
#
-# Defaults: BUILDENV=(!distcc !color !ccache check !sign)
+# Makepkg defaults: BUILDENV=(!distcc !color !ccache check !sign)
# A negated environment option will do the opposite of the comments below.
#
#-- distcc: Use the Distributed C/C++/ObjC compiler
@@ -78,7 +79,7 @@ BUILDENV=(!distcc color !ccache check !sign)
# These are default values for the options=() settings
#########################################################################
#
-# Default: OPTIONS=(!strip docs libtool staticlibs emptydirs !zipman !purge !debug)
+# Makepkg defaults: OPTIONS=(!strip docs libtool staticlibs emptydirs !zipman !purge !debug !lto)
# A negated option will do the opposite of the comments below.
#
#-- strip: Strip symbols from binaries/libraries
@@ -89,11 +90,12 @@ BUILDENV=(!distcc color !ccache check !sign)
#-- zipman: Compress manual (man and info) pages in MAN_DIRS with gzip
#-- purge: Remove files specified by PURGE_TARGETS
#-- debug: Add debugging flags as specified in DEBUG_* variables
+#-- lto: Add compile flags for building with link time optimization
#
-OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !debug)
+OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !debug !lto)
#-- File integrity checks to use. Valid: md5, sha1, sha224, sha256, sha384, sha512, b2
-INTEGRITY_CHECK=(md5)
+INTEGRITY_CHECK=(sha256)
#-- Options to be used when stripping binaries. See `man strip' for details.
STRIP_BINARIES="--strip-all"
#-- Options to be used when stripping shared libraries. See `man strip' for details.
@@ -148,3 +150,10 @@ COMPRESSLZ=(lzip -c -f)
#
PKGEXT='.pkg.tar.zst'
SRCEXT='.src.tar.gz'
+
+#########################################################################
+# OTHER
+#########################################################################
+#
+#-- Command used to run pacman as root, instead of trying sudo and su
+#PACMAN_AUTH=()
diff --git a/core/pacman/pacman.conf b/core/pacman/pacman.conf
index 7163168c..ef347ade 100644
--- a/core/pacman/pacman.conf
+++ b/core/pacman/pacman.conf
@@ -31,13 +31,14 @@ Architecture = auto
# Misc options
#UseSyslog
#Color
-#TotalDownload
+#NoProgressBar
CheckSpace
#VerbosePkgLists
+#ParallelDownloads = 5
# By default, pacman accepts packages signed by keys that its local keyring
# trusts (see pacman-key and its man page), as well as unsigned packages.
-SigLevel = Required DatabaseOptional DatabaseTrustAll
+SigLevel = Required DatabaseOptional
LocalFileSigLevel = Optional
#RemoteFileSigLevel = Required
diff --git a/core/pacman/replace-i686-by-pentium4-when-architecture-is-auto.patch b/core/pacman/replace-i686-by-pentium4-when-architecture-is-auto.patch
index 32030586..5ad0592e 100644
--- a/core/pacman/replace-i686-by-pentium4-when-architecture-is-auto.patch
+++ b/core/pacman/replace-i686-by-pentium4-when-architecture-is-auto.patch
@@ -1,24 +1,41 @@
diff --git a/src/pacman/conf.c b/src/pacman/conf.c
-index 2d8518c4..2e7fac88 100644
+index 0f0c2cfb..23744328 100644
--- a/src/pacman/conf.c
+++ b/src/pacman/conf.c
-@@ -308,6 +308,11 @@ int config_set_arch(const char *arch)
- struct utsname un;
+@@ -18,6 +18,7 @@
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include <cpuid.h>
+ #include <errno.h>
+ #include <limits.h>
+ #include <locale.h> /* setlocale */
+@@ -401,6 +402,12 @@ int config_add_architecture(char *arch)
+ char *newarch;
uname(&un);
- config->arch = strdup(un.machine);
-+ if(strcmp(config->arch, "i686") == 0) {
-+ __builtin_cpu_init();
-+ if (__builtin_cpu_supports("sse2"))
-+ config->arch = strdup("pentium4");
+ newarch = strdup(un.machine);
++ if(strcmp(newarch, "i686") == 0) {
++ unsigned int eax, ebx, ecx, edx;
++ __get_cpuid(1, &eax, &ebx, &ecx, &edx);
++ if (edx & bit_SSE2)
++ newarch = strdup("pentium4");
+ }
- } else {
- config->arch = strdup(arch);
+ free(arch);
+ arch = newarch;
}
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
-index 3bb622e6..34aace6c 100644
+index 7e810127..b5bd2a37 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
-@@ -274,8 +274,18 @@ static void setuseragent(void)
+@@ -26,6 +26,7 @@
+
+ #include <stdlib.h> /* atoi */
+ #include <stdio.h>
++#include <cpuid.h>
+ #include <ctype.h> /* isspace */
+ #include <limits.h>
+ #include <getopt.h>
+@@ -274,8 +275,19 @@ static void setuseragent(void)
int len;
uname(&un);
@@ -26,8 +43,9 @@ index 3bb622e6..34aace6c 100644
+ strncpy(machine, un.machine, sizeof machine);
+ machine[sizeof machine-1] = '\0';
+ if(strcmp(machine, "i686") == 0) {
-+ __builtin_cpu_init();
-+ if (__builtin_cpu_supports("sse2")) {
++ int eax, ebx, ecx, edx;
++ __get_cpuid(1, &eax, &ebx, &ecx, &edx);
++ if (edx & bit_SSE2) {
+ strncpy(machine, "pentium4", sizeof machine);
+ machine[sizeof machine-1] = '\0';
+ }