9front - general discussion about 9front
 help / color / mirror / Atom feed
From: ori@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	[thread overview]
Message-ID: <3E7BBF2874236BB6E397A999AF9397E6@eigenstate.org> (raw)
In-Reply-To: <e7c046a1-a282-881a-24a4-2c90432ec34f@qs.co.nz>

> 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 <math.h>
>    #include <float.h>
> 
> + 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 */
>    }
>    \f
> +
> + 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 <ori@eigenstate.org>
date:        Mon Mar 09 08:02:22 2020 -0700
summary:     fix alignment in ape malloc



  reply	other threads:[~2020-03-22 20:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-21  7:56 Trevor Higgins
2020-03-22 20:52 ` ori [this message]
2020-03-24 18:26 ` [9front] " cinap_lenrek
2020-03-24 23:02   ` Trevor Higgins
2020-03-24 23:39     ` ori
2020-03-25 12:33       ` hiro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3E7BBF2874236BB6E397A999AF9397E6@eigenstate.org \
    --to=ori@eigenstate.org \
    --cc=9front@9front.org \
    --cc=plan9fullfrontal@qs.co.nz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).