1 // IMPORTANT: inclusion order: always include gcjh'ed headers first, then superclass cc's, then system headers
4 #include <java/lang/Class.h>
5 #include <org/ibex/js/JS.h>
6 #include <org/ibex/util/Log.h>
7 #include <org/ibex/plat/Linux.h>
12 extern const char **_Jv_argv;
15 void org::ibex::plat::Linux::fixEnvironment() {
16 // this wreaks havoc on gdb
17 // see http://lists.debian.org/debian-glibc/2003/debian-glibc-200311/msg00647.html
18 const char* ld_assume_kernel = getenv("LD_ASSUME_KERNEL");
19 if (ld_assume_kernel == NULL || strcmp("2.4.1", ld_assume_kernel)) {
21 printf("respawning self (%s) with LD_ASSUME_KERNEL=2.4.1\n", _Jv_argv[0]);
22 setenv("LD_ASSUME_KERNEL", "2.4.1", 1);
23 result = execvp(_Jv_argv[0], (char* const*)((void*)_Jv_argv));
24 printf("execvp() failed with error code %d\n", result);