Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/src/pacman/conf.c
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-05-13 10:39:33 +0200
committerErich Eckner <git@eckner.net>2021-05-26 17:15:05 +0200
commitfe80ed073abc376569efb3143a24ef1fe41aec86 (patch)
tree62100ec0b0d357917d1bed40c8db0db44a981f2a /src/pacman/conf.c
parenta770ad9b975eb441fc21bc982d2938c321da0937 (diff)
change "i686" to "pentium4" if sse2 is available
Diffstat (limited to 'src/pacman/conf.c')
-rw-r--r--src/pacman/conf.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/pacman/conf.c b/src/pacman/conf.c
index 0f0c2cfb..b05c456d 100644
--- a/src/pacman/conf.c
+++ b/src/pacman/conf.c
@@ -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);
newarch = strdup(un.machine);
+ if(strcmp(newarch, "i686") == 0) {
+ unsigned int eax, ebx, ecx, edx;
+ __get_cpuid(1, &eax, &ebx, &ecx, &edx);
+ if (ecx & bit_SSE2)
+ newarch = strdup("pentium4");
+ }
free(arch);
arch = newarch;
}