From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from tb-mx1.topicbox.com (localhost.local [127.0.0.1]) by tb-mx1.topicbox.com (Postfix) with ESMTP id F028D2A5E33F for <9fans@9fans.net>; Sun, 21 Jun 2020 15:48:08 -0400 (EDT) (envelope-from conor.williams@gmail.com) Received: from tb-mx1.topicbox.com (localhost [127.0.0.1]) by tb-mx1.topicbox.com (Authentication Milter) with ESMTP id 3E7E6BE3355; Sun, 21 Jun 2020 15:48:08 -0400 ARC-Seal: i=1; a=rsa-sha256; cv=none; d=topicbox.com; s=arcseal; t= 1592768888; b=PbsFvExFmJgnyCC35U1LKB9cOMIsMkrXS2YfSUnUCCkPUIHTMs 39U0kiD3KJZinPstwX7HZrh2nzgK8voUUtJnPs0/GAP+2wPI0QKlbE2VBSOQ+0QW A/I3h5ducqTAEvzO6S+cRnqBpCIkvgLed0vnKXbOCafs0hp0WGNV9VcrUiDtkMVS npnsTviev4V3G9osqCoC2F7AiusXY0gCNHSoRlhwYMiOcWmrsGzD7SyYpDNlgz+q BzTmaRKhbB8IsO9q0+VNTUDiNWWVuCdDS2/KLlK91+yG/5YH0ggCiiFdBxn3Jlz6 XPDpusHhKY72NIPOhiODGEBGcSqJJ9QpIyQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-type; s=arcseal; t=1592768888; bh=esQbZC2+j9gIUXG8Ld8/UZzH6pZwLcTGqECAhF/19pA=; b=IhRmzvRUIoW5 ucp4xUf5SNgykCPmv0eVV49UnTV7ztEe+yRmLkI6OC/XN4LhKYvIjSfJYIraMDir AVVhTxPkFGePcXelB2HbmO+pspVAacNDM6dQBAmb94mF1kBPvT3733XfxdMSWRxb 957QHmkrRD0GvSFuYQgBBC1Q5u5JEDQj70eGZD0ajyVQA9UT+YA/YQBBqFmSSl6L s2M6KwNLhH96HJlu9cph6OlfchOZUb/Ro6IqR6+uFAFDHuOdLagcxDY/m4+cXLX/ EjWO6C4/nxQtY+tTMmbYuCvwgT5hbh770eHSxomkyK4k0hCHQH2h7MGG1Kz1Pyn3 IevdnAuP5A== ARC-Authentication-Results: i=1; tb-mx1.topicbox.com; arc=none (no signatures found); bimi=none (Domain is not BIMI enabled); dkim=pass (2048-bit rsa key sha256) header.d=gmail.com header.i=@gmail.com header.b=hA+Kexcv header.a=rsa-sha256 header.s=20161025 x-bits=2048; dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=quarantine policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=quarantine,d=none,d.eval=none) policy.policy-from=p header.from=gmail.com; iprev=pass smtp.remote-ip=209.85.221.42 (mail-wr1-f42.google.com); spf=pass smtp.mailfrom=conor.williams@gmail.com smtp.helo=mail-wr1-f42.google.com; x-aligned-from=pass (Address match); x-google-dkim=pass (2048-bit rsa key) header.d=1e100.net header.i=@1e100.net header.b=f04xPa5k; x-ptr=pass smtp.helo=mail-wr1-f42.google.com policy.ptr=mail-wr1-f42.google.com; x-return-mx=pass header.domain=gmail.com policy.is_org=yes (MX Records found: gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com,alt2.gmail-smtp-in.l.google.com,alt1.gmail-smtp-in.l.google.com); x-return-mx=pass smtp.domain=gmail.com policy.is_org=yes (MX Records found: gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com,alt2.gmail-smtp-in.l.google.com,alt1.gmail-smtp-in.l.google.com); x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES256-GCM-SHA384 smtp.bits=256/256; x-vs=clean score=-100 state=0 Authentication-Results: tb-mx1.topicbox.com; arc=none (no signatures found); bimi=none (Domain is not BIMI enabled); dkim=pass (2048-bit rsa key sha256) header.d=gmail.com header.i=@gmail.com header.b=hA+Kexcv header.a=rsa-sha256 header.s=20161025 x-bits=2048; dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=quarantine policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=quarantine,d=none,d.eval=none) policy.policy-from=p header.from=gmail.com; iprev=pass smtp.remote-ip=209.85.221.42 (mail-wr1-f42.google.com); spf=pass smtp.mailfrom=conor.williams@gmail.com smtp.helo=mail-wr1-f42.google.com; x-aligned-from=pass (Address match); x-google-dkim=pass (2048-bit rsa key) header.d=1e100.net header.i=@1e100.net header.b=f04xPa5k; x-ptr=pass smtp.helo=mail-wr1-f42.google.com policy.ptr=mail-wr1-f42.google.com; x-return-mx=pass header.domain=gmail.com policy.is_org=yes (MX Records found: gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com,alt2.gmail-smtp-in.l.google.com,alt1.gmail-smtp-in.l.google.com); x-return-mx=pass smtp.domain=gmail.com policy.is_org=yes (MX Records found: gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com,alt2.gmail-smtp-in.l.google.com,alt1.gmail-smtp-in.l.google.com); x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES256-GCM-SHA384 smtp.bits=256/256; x-vs=clean score=-100 state=0 X-ME-VSCause: gggruggvucftvghtrhhoucdtuddrgeduhedrudektddgudefgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpeggfhgjhfffkffuvfgtsegrtderredttdejnecu hfhrohhmpeevohhnohhrucghihhllhhirghmshcuoegtohhnohhrrdifihhllhhirghmsh esghhmrghilhdrtghomheqnecuggftrfgrthhtvghrnhepudeufeduhfeiheeltdelfeev keekfedtvdetgeeffeellefhledvuefgjefgkeetnecuffhomhgrihhnpeejrgefrdhnvg ifnecukfhppedvtdelrdekhedrvddvuddrgedvnecuvehluhhsthgvrhfuihiivgeptden ucfrrghrrghmpehinhgvthepvddtledrkeehrddvvddurdegvddphhgvlhhopehmrghilh dqfihruddqfhegvddrghhoohhglhgvrdgtohhmpdhmrghilhhfrhhomhepoegtohhnohhr rdifihhllhhirghmshesghhmrghilhdrtghomhequcfukfgkgfepudekjeefje X-ME-VSScore: -100 X-ME-VSCategory: clean Received-SPF: pass (gmail.com ... _spf.google.com: Sender is authorized to use 'conor.williams@gmail.com' in 'mfrom' identity (mechanism 'include:_netblocks.google.com' matched)) receiver=tb-mx1.topicbox.com; identity=mailfrom; envelope-from="conor.williams@gmail.com"; helo=mail-wr1-f42.google.com; client-ip=209.85.221.42 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tb-mx1.topicbox.com (Postfix) with ESMTPS for <9fans@9fans.net>; Sun, 21 Jun 2020 15:48:08 -0400 (EDT) (envelope-from conor.williams@gmail.com) Received: by mail-wr1-f42.google.com with SMTP id l11so14612477wru.0 for <9fans@9fans.net>; Sun, 21 Jun 2020 12:48:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=esQbZC2+j9gIUXG8Ld8/UZzH6pZwLcTGqECAhF/19pA=; b=hA+Kexcv8+/6ZtrXCd44fcXql3Pud4TzFl4c+Q61tmdj5BXxxX8QLItcxBcotCvL6P X8no7NM7nhRBuuv8h5ERkMSaid2OfR+DdO5F7LJPHO+FSc5XnN40nNqbSt6d5LOX7HLM nhZd4jePgcyFiD6iW2U+aL48fRbu0UBjHuhdiuK3gOmRpS4+GeKgGRkhiUHCvPqydt62 v+bLJFqjF5riAS2Khjd2eH974Mc2lZ4vDrCQejo+9SYMiXJGy1PPTl3yfwB2MY3RquSo /LRj6C5VRIZcpIq2oGWEM76mB/wBtOIHdsaT8GjU+fcMI9tQEVhCVL9FGVXU5oYxDoFE D99A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=esQbZC2+j9gIUXG8Ld8/UZzH6pZwLcTGqECAhF/19pA=; b=f04xPa5k6oz0LqtK/DLrq2I3IYVdrqFfnRlGHapSXO0/T9L9nQP+QCVJ194OCN6Wag V6IAdh1bnSY6wUAwQX1Ih/TpruRuGyploASvtiNVVLFq/vs5VGvjQuKzqi2CSAmBbLWK j+WGjVMpNcj2R6cs5PFt5i9dKdHfKGE6UVSdArVQ8ECqyKlPN9Av4fH2BisK1izSt/6W fuAsFzKd+c58kp2pCPx7CBuvqM8CUMbjNICIyvWSvN8Zqx7bk1nWApR8gKghz2+kHDt0 GHecAIVFKWqrVok9yEr/em9MTQdFyt7wGlLrebP8hc25M4CpaHDO2rhTxqnjqwGFe99j 6djA== X-Gm-Message-State: AOAM531Mde3XrqYqe/lS84WaTR6boknFU30VhseyPtO3fEd3iM+O/dgV lsHRDuJpdSsPLoz6XMRNPkgAsj0FlWI95FLuQXk= X-Google-Smtp-Source: ABdhPJwPI9Uvnh29OkS3NNyHNQGwTf+V9hVRcm0z4SIxEP6n/qnTqrjfKvlQLsrdJTt5ASDEgQHjDC9wReaN690N7ho= X-Received: by 2002:adf:f3cf:: with SMTP id g15mr13916539wrp.388.1592768887471; Sun, 21 Jun 2020 12:48:07 -0700 (PDT) MIME-Version: 1.0 References: <5F3FC59B3F854BF644300D24C6D2BBFF@eigenstate.org> In-Reply-To: From: Conor Williams Date: Sun, 21 Jun 2020 20:47:56 +0100 Message-ID: Subject: Re: [9fans] Tcl 8.7a3 port to Plan 9 To: ori@eigenstate.org Cc: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary="000000000000bf430a05a89d6759" Topicbox-Policy-Reasoning: allow: sender is a member Topicbox-Message-UUID: 2494714c-b3f8-11ea-a42c-a533194439f9 --000000000000bf430a05a89d6759 Content-Type: text/plain; charset="UTF-8" great... On Sun, Jun 21, 2020 at 8:45 PM Conor Williams wrote: > great... i will apply those and repaste > > On Sun, Jun 21, 2020 at 8:34 PM wrote: > >> > ok... attached are the compiler listings... >> >> First off, let's keep this on the list so that anyone can help out. >> >> > i have made very few changes to the code so >> > no diff yet... >> > ----------------------------- >> > # file.6 >> > ----------------------------- >> > cc -c -O -DBUILD_tcl -I"." -I/usr/glenda/tcl8.6.10/unix >> > -I/usr/glenda/tcl8.6.10/generic -I/usr/glenda/tcl8.6.10/libtommath >> > -DPACKAGE_NAME=\"tcl\" -DPACKAGE_TARNAME=\"tcl\" >> -DPACKAGE_VERSION=\"8.6\" >> > -DPACKAGE_STRING=\"tcl\ 8.6\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 >> > -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 >> > -DHAVE_STRING_H=1 -DHAVE_UNISTD_H=1 -DNO_VALUES_H=1 -DNO_DLFCN_H=1 >> > -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=0 -D_REENTRANT=1 >> -D_THREAD_SAFE=0 >> > -DTCL_CFGVAL_ENCODING=\"iso8859-1\" -DHAVE_NET_ERRNO_H=1 -DHAVE_ZLIB=1 >> > -DMODULE_SCOPE=extern -DTCL_SHLIB_EXT=\"\" -DNDEBUG=1 >> -DTCL_CFG_OPTIMIZED=1 >> > -DTCL_TOMMATH=1 -DMP_PREC=4 -DTCL_WIDE_INT_TYPE=long\ long >> > -DHAVE_STRUCT_DIRENT64=0 -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 >> -DHAVE_STRTOL=1 >> > -DHAVE_WAITPID=1 -DNO_GETWD=1 -DNO_REALPATH=1 -DNEED_FAKE_RFC2553=0 >> > -DHAVE_TERMIOS_H=1 -DHAVE_SYS_IOCTL_H=1 -DNO_FD_SET=1 >> -DHAVE_SYS_TIME_H=1 >> > -DTIME_WITH_SYS_TIME=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 >> > -DHAVE_MKTIME=1 -DHAVE_TIMEZONE_VAR=1 -DNO_FSTATFS=1 -Dsocklen_t=int >> > -Dintptr_t=int -Duintptr_t=unsigned\ int -DNO_UNION_WAIT=1 >> > -DHAVE_SIGNED_CHAR=1 -DHAVE_PUTENV_THAT_COPIES=1 -DNO_ISNAN=1 >> > -DHAVE_SYS_IOCTL_H=1 -DTCL_UNLOAD_DLLS=1 -DMP_FIXED_CUTOFFS >> > -DMP_NO_STDINT /usr/glenda/tcl8.6.10/generic/tclIOSock.c >> > /usr/glenda/tcl8.6.10/generic/tclIOSock.c:191[stdin:18411] structure >> not >> > fully declared addrinfo >> > /usr/glenda/tcl8.6.10/generic/tclIOSock.c:191[stdin:18411] structure not >> > fully declared addrinfo >> > /usr/glenda/tcl8.6.10/generic/tclIOSock.c:192[stdin:18412] structure not >> > fully declared addrinfo >> > /usr/glenda/tcl8.6.10/generic/tclIOSock.c:203[stdin:18421] structure not >> > fully declared addrinfo >> > /usr/glenda/tcl8.6.10/generic/tclIOSock.c:205[stdin:18423] structure not >> > fully declared addrinfo >> > /usr/glenda/tcl8.6.10/generic/tclIOSock.c:210[stdin:18428] structure not >> > fully declared addrinfo >> > /usr/glenda/tcl8.6.10/generic/tclIOSock.c:230[stdin:18440] structure not >> > fully declared addrinfo >> > /usr/glenda/tcl8.6.10/generic/tclIOSock.c:230[stdin:18440] name not >> > declared: AI_PASSIVE >> > /usr/glenda/tcl8.6.10/generic/tclIOSock.c:233[stdin:18443] structure not >> > fully declared addrinfo >> > /usr/glenda/tcl8.6.10/generic/tclIOSock.c:240[stdin:18450] incompatible >> > types: "IND CONST CHAR" and "INT" for op "AS" >> > /usr/glenda/tcl8.6.10/generic/tclIOSock.c:255[stdin:18461] structure not >> > fully declared addrinfo >> > too many errors >> >> First off, TCL seems to do >> >> #ifdef FOO_FEATURE >> # thing >> #endif >> >> That means that >> >> -DFOO_FEATURE=0 >> >> is the same as >> >> -DFOO_FEATURE=1 >> >> The exception I see is for threads, where undefined threadss means >> turning threading on, and -DTCL_THREADS=0 means turn it off. >> >> I removed the -DFOO=0 defines, and added -DTCL_THREADS=0. Note, it'd >> be better to import lufia's pthreads.h code from the pull request on >> 9legacy, and enable all ape programs to use pthreads. >> >> Other than that, I needed to make four changes: >> >> -DHAVE_NET_ERRNO_H=1: >> we don't have this >> -DNEED_FAKE_RFC2553=0: >> this breaks us >> -D_BSD_EXTENSION: >> we need to turn on some BSD functions. There's a good >> chance that you'll need -D_POSIX_SOURCE -D_SUSV2_SOURCE >> for some other code too; I find that pretty much any >> recent code that does nontrivial things wants these to >> be defined. >> -tclUnixPort.h:134 #include >> we don't have this, but there's no define around it; >> this works for the file I compiled, but probably breaks >> elsewhere; you'll probably need to look at what posix >> mandates is in here, and then implement it. >> >> Running on 9front amd64. the command that worked for this file: >> >> cc -c -O -D_BSD_EXTENSION -DTCL_THREADS=0 -DBUILD_tcl -I"." >> -I/tmp/tcl8.7a3/unix -I/tmp/tcl8.7a3/generic >> -I/tmp/tcl8.7a3/libtommath -DPACKAGE_NAME=\"tcl\" >> -DPACKAGE_TARNAME=\"tcl\" -DPACKAGE_VERSION=\"8.6\" >> -DPACKAGE_STRING=\"tcl\ 8.6\" -DPACKAGE_BUGREPORT=\"\" >> -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 >> -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_UNISTD_H=1 >> -DNO_VALUES_H=1 -DNO_DLFCN_H=1 -DHAVE_SYS_PARAM_H=1 >> -D_REENTRANT=1 -DTCL_CFGVAL_ENCODING=\"iso8859-1\" >> -DHAVE_ZLIB=1 -DMODULE_SCOPE=extern -DTCL_SHLIB_EXT=\"\" >> -DNDEBUG=1 -DTCL_CFG_OPTIMIZED=1 -DTCL_TOMMATH=1 -DMP_PREC=4 >> -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_GETCWD=1 >> -DHAVE_OPENDIR=1 -DHAVE_STRTOL=1 -DHAVE_WAITPID=1 -DNO_GETWD=1 >> -DNO_REALPATH=1 -DHAVE_TERMIOS_H=1 -DHAVE_SYS_IOCTL_H=1 >> -DNO_FD_SET=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 >> -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_MKTIME=1 >> -DHAVE_TIMEZONE_VAR=1 -DNO_FSTATFS=1 -Dsocklen_t=int >> -Dintptr_t=int -Duintptr_t=unsigned\ int -DNO_UNION_WAIT=1 >> -DHAVE_SIGNED_CHAR=1 -DHAVE_PUTENV_THAT_COPIES=1 -DNO_ISNAN=1 >> -DHAVE_SYS_IOCTL_H=1 -DTCL_UNLOAD_DLLS=1 -DMP_FIXED_CUTOFFS >> -DMP_NO_STDINT /tmp/tcl8.7a3/generic/tclIOSock.c >> >> With this diff applied: >> >> diff -urN tcl8.7a3/unix/tclUnixPort.h tcl8.7a3.new/unix/tclUnixPort.h >> --- tcl8.7a3/unix/tclUnixPort.h Sun Jun 21 12:32:13 2020 >> +++ tcl8.7a3.new/unix/tclUnixPort.h Sun Jun 21 12:33:16 2020 >> @@ -131,7 +131,7 @@ >> >> *--------------------------------------------------------------------------- >> */ >> >> -#include >> +//#include >> #ifdef HAVE_SYS_SELECT_H >> # include >> #endif >> >> --000000000000bf430a05a89d6759 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
great...

