Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-05-13 10:39:33 +0200
committerErich Eckner <git@eckner.net>2020-01-29 11:00:31 +0100
commitd9d3c1e8515e5fd8713f3da62a6857c35e31ea83 (patch)
tree465f6caed4fa81625501a1af6811b43b29778906
parentb8e75428770d01ebf7ebc3fa81518687cd779303 (diff)
change "i686" to "pentium4" if sse2 is available
-rw-r--r--src/pacman/conf.c5
-rw-r--r--src/pacman/pacman.c9
2 files changed, 13 insertions, 1 deletions
diff --git a/src/pacman/conf.c b/src/pacman/conf.c
index fe6d6971..ac455aac 100644
--- a/src/pacman/conf.c
+++ b/src/pacman/conf.c
@@ -393,6 +393,11 @@ int config_set_arch(const char *arch)
struct utsname un;
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");
+ }
} else {
config->arch = strdup(arch);
}
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index a9b64370..368bd56b 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -272,8 +272,15 @@ static void setuseragent(void)
int len;
uname(&un);
+ char machine[8];
+ strncpy(machine, un.machine, 8);
+ if(strcmp(machine, "i686") == 0) {
+ __builtin_cpu_init();
+ if (__builtin_cpu_supports("sse2"))
+ strncpy(machine, "pentium4", 8);
+ }
len = snprintf(agent, 100, "pacman/%s (%s %s) libalpm/%s",
- PACKAGE_VERSION, un.sysname, un.machine, alpm_version());
+ PACKAGE_VERSION, un.sysname, machine, alpm_version());
if(len >= 100) {
pm_printf(ALPM_LOG_WARNING, _("HTTP_USER_AGENT truncated\n"));
}