1 // Copyright 2000-2005 the Contributors, as shown in the revision logs.
2 // Licensed under the GNU General Public License version 2 ("the License").
3 // You may not use this file except in compliance with the License.
5 // IMPORTANT: inclusion order: always include gcjh'ed headers first, then superclass cc's, then system headers
8 #include <java/lang/Class.h>
9 #include <org/ibex/js/JS.h>
10 #include <org/ibex/util/Log.h>
11 #include <org/ibex/plat/Linux.h>
16 extern const char **_Jv_argv;
19 void org::ibex::plat::Linux::fixEnvironment() {
20 // this wreaks havoc on gdb
21 // see http://lists.debian.org/debian-glibc/2003/debian-glibc-200311/msg00647.html
22 const char* ld_assume_kernel = getenv("LD_ASSUME_KERNEL");
23 if (ld_assume_kernel == NULL || strcmp("2.4.1", ld_assume_kernel)) {
25 printf("respawning self (%s) with LD_ASSUME_KERNEL=2.4.1\n", _Jv_argv[0]);
26 setenv("LD_ASSUME_KERNEL", "2.4.1", 1);
27 result = execvp(_Jv_argv[0], (char* const*)((void*)_Jv_argv));
28 printf("execvp() failed with error code %d\n", result);