On Sun, Jun 21, 2020 at 8:45 PM Conor Williams <= ;conor.williams@gmail.com&g= t; wrote:
great... i will apply those and repaste

On Sun, Jun 21, 2020 at 8= :34 PM <ori@eige= nstate.org> wrote:
> ok... attached are the compiler listings...

First off, let's keep this on the list so that anyone can help out.

> i have made very few changes to the code so
> no diff yet...
> -----------------------------
> #=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 file.6=
> -----------------------------
> cc -c -O=C2=A0 =C2=A0 -DBUILD_tcl=C2=A0 -I"." -I/usr/glenda/= tcl8.6.10/unix
> -I/usr/glenda/tcl8.6.10/generic -I/usr/glenda/tcl8.6.10/libtommath
>=C2=A0 -DPACKAGE_NAME=3D\"tcl\" -DPACKAGE_TARNAME=3D\"tc= l\" -DPACKAGE_VERSION=3D\"8.6\"
> -DPACKAGE_STRING=3D\"tcl\ 8.6\" -DPACKAGE_BUGREPORT=3D\"= ;\" -DSTDC_HEADERS=3D1
> -DHAVE_SYS_TYPES_H=3D1 -DHAVE_SYS_STAT_H=3D1 -DHAVE_STDLIB_H=3D1
> -DHAVE_STRING_H=3D1 -DHAVE_UNISTD_H=3D1 -DNO_VALUES_H=3D1 -DNO_DLFCN_H= =3D1
> -DHAVE_SYS_PARAM_H=3D1 -DUSE_THREAD_ALLOC=3D0 -D_REENTRANT=3D1 -D_THRE= AD_SAFE=3D0
> -DTCL_CFGVAL_ENCODING=3D\"iso8859-1\" -DHAVE_NET_ERRNO_H=3D1= -DHAVE_ZLIB=3D1
> -DMODULE_SCOPE=3Dextern -DTCL_SHLIB_EXT=3D\"\" -DNDEBUG=3D1 = -DTCL_CFG_OPTIMIZED=3D1
> -DTCL_TOMMATH=3D1 -DMP_PREC=3D4 -DTCL_WIDE_INT_TYPE=3Dlong\ long
> -DHAVE_STRUCT_DIRENT64=3D0 -DHAVE_GETCWD=3D1 -DHAVE_OPENDIR=3D1 -DHAVE= _STRTOL=3D1
> -DHAVE_WAITPID=3D1 -DNO_GETWD=3D1 -DNO_REALPATH=3D1 -DNEED_FAKE_RFC255= 3=3D0
> -DHAVE_TERMIOS_H=3D1 -DHAVE_SYS_IOCTL_H=3D1 -DNO_FD_SET=3D1 -DHAVE_SYS= _TIME_H=3D1
> -DTIME_WITH_SYS_TIME=3D1 -DHAVE_GMTIME_R=3D1 -DHAVE_LOCALTIME_R=3D1 > -DHAVE_MKTIME=3D1 -DHAVE_TIMEZONE_VAR=3D1 -DNO_FSTATFS=3D1 -Dsocklen_t= =3Dint
> -Dintptr_t=3Dint -Duintptr_t=3Dunsigned\ int -DNO_UNION_WAIT=3D1
> -DHAVE_SIGNED_CHAR=3D1 -DHAVE_PUTENV_THAT_COPIES=3D1 -DNO_ISNAN=3D1 > -DHAVE_SYS_IOCTL_H=3D1 -DTCL_UNLOAD_DLLS=3D1=C2=A0 =C2=A0 =C2=A0 =C2= =A0-DMP_FIXED_CUTOFFS
> -DMP_NO_STDINT /usr/glenda/tcl8.6.10/generic/tclIOSock.c
>=C2=A0 /usr/glenda/tcl8.6.10/generic/tclIOSock.c:191[stdin:18411] struc= ture not
> fully declared addrinfo
> /usr/glenda/tcl8.6.10/generic/tclIOSock.c:191[stdin:18411] structure n= ot
> fully declared addrinfo
> /usr/glenda/tcl8.6.10/generic/tclIOSock.c:192[stdin:18412] structure n= ot
> fully declared addrinfo
> /usr/glenda/tcl8.6.10/generic/tclIOSock.c:203[stdin:18421] structure n= ot
> fully declared addrinfo
> /usr/glenda/tcl8.6.10/generic/tclIOSock.c:205[stdin:18423] structure n= ot
> fully declared addrinfo
> /usr/glenda/tcl8.6.10/generic/tclIOSock.c:210[stdin:18428] structure n= ot
> fully declared addrinfo
> /usr/glenda/tcl8.6.10/generic/tclIOSock.c:230[stdin:18440] structure n= ot
> fully declared addrinfo
> /usr/glenda/tcl8.6.10/generic/tclIOSock.c:230[stdin:18440] name not > declared: AI_PASSIVE
> /usr/glenda/tcl8.6.10/generic/tclIOSock.c:233[stdin:18443] structure n= ot
> fully declared addrinfo
> /usr/glenda/tcl8.6.10/generic/tclIOSock.c:240[stdin:18450] incompatibl= e
> types: "IND CONST CHAR" and "INT" for op "AS&= quot;
> /usr/glenda/tcl8.6.10/generic/tclIOSock.c:255[stdin:18461] structure n= ot
> fully declared addrinfo
> too many errors

