When we are emulating a different architecture, QEMU by default emulates
a very basic processor which might not be able to emulate for example
SIMD instructions.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
return 0;
}
-static int pakfire_arch_supported_by_host(const char* name) {
+int pakfire_arch_supported_by_host(const char* name) {
if (!name) {
errno = EINVAL;
return 1;
const char* pakfire_arch_platform(const char* name);
int pakfire_arch_is_compatible(const char* name, const char* compatible_arch);
+int pakfire_arch_supported_by_host(const char* name);
char* pakfire_arch_find_interpreter(const char* name);
#endif
struct pakfire* pakfire, int flags) {
int r;
+ const char* arch = pakfire_get_arch(pakfire);
+
// Allocate a new jail
struct pakfire_jail* j = calloc(1, sizeof(*j));
if (!j)
goto ERROR;
}
+ // Enable all CPU features that CPU has to offer
+ if (!pakfire_arch_supported_by_host(arch)) {
+ r = pakfire_jail_set_env(j, "QEMU_CPU", "max");
+ if (r)
+ goto ERROR;
+ }
+
// Set container UUID
r = pakfire_jail_set_env(j, "container_uuid", pakfire_jail_uuid(j));
if (r)