1
0

Fix 32-bit ISE 10.1 on 64-bit platform.

When trying to access a cable with this combination, ISE displays the
following error: "Cable operation is not supported when running the
32-bit version of the application on a 64-bit platform."

This is fixed by additionally overloading the uname function and replacing
x86_64 by i686 in the returned struct in the 32-bit version of this library.
The 64-bit version will still correctly return x86_64.
This commit is contained in:
Michael Gernoth 2008-03-29 13:51:08 +01:00
parent 9cb54622e0
commit c42237a305

View File

@ -39,6 +39,8 @@
#include <errno.h>
#include <inttypes.h>
#include <sys/ioctl.h>
#include <sys/utsname.h>
#include <bits/wordsize.h>
#include "usb-driver.h"
#include "config.h"
@ -937,3 +939,21 @@ int access(const char *pathname, int mode) {
return (*func)(pathname, mode);
}
}
#if __WORDSIZE == 32
int uname (struct utsname *__name) {
static int (*func) (struct utsname*);
int ret;
if (!func)
func = (int (*) (struct utsname*)) dlsym(RTLD_NEXT, "uname");
ret = (*func)(__name);
if (ret == 0 && (!strcmp(__name->machine, "x86_64"))) {
strcpy(__name->machine, "i686");
}
return ret;
}
#endif