First off, TCL seems to do

=C2=A0 =C2=A0 =C2=A0 =C2=A0 #ifdef FOO_FEATURE
=C2=A0 =C2=A0 =C2=A0 =C2=A0 #=C2=A0 =C2=A0 =C2=A0 =C2=A0thing
=C2=A0 =C2=A0 =C2=A0 =C2=A0 #endif

That means that

=C2=A0 =C2=A0 =C2=A0 =C2=A0 -DFOO_FEATURE=3D0

is the same as

=C2=A0 =C2=A0 =C2=A0 =C2=A0 -DFOO_FEATURE=3D1

The exception I see is for threads, where undefined threadss means
turning threading on, and -DTCL_THREADS=3D0 means turn it off.

I removed the -DFOO=3D0 defines, and added -DTCL_THREADS=3D0. Note, it'= d
be better to import lufia's pthreads.h code from the pull request on 9legacy, and enable all ape programs to use pthreads.

Other than that, I needed to make four changes:

=C2=A0 =C2=A0 =C2=A0 =C2=A0 -DHAVE_NET_ERRNO_H=3D1:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 we don't have t= his
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -DNEED_FAKE_RFC2553=3D0:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 this breaks us
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -D_BSD_EXTENSION:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 we need to turn on = some BSD functions. There's a good
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 chance that you'= ;ll need -D_POSIX_SOURCE -D_SUSV2_SOURCE
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 for some other code= too; I find that pretty much any
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 recent code that do= es nontrivial things wants these to
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 be defined.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -tclUnixPort.h:134 #include <sys/file.h><= br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 we don't have t= his, but there's no define around it;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 this works for the = file I compiled, but probably breaks
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 elsewhere; you'= ll probably need to look at what posix
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 mandates is in here= , and then implement it.

