From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mimir.eigenstate.org ([206.124.132.107]) by ewsd; Sun Mar 22 16:52:25 EDT 2020 Received: from abbatoir.fios-router.home (pool-162-83-132-245.nycmny.fios.verizon.net [162.83.132.245]) by mimir.eigenstate.org (OpenSMTPD) with ESMTPSA id 932c3cdd (TLSv1.2:ECDHE-RSA-AES256-SHA:256:NO); Sun, 22 Mar 2020 13:52:10 -0700 (PDT) Message-ID: <3E7BBF2874236BB6E397A999AF9397E6@eigenstate.org> To: plan9fullfrontal@qs.co.nz, 9front@9front.org Subject: Re: [9front] Unsolicited patch for tclsh amd64 Date: Sun, 22 Mar 2020 13:52:09 -0700 From: ori@eigenstate.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: asynchronous polling CMS markup-scale base > I have issues with tclsh on amd64, this kludge got it running for me. > > This may be helpful for others wanting to do a proper fix. > > Test results show that there are differences (problems) with handling > stderr on exec and pipelines and other stuff. > > It works enough for what I am doing. > > NOTE: The addition of compile debug flag is necessary to stop tclsh from > bombing with invalid memory reference, remove and debug at you own leisure. > > This fix is definitely not production ready. > > Diff with cleanup performed under gnu diff. > > diff -cr -x '*.acid' -x '*.tcl' -x '*.rc' -x '*.sh' > old/generic/tclExecute.c new/generic/tclExecute.c > *** old/generic/tclExecute.c 2011-01-16 22:04:09.000000000 +1300 > --- new/generic/tclExecute.c 2020-03-09 23:06:36.000000000 +1300 > *************** > *** 23,28 **** > --- 23,30 ---- > #include > #include > > + typedef long long ptrdiffL_t; > + Use uintptr_t here; we should see if we can upstream that change. > /* > * Hack to determine whether we may expect IEEE floating point. The > hack is > * formally incorrect in that non-IEEE platforms might have the same > precision > *************** > *** 683,688 **** > --- 685,693 ---- > #endif /* TCL_COMPILE_STATS */ > } > > + > + void snarf(Tcl_Interp *i,ExecStack *e) { return;} > + > /* > *---------------------------------------------------------------------- > * > *************** > *** 705,711 **** > *---------------------------------------------------------------------- > */ > > ! #define TCL_STACK_INITIAL_SIZE 2000 > > ExecEnv * > TclCreateExecEnv( > --- 710,770 ---- > *---------------------------------------------------------------------- > */ > > ! #define TCL_STACK_INITIAL_SIZE 8000 > ! void fnoop(void *) {} > ! > ! typedef union { > ! char *c; > ! long long *w; > ! } fudger; > ! > ! void * fudge(void *ptr) { Try updating -- I fixed this, we should be getting back 16 byte aligned values. If it still doesn't work, let me know. changeset: 7610:3f0285bde94f user: Ori Bernstein date: Mon Mar 09 08:02:22 2020 -0700 summary: fix alignment in ape malloc