X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fibex%2Fplat%2FLinux.cc;h=82d53f9f4b24cd5ddf8b172469dae3a4de1e4c00;hb=6eaf54fa906754ce35a7db0e8207fc6bbde5464d;hp=9a9e324af7cb17105804112f0b1e31f7d7da664b;hpb=3591b88b94a6bb378af3d4abe6eb5233ce583104;p=org.ibex.core.git diff --git a/src/org/ibex/plat/Linux.cc b/src/org/ibex/plat/Linux.cc index 9a9e324..82d53f9 100644 --- a/src/org/ibex/plat/Linux.cc +++ b/src/org/ibex/plat/Linux.cc @@ -1,21 +1,31 @@ -#include -#include "X11.cc" +// Copyright 2000-2005 the Contributors, as shown in the revision logs. +// Licensed under the GNU General Public License version 2 ("the License"). +// You may not use this file except in compliance with the License. +// IMPORTANT: inclusion order: always include gcjh'ed headers first, then superclass cc's, then system headers +#undef file +#include +#include +#include +#include #include +#include "X11.cc" +#include // we love libgcj! extern const char **_Jv_argv; extern int _Jv_argc; void org::ibex::plat::Linux::fixEnvironment() { - // see http://lists.debian.org/debian-glibc/2003/debian-glibc-200311/msg00647.html - const char* ld_assume_kernel = getenv("LD_ASSUME_KERNEL"); - if (ld_assume_kernel == NULL || strcmp("2.4.1", ld_assume_kernel)) { - int result; - printf("respawning self (%s) with LD_ASSUME_KERNEL=2.4.1\n", _Jv_argv[0]); - setenv("LD_ASSUME_KERNEL", "2.4.1", 1); - result = execvp(_Jv_argv[0], (char* const*)((void*)_Jv_argv)); - printf("execvp() failed with error code %d\n", result); - exit(-1); - } + // this wreaks havoc on gdb + // see http://lists.debian.org/debian-glibc/2003/debian-glibc-200311/msg00647.html + const char* ld_assume_kernel = getenv("LD_ASSUME_KERNEL"); + if (ld_assume_kernel == NULL || strcmp("2.4.1", ld_assume_kernel)) { + int result; + printf("respawning self (%s) with LD_ASSUME_KERNEL=2.4.1\n", _Jv_argv[0]); + setenv("LD_ASSUME_KERNEL", "2.4.1", 1); + result = execvp(_Jv_argv[0], (char* const*)((void*)_Jv_argv)); + printf("execvp() failed with error code %d\n", result); + exit(-1); + } }