Running on 9front amd64. the command that worked for this file:

=C2=A0 =C2=A0 =C2=A0 =C2=A0 cc -c -O -D_BSD_EXTENSION -DTCL_THREADS=3D0 -DB= UILD_tcl -I"."
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -I/tmp/tcl8.7a3/unix -I/tmp/tcl8.7a3/generic =C2=A0 =C2=A0 =C2=A0 =C2=A0 -I/tmp/tcl8.7a3/libtommath -DPACKAGE_NAME=3D\&q= uot;tcl\"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -DPACKAGE_TARNAME=3D\"tcl\" -DPACKAGE= _VERSION=3D\"8.6\"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -DPACKAGE_STRING=3D\"tcl\ 8.6\" -DPAC= KAGE_BUGREPORT=3D\"\"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -DSTDC_HEADERS=3D1 -DHAVE_SYS_TYPES_H=3D1 -DHAV= E_SYS_STAT_H=3D1
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -DHAVE_STDLIB_H=3D1 -DHAVE_STRING_H=3D1 -DHAVE_= UNISTD_H=3D1
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -DNO_VALUES_H=3D1 -DNO_DLFCN_H=3D1 -DHAVE_SYS_P= ARAM_H=3D1
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -D_REENTRANT=3D1 -DTCL_CFGVAL_ENCODING=3D\"= ;iso8859-1\"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -DHAVE_ZLIB=3D1 -DMODULE_SCOPE=3Dextern -DTCL_S= HLIB_EXT=3D\"\"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -DNDEBUG=3D1 -DTCL_CFG_OPTIMIZED=3D1 -DTCL_TOMM= ATH=3D1 -DMP_PREC=3D4
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -DTCL_WIDE_INT_TYPE=3Dlong\ long -DHAVE_GETCWD= =3D1
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -DHAVE_OPENDIR=3D1 -DHAVE_STRTOL=3D1 -DHAVE_WAI= TPID=3D1 -DNO_GETWD=3D1
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -DNO_REALPATH=3D1 -DHAVE_TERMIOS_H=3D1 -DHAVE_S= YS_IOCTL_H=3D1
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -DNO_FD_SET=3D1 -DHAVE_SYS_TIME_H=3D1 -DTIME_WI= TH_SYS_TIME=3D1
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -DHAVE_GMTIME_R=3D1 -DHAVE_LOCALTIME_R=3D1 -DHA= VE_MKTIME=3D1
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -DHAVE_TIMEZONE_VAR=3D1 -DNO_FSTATFS=3D1 -Dsock= len_t=3Dint
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -Dintptr_t=3Dint -Duintptr_t=3Dunsigned\ int -D= NO_UNION_WAIT=3D1
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -DHAVE_SIGNED_CHAR=3D1 -DHAVE_PUTENV_THAT_COPIE= S=3D1 -DNO_ISNAN=3D1
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -DHAVE_SYS_IOCTL_H=3D1 -DTCL_UNLOAD_DLLS=3D1 -D= MP_FIXED_CUTOFFS
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -DMP_NO_STDINT /tmp/tcl8.7a3/generic/tclIOSock.= c

With this diff applied:

diff -urN tcl8.7a3/unix/tclUnixPort.h tcl8.7a3.new/unix/tclUnixPort.h
--- tcl8.7a3/unix/tclUnixPort.h Sun Jun 21 12:32:13 2020
+++ tcl8.7a3.new/unix/tclUnixPort.h=C2=A0 =C2=A0 =C2=A0Sun Jun 21 12:33:16 = 2020
@@ -131,7 +131,7 @@
=C2=A0 *-------------------------------------------------------------------= --------
=C2=A0 */

-#include <sys/file.h>
+//#include <sys/file.h>
=C2=A0#ifdef HAVE_SYS_SELECT_H
=C2=A0#=C2=A0 =C2=A0include <sys/select.h>
=C2=A0#endif

--000000000000bf430a05a89d6759--